Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move object container inside a container
Message
From
15/12/2008 16:02:13
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01367578
Message ID:
01367617
Views:
11
wow!! cool!! straight to the target!! amazing stuff!!

tks

Claudio

>Hi Claudio,
>
>Maybe something like this might get you started, it is a dirty solution thou, I din not put much thought onto it
>
>
>loForm				= NEWOBJECT('myForm')
>loForm.Show(1)
>
>define class myForm AS Form
>
>	Height					= 401
>	Width					= 759
>	DoCreate				= .T.
>	BorderStyle				= 3
>	Name					= "myForm"
>
>	add object ctrParentContainer AS ParentContainer WITH ;
>		Top						= 48, ;
>		Left					= 25, ;
>		Width					= 361, ;
>		Height					= 110, ;
>		Name					= "ctrParentContainer"
>
>enddefine
>
>define class ParentContainer as Container
>
>	add object MovableContainer1 as MovableContainer with ;
>		Top						= 16, ;
>		Left					= 23, ;
>		Width					= 100, ;
>		Height					= 47, ;
>		Name					= "MovableContainer1", ;
>		RestrictHorizontal		= .f., ;
>		RestrictVertical		= .f.
>	
>	add object MovableContainer2 as MovableContainer with ;
>		Top						= 70, ;
>		Left					= 23, ;
>		Width					= 100, ;
>		Height					= 47, ;
>		Name					= "MovableContainer2", ;
>		RestrictHorizontal		= .t., ;
>		RestrictVertical		= .f.
>
>	add object MovableContainer3 as MovableContainer with ;
>		Top						= 16, ;
>		Left					= 120, ;
>		Width					= 100, ;
>		Height					= 47, ;
>		Name					= "MovableContainer3", ;
>		RestrictHorizontal		= .f., ;
>		RestrictVertical		= .t.
>
>	add object MovableContainer4 as MovableContainer with ;
>		Top						= 70, ;
>		Left					= 120, ;
>		Width					= 100, ;
>		Height					= 47, ;
>		Name					= "MovableContainer4", ;
>		RestrictHorizontal		= .t., ;
>		RestrictVertical		= .t.
>enddefine
>
>
>define class MovableContainer as Container
>	Moving					= .f.
>	Starting				= null
>	RestrictHorizontal		= .f.
>	RestrictVertical		= .f.
>	
>	add object lblCaption as Label with ;
>		Top						= 1, ;
>		Left					= 1, ;
>		FontName				= 'ArialNarrow', ;
>		FontSize				= 8, ;
>		Enabled					= .f.
>		
>	PROCEDURE Init
>		this.lblCaption.Caption	= 'Restrict X: ' + Transform(this.RestrictHorizontal) + ' Y: ' + Transform(this.RestrictVertical)
>		this.Starting			= Createobject('Empty')
>		Addproperty(this.Starting, 'X', null)
>		Addproperty(this.Starting, 'Y', null)
>		Addproperty(this.Starting, 'Left', null)
>		Addproperty(this.Starting, 'Top', null)
>	ENDPROC
>
>	PROCEDURE MouseDown
>		LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>		if nButton = 1
>			this.Moving			= .t.
>			this.Starting.Left	= this.Left
>			this.Starting.Top	= this.Top
>			this.Starting.X		= nXCoord
>			this.Starting.Y		= nYCoord
>		endif
>	ENDPROC
>
>
>	PROCEDURE MouseUp
>		LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>		if nButton = 1
>			this.Moving		= .f.
>		endif
>	ENDPROC
>
>
>	PROCEDURE MouseMove
>		LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>		if this.Moving
>			this.Left			= this.Starting.Left + Iif(this.RestrictHorizontal, 0, (nXCoord - this.Starting.X))
>			this.Top			= this.Starting.Top + Iif(this.RestrictVertical, 0, (nYCoord - this.Starting.Y))
>		endif
>	ENDPROC
>enddefine
>
>
>
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform