Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DEFINE POPUP Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00239112
Message ID:
00241243
Vues:
12
>I have a label class with the following in the click event:
>
>DEFINE POPUP Shortcuts FROM MROW(), MCOL() SHORTCUT
>
>DEFINE BAR 1 OF Shortcuts PROMPT "January"
>DEFINE BAR 2 OF Shortcuts PROMPT "Februay"
>.
>.
>DEFINE BAR 12 OF Shortcuts PROMPT "December"
>
>ON SELECTION POPUP ShortCuts oShortcuts.RunCommands()
>
>
>I would like to put the ON SELECTION commands in the
>class so I can just drop it onto a container.
>
>How do I set it up so that the commands can be contained
>in the label class? Right now I have a public object called
>oShortcuts which handles all my ON SELECTION code, but
>the code is then in a separate object.
>
>Any thoughts?

Hi Kevin,

Place your code in its own method. In the click event of the label, call the method passing the object to the method. Here's a sample:
* Click event
= This.MyMenu(This)
* MyMenu method
PARAMETER poThis
DEFINE POPUP Shortcuts FROM MROW(), MCOL() SHORTCUT
DEFINE BAR 1 OF Shortcuts PROMPT "January"
DEFINE BAR 2 OF Shortcuts PROMPT "Februay"
* etc.
DEFINE BAR 12 OF Shortcuts PROMPT "December"
ON SELECTION POPUP ShortCuts poThis.RunCommands()
I think you'll find that it will do what you're after.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform