Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MenuLib6 - Object Menus for VFP 6 is here!
Message
From
05/10/1999 05:18:05
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
04/10/1999 17:34:38
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00270919
Message ID:
00272603
Views:
26
>I have been trying your object menu class.
>Is it possible to add shortcut menu to "thisform."
>and have that shortcut menu.....command call a method on the form?
>
>thisform.Menu.ShortEdit.printsomething.command ="thisform.menuprintwhatever"
>
>I have tried with no luck
>Thanks
>
>Ken Paulson

Hi Ken,

Yes, what you want is possible, But requires a little 'tweak' when dealing with a top-level form. Unfortunately, I left that little something out of the documentation.

For menus on Top-Level forms only!
It's necessary to give the menu a reference to the form. In the demo, this is done by assigning a unique name to the form on startup, then creating a global variable that stores a reference to the form. The menu class will automatically pick up this reference when the menu is created ( as long as the variable is named "go" + Formname).

The demo provided uses the following code :-
Top-Level form Init
LOCAL lcName
DODEFAULT()
lcName = "go" + THIS.name
PUBLIC &lcName
&lcName = THIS


Top-Level form Destroy
LOCAL lcName
lcName = "go" + THIS.Name
&lcName = .NULL.
RELEASE &lcName
DODEFAULT()


I'll shortly be adding a FAQ and update to the documentation on the menulib web page at http://www.hidb.com/menulib
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform