Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding / Deleting menu item at run time
Message
From
03/07/2001 21:49:45
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
03/07/2001 20:46:57
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00526531
Message ID:
00526549
Views:
14
Hi Diana,
DEFINE PAD NewTest OF _MSYSMENU PROMPT '\should work. It is confusing at times, but, you can test away at the command window until you get it right. For each unique thing you need a way to create it or release it. For example here's a PRG
Pad1.PRG
DEFINE PAD NewTest OF _MSYSMENU PROMPT '\PROCEDURE Release
RELEASE PAD NewTest OF _MSYSMENU
ENDPROC
Now I know anytime I DO Pad1 I get the pad. If I DO Release IN Pad1.PRG the pad is removed.
You can do as much as you want with each little program, but the rules are to only do as much as ALWAYS goes together.

Figure out all the possible Pads, Bars, and such that you will need. Create some class/procedure (MenuHandler) that can determine what is needed. Say form X is up being used by user Y in situation Z. What menus should be defined? Give each item (Pad/Bar/whatever) a Name, token string, (it's going to be the PRG name!) it can go by. For example, the MenuHandler says we need MenuA, PadB, and Bar1 and Bar2. It has an array to track what's currently being used. It RELEASEs what's not needed and DOes what's needed.

Alternatively, you can make a basic menu and
SET SYSMENU SAVE
then go back to that starting point anytime by
SET SYSMENU TO DEFAULT
Then you only add pads/bars each time the situation changes. Now you can just add items without worrying about items that need released and items that are already there.
Does this seem like it would work?


>Hi everybody,
>
>Background:
>I'm using VFP 6.0. I have a project which include several menus (around 15 menus) already built in the project. These menus were created using the Menu Designer. My application is deploy to many client/companies.
>
>Now the question:
>I've been asked to customize each menu depending on the client/user meaning that some menu item will be visible to some clients while they will be invisible to other clients (I really means invisible, not just desabled). I tough I could keep the "basic" menus in the project then include additionnal menu item at run time, but I have no ideas how to achieve that. I tried DEFINE PAD but I got an error saying that the menu was not created using DEFINE MENU :-(
>
>Does anybody has an idea?
>
>TIA
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform