Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP active Toolbars
Message
 
To
21/09/1997 01:26:16
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00050952
Message ID:
00050955
Views:
27
>Trying to create production version of a project and when run, whatever toolbars were active within VFP at the time of the Executable's creation, are present/visible within the run-time module.
>
>What a pain it is to have to close all the active toolbars in VFP before creating the EXE file. Is there a way to programmatically close all the system's toolbars so that only mine show up withOUT closing them through the menu prior to compilation? Relp!
>
>TIA!
>
>
>
>mark@remarkable-systems.com

The following routines will close all open toolbars and then reopen them when the application ends. I call ReleaseToolBars during the initialization of my application object. ShowToolBars is called when the application exits.
* Defines for use with ReleaseToolBars
*-- Toolbar names
#DEFINE TB_FORMDESIGNER_LOC  "Form Designer"
#DEFINE TB_STANDARD_LOC      "Standard"
#DEFINE TB_LAYOUT_LOC        "Layout"
#DEFINE TB_QUERY_LOC        "Query Designer"
#DEFINE TB_VIEWDESIGNER_LOC  "View Designer"
#DEFINE TB_COLORPALETTE_LOC  "Color Palette"
#DEFINE TB_FORMCONTROLS_LOC  "Form Controls"
#DEFINE TB_DATADESIGNER_LOC  "Database Designer"
#DEFINE TB_REPODESIGNER_LOC  "Report Designer"
#DEFINE TB_REPOCONTROLS_LOC  "Report Controls"
#DEFINE TB_PRINTPREVIEW_LOC  "Print Preview"

* ReleaseToolBars Method
   *-- Releases all Visual FoxPro toolbars
   LOCAL i

   DIMENSION THIS.aToolBars[11,2]
   THIS.aToolBars[1,1] = TB_FORMDESIGNER_LOC
   THIS.aToolBars[2,1] = TB_STANDARD_LOC
   THIS.aToolBars[3,1] = TB_LAYOUT_LOC
   THIS.aToolBars[4,1] = TB_QUERY_LOC
   THIS.aToolBars[5,1] = TB_VIEWDESIGNER_LOC
   THIS.aToolBars[6,1] = TB_COLORPALETTE_LOC
   THIS.aToolBars[7,1] = TB_FORMCONTROLS_LOC
   THIS.aToolBars[8,1] = TB_DATADESIGNER_LOC
   THIS.aToolBars[9,1] = TB_REPODESIGNER_LOC
   THIS.aToolBars[10,1] = TB_REPOCONTROLS_LOC
   THIS.aToolBars[11,1] = TB_PRINTPREVIEW_LOC

   FOR i = 1 TO ALEN(THIS.aToolBars, 1)
      THIS.aToolBars[i,2] = WVISIBLE(THIS.aToolBars[i,1])
      IF THIS.aToolBars[i,2]
         HIDE WINDOW (THIS.aToolBars[i,1])
      ENDIF
   ENDFOR


*ShowToolBars Method
   LOCAL i

   *-- Show all VFP toolbars that were previously hidden
   FOR i = 1 TO ALEN(THIS.aToolBars, 1)
      IF THIS.aToolBars[i,2]
         SHOW WINDOW (THIS.aToolBars[i,1])
      ENDIF
   ENDFOR
Steve Ruhl
CitiMortgage, Inc.
steven.ruhl@citibank.com Office
Steve@steven-ruhl.com Home
Previous
Reply
Map
View

Click here to load this message in the networking platform