Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #7215
| From | "Marc Verkade [MITCon]" <marc@mitNOSPAMconDELETE.nl> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| References | <87wSv.227314$GP4.110537@fx15.fr7> <ha9l1at9oke1isn8lkfgjmjm64sa970d1f@4ax.com> |
| Subject | Re: Data driver context menu |
| Message-ID | <lfISv.121786$Dv.20461@fe62.am1> (permalink) |
| Organization | Sunny Usenet - Affordable Usenet |
| Date | 2014-09-18 23:36 +0200 |
You could checkout my MC_Menu classes at http://www.mitcon.nl/cavo/
These are dynamic menuclasses, accelerators etc.
Regards, Marc
"D.J.W. van Kooten" schreef in bericht
news:ha9l1at9oke1isn8lkfgjmjm64sa970d1f@4ax.com...
On Thu, 18 Sep 2014 08:48:50 +0100, Martin <spam@spam.spam> wrote:
>I need to make a context menu data driven.
>
>Any advice please?
>
Hello Martin,
You can just use code like this below in the Postinit of the menu:
SELF:InsertItem
(dwID,cText,IDM_RELATIEMENU_MN_SELECTIES_MN_QUICKSELECT_MSG_SELECTIONPROFILE___ID)
// Add to menu
SELF:RegisterItem (dwID, HyperLabel {String2Symbol ("MChoice" + NTrim
(dwCount)), cText, , ,}) // Add
call to mChoice
Then we have the following method:
METHOD PreMenuCommand(oEvt) CLASS SomeDataWindow
//#s Calls methods based on menus
LOCAL nItem AS WORD
LOCAL cName AS STRING
SUPER:PreMenuCommand(oEvt) // Otherwise toolbar menu does not
work 30-7-2011
cName:=AllTrim(Upper(oEvt:Name)) // E.G.MCHOICE1
IF Left(cName,7)="MCHOICE" // Menu was PlanningTrayIconMenu
nItem:=Val(SubStr2(cName,8)) // This is the number,
e.g. MCHOICE12->12
SELF:MChoiceCommon(nItem)
RETURN TRUE // TRUE – If you have processed the
MenuCommand. ELSE
RETURN FALSE // FALSE – If you want the normal
MenuCommand to run as well
ENDIF
In the method mChoiceCommon we get a paramater passed from
PreMenuCommand so we can act upon the actual choice made.
I trust this helps you.
Dick
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
Data driver context menu Martin <spam@spam.spam> - 2014-09-18 08:48 +0100
Re: Data driver context menu D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2014-09-18 11:34 +0200
Re: Data driver context menu "Marc Verkade [MITCon]" <marc@mitNOSPAMconDELETE.nl> - 2014-09-18 23:36 +0200
csiph-web