Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making menu items conditionally invisible
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00555890
Message ID:
00555926
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi everybody,
>>>
>>>How can I make some items in the menu invisible under certain conditions (user rights, for example). I know, I can disable item using SKIP FOR, but I don't want to show this item at all.
>>>
>>>Thanks a lot in advance.
>>
>>Try looking at PUSH MENU and POP MENU along with the RELEASE PAD command. What you can do is issue PUSH MENU prior to releasing the pad, then when you want to restore it, POP MENU will do that. VFP's menuing system is based on a LIFO (Last in, first out) stack. The PUSH MENU places a copy of the menu on the stack and POP MENU restores it. Try this from the command window
PUSH MENU _MSYSMENU
>>RELEASE PAD _MEDIT OF _MSYSMENU
>>POP MENU _MSYSMENU
When you issue the RELEASE PAD command, the Edit menu will disappear and POP will restore it.
>
>I was hoping to find something simple, what I can declare in a menu itself. Here is the reason for my question:
>We have developer system and a live system. "Developer" menu has more items, than "Live", so then we migrate menu from one server to another, we have to manually delete some items. I was thinking about a way to automate this process. Also it would be good to only show items, which are acessable by the user, to not distract him/her by disabled items...

Just add a line to check if you're running in development or run-time mode. If run-time, release the appropriate pads.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform