Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ideas for placing shapes around a circle
Message
From
18/05/2005 08:41:05
 
 
To
18/05/2005 03:12:06
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01015215
Message ID:
01015283
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
>I need to place a certain number of shapes inside a circular sector,
>to be clear : I need to figure the sits inside a circular theatre, I thought about the new syntax involving the poypoint and rotation property but I
>didn' find that much in the VFP Help.
>has anybody tested something similar ?
>Thx
>Alessio

Gioca con questo:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	desktop = .t.
	autocenter = .t.
	Height = 581
	Width = 765
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	PROCEDURE Init
		#define numero 20

		this.AddProperty([posti(numero)],null)

		stepAngle = 2*PI()/numero
		XCenter   = (this.width-60)/2
		YCenter	  = (this.height-60)/2
		radius	  = 200
		FOR k=1 TO numero
			this.AddObject("posti["+LTRIM(STR(m.k))+"]","Posto")
			WITH this.Controls[m.k]

				.Fillcolor = MOD(m.k,2)*255
				
				.Rotation = RTOD(stepAngle*m.k)

				.Move(m.XCenter - m.radius*COS(m.stepAngle*m.k);
                                     ,m.YCenter + m.radius*SIN(m.stepAngle*m.k))
				
				.visible = .t.
			ENDWITH
		NEXT

	ENDPROC


ENDDEFINE

DEFINE CLASS Posto AS Shape
	* is need a square
	heighT     = 60
	width	   = 60
 	backstyle  = 0
	FillStyle  = 0
	
	DIMENSION aPoints(4,2)
	aPoints			= 30
	aPoints[2,1]	= 70
	aPoints[3,1]	= 70
	aPoints[3,2]	= 70
	aPoints[4,2]	= 70
	PolyPoints	= "this.aPoints"
	
ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform