Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding / Deleting menu item at run time
Message
From
04/07/2001 07:33:21
 
 
To
03/07/2001 21:49:45
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00526531
Message ID:
00526643
Views:
14
there are a couple of excellent tools here in the Tread download section which are made for situations such as this.

1. http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~2,54,Forum=5,28,1104

2. http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~2,54,Forum=5,28,1258

I developed a technique like option 2, many many years ago and in the last 3 years have since converted to the object menus in option 1.

Glenn

>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
Previous
Reply
Map
View

Click here to load this message in the networking platform