Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Draw floor plan in Foxpro

Status
Not open for further replies.

takyan

Programmer
Oct 16, 2002
84
HK
Hi, I want to draw a floor plan on a form to illustrate the object of a floor of a warehouse? Can you suggest any method to do this? It is welcomed to suggest any plug-in software. Thx lot

Yan
 
You first need to let us know which version of Foxpro you are using.

Unfortunately, in spite of your FP version, your options are limited.

If you are using one of the Visual Foxpro versions you are in luck for meeting your graphical needs, but you need to post your question in the Visual Foxpro Forum forum184

If not a Visual version, there used to be some 3rd party programs such as Flipper which would help you out, but most of those companies and their products are long gone now.

Good Luck,

JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
The VFP solution samples show a couple examples of this - basically you just need a COM (ActiveX) control that allows this. One of the early examples of using the Visual Basic 5.0 Control Creation Edition (1996) was to create a simple "paint" control that could be used in VFP 5.0!

Rick
 
Here's what I did using native Foxpro windows stuff. First, I drew a bitmap as a visual template of the area I was going to be placing objects on and set it as the background using @...SAY 'SomeFile.BMP' BITMAP.
I then placed a 'grid' of invisible push buttons over the bitmap, using this code:

Code:
*!*********************************************************
PROCEDURE dispfloor
*!*********************************************************
WAIT WINDOW 'Display floor...' NOWAIT
FOR i = 0 TO 25
   STORE 'row' + CHR(i + 65) TO xrow
     @ 0.071 + (i * .95) ,0.200 GET &xrow PICTURE ;
     "@*IHNT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" ;
     SIZE .95,2.400,0.000 ;
     DEFAULT 0 ;
     FONT "Arial", 8 ;
     VALID whichisit()
NEXT ( i )
RETURN

When one of the invisible pushbuttons is clicked, the following function gets called which only returns the x/y coordinate of the button clicked. Those coordinates can be stored in a table and used to draw some item later, using the procedure dispmach(), which follows this one:
Code:
*!*********************************************************
*!       Function: WHICHISIT
*!*********************************************************
FUNCTION whichisit
*
STORE VARREAD() TO thevar
therow = RIGHT(ALLTRIM(thevar), 1)
thecol = ALLTRIM(STR(&thevar, 2))
RETURN .F.
*!*********************************************************

Draw the items here:
Code:
*!*********************************************************
*!      Procedure: DISPMACH
*!*********************************************************
PROCEDURE dispmach

SCAN
   STORE l_rowx - l_colx TO varname  &&... x/y coord
   @ 0.071 + (l_rown * .95) , ;
     0.400 + ((l_coln - 1) * 2.4) GET &varname ;
     PICTURE "@*HNIT  " ;
     SIZE .95,2.400,0.000 ;
     DEFAULT 0 ;
     FONT "Arial", 8 ;
     STYLE "B";
     VALID findmach() &&... looks up machine when clicked
ENDSCAN
RETURN
*!*********************************************************
Now, to choose on of the items:
Code:
*!*******************************************************
*!       Function: FINDMACH
*!*******************************************************
FUNCTION findmach
   
STORE VARREAD()   TO m_pos
STORE m.cust_id + ALLTRIM(area) + m_pos TO seekkey
      
SET ORDER TO rowxcolx
SEEK seekkey
      
IF &m_pos > 0
   *... display info about item clicked here
   &m_pos = 0
ENDIF ( &m_pos > 0 )
KEYBOARD("{HOME}")
SHOW GET dowhat
  
RETURN .T.


Dave S.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top