Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MenuLib6 - Object Menus for VFP 6 is here!
Message
De
05/10/1999 05:18:05
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
04/10/1999 17:34:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00270919
Message ID:
00272603
Vues:
27
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform