Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where did the toolbar came from?
Message
From
30/01/1997 04:53:02
 
 
To
29/01/1997 08:09:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00018687
Message ID:
00018800
Views:
32
>Dear Visual FoxPro users
>
>I haven't had a toolbar in my application, but yeasterday when I created a executable file I got VFP standared toolbar in my application. I haven't worked with any kind of toolbars, so I don't know where it came from. what should I SET or do If I don't want any kind of toolbar in my program? Thanks in advance.

DEFINE CLASS mcusvfptool AS custom


Name = "mcusvfptool"

*-- array to hold the toolbars & their state
PROTECTED avfptoolbars[11,2]


PROCEDURE Init
*
* Store the VFP toolbar names in the array
*
THIS.aVFPToolbars[1,1] = "Form Designer"
THIS.aVFPToolbars[2,1] = "Standard"
THIS.aVFPToolbars[3,1] = "Layout"
THIS.aVFPToolbars[4,1] = "Query Designer"
THIS.aVFPToolbars[5,1] = "View Designer"
THIS.aVFPToolbars[6,1] = "Color Palette"
THIS.aVFPToolbars[7,1] = "Form Controls"
THIS.aVFPToolbars[8,1] = "Database Designer"
THIS.aVFPToolbars[9,1] = "Report Designer"
THIS.aVFPToolbars[10,1] = "Report Controls"
THIS.aVFPToolbars[11,1] = "Print Preview"
*
* And loop through them seeing if they are visible
* If they are wvisible() then hide them.
*
local lnCount
FOR lnCount = 1 TO ALEN(THIS.aVFPToolbars,1)
THIS.aVFPToolbars[lnCount,2] = WVISIBLE(THIS.aVFPToolbars[lnCount,1])
IF THIS.aVFPToolbars[lnCount,2]
hide window (THIS.aVFPToolbars[lnCount,1])
ENDIF
ENDFOR
ENDPROC


PROCEDURE Destroy
*
* then, when the app terminates, put them back
*
local lnCount
FOR lnCount = 1 TO alen(THIS.aVFPToolbars,1)
IF THIS.aVFPToolbars[lnCount,2]
show window (THIS.aVFPToolbars[lnCount,1])
ENDIF
ENDFOR
ENDPROC


ENDDEFINE



PROCEDURE DESTROY
*
* then, when the app terminates, put them back
*
local lnCount
FOR lnCount = 1 TO alen(THIS.aVFPToolbars,1)
IF THIS.aVFPToolbars[lnCount,2]
show window (THIS.aVFPToolbars[lnCount,1])
ENDIF
ENDFOR

ENDPROC

ENDDEFINE


Simply create an instance of this in your application, when you close the program, the variable pointing to it goes out of scope and the destroy restores the toolbars that were visible.

I use loTool = CREATEOBJECT("mcusVFPTool")

"m" for the application specific classes
"cus" because it's custom
"VFPTool" because that's what it fiddles with
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform