Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to disable menu or menu items at runtime as paramete
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
01061779
Message ID:
01061790
Views:
15
>Hi All,
>i wantto disable some menus (full) or some submenus as a parameter. Which is saved in a params.dbf file . Why? some clients doesnt using some modules of my app for example invoice module. So that i wantto close/disable or hide these menus for usage for this client.
>
>How can i do this related with paramter situation .t. or .f.
>
>TIA

Hi Soykan,
Generaly I have an array sized to max PADs I have and Max bars I have in declared PADs, I use this array in "Skip when" and define users rights in it. Something like
SET SYSMENU OFF
SET SYSMENU TO
SET SYSMENU AUTOMATIC

PUBLIC ARRAY UserRights[3, 5] && 3 is a number of PADs I definded, 5 is a maximum number of BARs declared in some PAD

****
*Diable Bar3 of Popup3

UserRights[3, 3] = .t.

DEFINE PAD MyPad1 OF _MSYSMENU PROMPT "Pad1" COLOR SCHEME 3 ;
    FONT "Arial",12

DEFINE PAD MyPad2 OF _MSYSMENU PROMPT "Pad2" COLOR SCHEME 3 ;
    FONT "Arial",12

DEFINE PAD MyPad3 OF _MSYSMENU PROMPT "Pad3" COLOR SCHEME 3 ;
    FONT "Arial",12 ;

ON PAD MyPad1 OF _MSYSMENU ACTIVATE POPUP MyPopUp1
ON PAD MyPad2 OF _MSYSMENU ACTIVATE POPUP MyPopUp2
ON PAD MyPad3 OF _MSYSMENU ACTIVATE POPUP MyPopUp3

DEFINE POPUP MyPopUp1 MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE POPUP MyPopUp2 MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE POPUP MyPopUp3 MARGIN RELATIVE SHADOW COLOR SCHEME 4

DEFINE BAR 1 OF MyPopUp1  PROMPT "PopUp1 Bar1" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[1,1]

DEFINE BAR 1 OF MyPopUp2  PROMPT "PopUp2 Bar1" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[2,1]

DEFINE BAR 2 OF MyPopUp2  PROMPT "PopUp2 Bar2" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[2,2]

DEFINE BAR 1 OF MyPopUp3  PROMPT "PopUp3 Bar1" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[3,1]

DEFINE BAR 2 OF MyPopUp3  PROMPT "PopUp3 Bar2" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[3,2]

DEFINE BAR 3 OF MyPopUp3  PROMPT "PopUp3 Bar3" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[3,3]

DEFINE BAR 4 OF MyPopUp3  PROMPT "PopUp3 Bar4" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[3,4]

DEFINE BAR 5 OF MyPopUp3  PROMPT "PopUp3 Bar5" ;
    MESSAGE "Saves changes to the current file";
    SKIP FOR UserRights[3,5]
This is of course if you want user to see all possible choices you have in your application (like I want). If you want user not to see them Cetin's answer is decision.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform