Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A password embedded within a menu
Message
From
21/10/2004 11:24:13
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00953243
Message ID:
00953338
Views:
27
>Hi! Designed a menu using the menu designer, what I want to do is place a password within one of the options of the menu, if entered correctly I want to go deeper into the menu structure.
>
>Is this possible?
>
>I had suggested logging users in & giving them rights to different levels of the menu structure but the customer insists they do not want this.
>
>Any help extremely appreciated
>
>TIA


Hi Robin,

I think it is better if you change the generated menu code directly.
This is a prg example, but it is not different with the code you get from the generated one.
Put this code into "test_menu.prg" then run it
***
*** Test_Menu.PRG
***

Set sysmenu to
Set sysmenu automatic
Define pad Pad_1 of _MSysMenu prompt '\<Menu 1' Key Alt+M
Define pad Pad_2 of _MSysMenu prompt '\<Password' Key Alt+P
On pad Pad_1 of _MSysMenu activate popup Popup_1
On selection pad Pad_2 of _MSysMenu Do CheckPass in Test_Menu.prg

Define popup Popup_1 margin
Define bar 1 of Popup_1 prompt 'Test #1'
Define bar 2 of Popup_1 prompt 'Finish'
On selection popup Popup_1 ;
   Do OnSelection with popup(), bar(), prompt() in Test_Menu.prg

Define popup Popup_2 margin
Define bar 1 of Popup_2 prompt 'Test #2'
Define bar 2 of Popup_2 prompt 'Finish'
On selection popup Popup_2 ;
   Do OnSelection with popup(), bar(), prompt() in Test_Menu.prg


Procedure OnSelection( tc_Popup, tn_Bar, tc_Prompt )
   If (tc_Prompt == 'Finish')
      Set sysmenu to default
   else
      MessageBox( '"' + tc_Prompt + '"  on  "' + tc_Popup + '"  selected' )
   endif
EndProc


Procedure CheckPass
Local lc_Password

   lc_Password = InputBox( 'Enter your password' )
   If ( upper(lc_Password) == 'ROBIN' )
      On pad Pad_2 of _MSysMenu activate popup Popup_2
      Activate menu _MSysMenu pad Pad_2
   endif
EndFunc
Regards
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform