Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to implement Form specific menus
Message
 
To
28/05/2004 14:25:12
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00908271
Message ID:
00908466
Views:
32
This message has been marked as the solution to the initial question of the thread.
>I've never implemented these and know it's fairly simple but don't want to spend the time to do the trial and error. Can someone point me in the right direction.

It might be helpful to start by typing "HELP DEFINEMENU" in the command window. There is an example there.

Here is some code. Create a form. Make sure it is a TOPLEVEL form. Then, paste this code in the form's init event and run the form!
DEFINE MENU MyMenu IN (thisform.Name) BAR STYLE 'BT' COLOR SCHEME 8
DEFINE PAD FILE  OF MyMenu PROMPT "File" COLOR SCHEME 3 ;
	KEY ALT+F, ""
DEFINE PAD EDIT  OF MyMenu PROMPT "Edit" COLOR SCHEME 3 ;
	KEY ALT+E, ""

ON PAD FILE OF  MyMenu ACTIVATE POPUP FILE && FILE
ON PAD EDIT OF  MyMenu ACTIVATE POPUP EDIT && Edit

* Files popup definition
DEFINE POPUP FILE MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF FILE PROMPT "File \<maintenance" KEY ALT+M,"ALT+M" &&;
     PICTURE ucpopImageFolder+"file.Bmp" SKIP FOR VARTYPE(frmFileMaintenance)==[O]
DEFINE BAR 3 OF FILE PROMPT "\-"	
DEFINE BAR 2 OF FILE PROMPT "C\<ompany setup" KEY ALT+O,"ALT+O" &&;
     PICTURE ucpopImageFolder+"popCompany.BMP" SKIP FOR VARTYPE(frmCompanySetup)==[O]

* Edit Popup definition
DEFINE POPUP EDIT MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF EDIT PROMPT "\<Store locations" KEY ALT+T,"ALT+T" &&;
     PICTURE ucpopImageFolder+"popStores.Bmp" SKIP FOR VARTYPE(frmStores)==[O]
DEFINE BAR 2 OF EDIT PROMPT "\<Product descriptions" KEY ALT+P,"ALT+P" &&;
     PICTURE ucpopImageFolder+"popProducts.Bmp" SKIP FOR VARTYPE(frmProductDescriptions)==[O]

ON SELECTION BAR 1 OF FILE MESSAGEBOX([File Maintenance])
ON SELECTION BAR 2 OF FILE MESSAGEBOX([Company Setup])

ACTIVATE MENU MyMenu NOWAIT
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform