Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Top Level Form Menus
Message
From
29/03/1999 23:53:04
 
 
To
29/03/1999 23:34:27
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00203301
Message ID:
00203308
Views:
15
>I have a menu which I've placed on a top level form... every thing seems to be ok except that I can't access the menu using the hot keys. Any idea why?
>
>Thanx!

This can be a little tricky. I have code like this in my load event in modal top level forms.... ( I suspect you're using 'modal' forms)
* assumes WITH THISFORM
	IF .editPop
		* allow edit controls without a visible edit menu (eg top level forms)
		LOCAL cSM, cSP
		.editPop= RIGHT(SYS(2015),6)		&& yes, we ARE changing the type!
		cSM= 'M_' + .editPop
		cSP= 'P_' + .editPop
		DEFINE MENU (m.cSM) IN (.name) BAR
		DEFINE PAD _msm_edit OF (m.cSM) PROMPT "Edit"
		ON PAD _msm_edit OF (m.cSM) ACTIVATE POPUP (m.cSP)
		DEFINE POPUP (m.cSP) MARGIN RELATIVE
		DEFINE BAR _med_undo OF (m.cSP) PROMPT "\&lt.Undo" ;
			KEY CTRL+Z
		DEFINE BAR _med_redo OF (m.cSP) PROMPT "Re\&lt.do" ;
			KEY CTRL+R
		DEFINE BAR _med_cut OF (m.cSP) PROMPT "Cu\&lt.t" ;
			KEY CTRL+X
		DEFINE BAR _med_copy OF (m.cSP) PROMPT "\&lt.Copy" ;
			KEY CTRL+C
		DEFINE BAR _med_paste OF (m.cSP) PROMPT "\&lt.Paste" ;
			KEY CTRL+V
		DEFINE BAR _med_slcta OF (m.cSP) PROMPT "Se\&lt.lect All" ;
			KEY CTRL+A
	ENDIF

*Notice the "IN (.name)" clause

* In the query unload event...
	IF TYPE('.editPop') = 'C'
		RELEASE POPUP ('P_' + .editPop) EXTENDED
		RELEASE MENU ('M_' + .editPop) EXTENDED
	ENDIF
HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform