Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Line control
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00853852
Message ID:
00856596
Views:
18
If you want to keep it simple and under your own control, you could define a container that scales the lines that you have drawn within it, such as
DEFINE CLASS myContainer AS Container
	Height = 169
	Left = 63
	Top = 43
	Width = 316
	MultFact = 1.5
	
	PROCEDURE MouseDown
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		
		* Calculate the pan values from mouse to container centre
		nCentreX = This.Left + This.Width/2
		nCentreY = This.Top  + This.Height/2
		lnXPan = nCentreX - nXCoord
		lnYPan = nCentreY - nYCoord
		
		* Pan the lines
		FOR t = 1 TO This.ControlCount
			This.Controls[t].Left   = This.Controls[t].Left + lnXPan
			This.Controls[t].Top    = This.Controls[t].Top  + lnYPan
		ENDFOR
		
		* Resize the lines
		* Zoom in with left button, out with right
		DO CASE
		CASE nButton = 1
			* Left button
			lnZoom = This.MultFact
		CASE nButton = 2
			* Right button
			lnZoom = 1/This.MultFact
		ENDCASE
		FOR t = 1 TO This.ControlCount
			* Increase height of the line
			This.Controls[t].Height = lnZoom*This.Controls[t].Height
			* Move line up by zoomed distance from centre of container
			This.Controls[t].Top    = nCentreY - lnZoom*(nCentreY - This.Controls[t].Top)
			* Increase width of line
			This.Controls[t].Width  = lnZoom*This.Controls[t].Width
			* Move line left by zoomed distance from centre of container
			This.Controls[t].Left   = nCentreX - lnZoom*(nCentreX - This.Controls[t].Left)
		ENDFOR
	ENDPROC
	
ENDDEFINE
Add an instance of this container to the form and draw your lines in it. A left mouse click will 'zoom' in and a right mouse click will 'zoom' out with a factor of 1.5. The display in the container will pan to centre the point where the mouse was clicked (more or less)

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform