Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Map shape
Message
De
25/08/2005 12:28:41
 
 
À
25/08/2005 12:04:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01043939
Message ID:
01043950
Vues:
12
>I apologize for coming back to this issue, but I am stumped and need your help, so I thought I would restate the problem.
>
>I am attempting to write an application with a map on a form. The map is larger than the screen. When a user clicks on the map a shape appears. The code for that is located in the map image mouseup procedure. The code works fine. When the mouse is clicked a shape appears on the map where the click occurred. Here is the code that works.
>
>
>If nButton = 1 AND VARTYPE(Sys(1270))=='O' AND Sys(1270)=m.this
>	Thisform.AddObject( Sys(2015), "shape")
>	With Thisform.Controls[thisform.ControlCount]
>		.Move(nXCoord,nYCoord,25,25)
>		.Curvature = 99
>		.BackColor = 255
>		.BackStyle = 1
>		.borderwidth = 2
>		.bordercolor = 65535
>		.SpecialEffect = 0
>		.ToolTipText = "Crime scene"
>		.Visible = .T.
>	Endwith
>Endif
>
>
>However, a user would only place one shape on the map every day or two. So, when the application is started a second, third, or fourth time the user opens a table and the coordinates of previous shapes on the map are available for loading and display of the shapes. I have the file loading code written.
>
>Can the code above be easily altered to ‘refresh’ the map with the previous shapes using the ‘right click’ procedure of the map?

this is not the best design, but:
* the table
circleName C(10) NOT NULL, nX I NOT NULL,nY I NOT NULL
* index on circleName tag PK  && add for a shared support

* Save
  loop
   with thisform.controls[...] && a shape circle
  INSERT INTO thetable values (.Name,.Left,.Top)
  ....

* add a parameter Name to the .mapImage.MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord,      Name

If pcount()=5 OR nButton = 1 AND VARTYPE(Sys(1270))=='O' AND Sys(1270)=m.this
	Thisform.AddObject(IIF(PCOUNT()=5,m.Name,Sys(2015)), "shape")
	With Thisform.Controls[thisform.ControlCount]
		.Move(nXCoord,nYCoord,25,25)
		.Curvature = 99
		.BackColor = 255
		.BackStyle = 1
		.borderwidth = 2
		.bordercolor = 65535
		.SpecialEffect = 0
		.ToolTipText = "Crime scene"
		.Visible = .T.
	Endwith
Endif

*  RightClick refresh
 with  thisform.mapImage
   SELECT THETABLE
   SCAN && FOR NOT PEMSTAT(m.thisform,circleName,5) && add for a shared support
      .MouseUp(null,null,nX,nY,circleName)
   ENDSCAN
 endwith
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform