Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Named menu bars just don't work, do they?
Message
 
 
To
14/03/2000 16:04:22
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00345540
Message ID:
00345577
Views:
22
In the MPRs that the GenMenu always creates, the first lines are:

SET SYSMENU TO
SET SYSMENU AUTOMATIC

Then come all the DEFINESs. Now my custom menu is active. When I no longer want it active, I just issue:

SET SYSMENU TO DEFAULT

Works everytime. When I need another pad that relates to a particular form, I just add another pad to the menu:
DEFINE PAD _PWSEdit OF _MSYSMENU BEFORE VTSHELP ;
   PROMPT "PW\<S" COLOR SCHEME 3 KEY ALT+S, ""

ON PAD _PWSEdit OF _MSYSMENU ACTIVATE POPUP pws

DEFINE POPUP pws MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF pws PROMPT "Addresses"
DEFINE BAR 2 OF pws PROMPT "Violations"
DEFINE BAR 3 OF pws PROMPT "Enforcement Actions"
DEFINE BAR 4 OF pws PROMPT "SNC Data"
ON SELECTION BAR 1 OF pws oApp.DoForm("Address", "frmAddress")
ON SELECTION BAR 2 OF pws oApp.DoForm("Viols", "frmViolations")
ON SELECTION BAR 3 OF pws oApp.DoForm("EnfActs", "frmEnfActs")
ON SELECTION BAR 4 OF pws oApp.DoForm("SncData", "frmSncData")
Keep in mind all of this was generated for me, and all I do is cut and paste into a PRG. I first start out by creating a menu and selecting the Quick Menu option. I modify from there.

>Following on from two recent threads, here is a second example of code that apparently proves that "named" menu bars don't work. Or at least don't work in the simple way that I expected, which is to say as a way of storing multiple menu bar definitions and being ble to activate any one as required (basically different forms want different menu bars).
>Perhaps someone knows what they are intended for, and why they can't be used in the way I visualise.
>Try this:
>
>* How do you swap between named menus? Not this way apparently.....
>
>set sysmenu to default
>
>* Define a couple of bars
>*
>define menu TESTBARA bar
>define pad testbar1 of testbarA prompt "testbarA"
>
>define menu TESTBARB bar
>define pad testbar1 of testbarB prompt "testbarB"
>
>*********************************************************************************
>wait Window " METHOD 1. Simply activate one menu, then the other, then the first"
>push menu _msysmenu && Save original
> Wait window " Key to see bar A"
> activate menu testbara nowait && Display bar a
>
> Wait window " Key to see bar B"
> activate menu testbarb nowait && Display bar b
>
> Wait window " Key to see bar A (again), BUT you WON'T. "
> activate menu testbara nowait&& Display bar a
>
> Wait window "Key to see std _msysmenu (by a pop)"
>pop menu _msysmenu && Won't work, interestingly it DOES show barA
>
>Wait window "Oddly we now see barA. Key to see std sysmenu (by a default)"
>set sysmenu to default && Clear up cockups
>
>*********************************************************************************
>wait Window " METHOD 2. Use deactiates as well as activates. This just doesn't work AT ALL. bara does not appear and then can't be deactivated"
>push menu _msysmenu && Save original
> Wait window " Key to see bar A"
> activate menu testbara nowait && Display bar a
>
> Wait window " Key to see bar B"
> deactivate testbara
> activate menu testbarb nowait && Display bar b
>
> Wait window " Key to see bar A (again), BUT you WON'T. "
> deactivate testbarb
> activate menu testbara nowait&& Display bar a
>
> Wait window "Key to see std _msysmenu (by a pop)"
>pop menu _msysmenu && Won't work, interestingly it DOES show barA
>
>Wait window "Oddly we now see barA. Key to see std sysmenu (by a default)"
>set sysmenu to default && Clear up cockups
>
>*****************
>* Method 3. I give UP
>
>return
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform