Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Right-mouse click menu?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01074766
Message ID:
01074904
Views:
12
Terry,

Thank you very much for the code. I will try it.

>Yes you can define it at top of application. Any dynamic BAR prompts could be reassigned when it is activated
* RCM.PRG Right ClickMenu
>PUBLIC oform
>oform=CREATEOBJECT('form')
>oform.name="myform"
>oform.autocenter=.t.
>DefinePopUpMenu(oform)
>WITH oform
>.ADDOBJECT('myLabel1','lblClass')
>.myLabel1.CAPTION=[Top Right Click]
>.MyLabel1.TOP=30
>.ADDOBJECT('myLabel2','lblClass')
>.myLabel2.CAPTION=[Bottom Right Click]
>.MyLabel2.TOP=55
>ENDWITH
>oform.show
>* Running at here
>
>PROCEDURE DefinePopUpMenu(oform)
>DEFINE POPUP popMe in Window myform MARGIN RELATIVE shortcut;
>       TITLE "Pop Demo" COLOR SCHEME 4
>DEFINE BAR 1 OF popMe PROMPT '\<New' KEY ALT+N, "" SKIP FOR .F.
>DEFINE BAR 4 OF popME PROMPT '\<Edit' KEY ALT+E, "" SKIP FOR .F.
>DEFINE BAR 2 OF popME PROMPT '\<Delete' KEY ALT+D, "" SKIP FOR .F.
>DEFINE BAR 3 OF popMe PROMPT "\-"
>DEFINE BAR 5 OF popME PROMPT 'Time'
>ON SELECTION BAR 1 of popMe DO popMessage with 'New'
>ON SELECTION BAR 4 of popMe DO popMessage with 'Edit'
>ON SELECTION BAR 2 of popMe DO popMessage with 'Delete'
>ENDPROC
>
>PROCEDURE OpenPopMenu(nRow,nCol)
>lcPrompt=[Time: ]+TIME()
>DEFINE BAR 5 OF popMe PROMPT lcPrompt
>ACTIVATE popup popMe at nRow,nCol
>DEACTIVATE POPUP popMe
>ENDPROC &&OpenPopMenu
>
>PROCEDURE popMessage(lcMessage)
>MESSAGEBOX(lcMessage+[ from popMe!],0,[popMe Calling!])
>ENDPROC &&popMessage
>
>DEFINE CLASS lblClass as Label
>left =30
>width=200
>height=20
>visible=.t.
>PROCEDURE MouseUp (nButton, nShift, nXCoord, nYCoord)
>IF nButton=2
>   OpenPopMenu(2,30)
>ENDIF
>ENDPROC
>ENDDEFINE &&lblClass
>*END PRG
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform