* Display a right-click menu. This.ShowMenu()In the ShowMenu method of the text box we have the following code:
* Display a shortcut menu. local loObject * Define a reference to this object in case the action for a bar is to call a * method of this object, which can't be done using "This.Method" ("This" isn't * applicable in a menu). The action can be specified as "loObject.Method". loObject = This * Define the menu. release popup SHORTCUT define popup SHORTCUT shortcut from mrow(), mcol() with This * Populate it using a custom method. .ShortcutMenu() * Use the hook object (if there is one) to do any further population of the * menu. if type('.oHook') = 'O' and not isnull(.oHook) and ; pemstatus(.oHook, 'ShortcutMenu', 5) .oHook.ShortcutMenu() endif type('.oHook') = 'O' ... endwith * Activate the menu if necessary. if cntbar('SHORTCUT') > 0 activate popup SHORTCUT endif cntbar('SHORTCUT') > 0 release popup SHORTCUTSo then all a programmer has to do is put code in the ShortCutMenu method to create any rightmouse click menu they wish. Example:
* Populate the shortcut menu. define bar 1 of SHORTCUT prompt 'View Lot Datacard: '+lotdata.lotnumber define bar 2 of SHORTCUT prompt 'Replace Master Manufacture Date With Lot Date Completed: '+DTOC(lotdata.lotdatecmp) IF 'LOTDATECMP' $ UPPER(SET('ORDER')) define bar 3 of SHORTCUT prompt 'Set Order To Lot Number ' define bar 4 of SHORTCUT prompt 'Set Order To FRN ' ELSE IF 'FRNFRN' $ UPPER(SET('ORDER')) define bar 3 of SHORTCUT prompt 'Set Order To Lot Number ' define bar 4 of SHORTCUT prompt 'Set Order To Date Completed ' ELSE define bar 3 of SHORTCUT prompt 'Set Order To Date Completed ' define bar 4 of SHORTCUT prompt 'Set Order To FRN ' ENDIF ENDIF on selection bar 1 of SHORTCUT _screen.ActiveForm.LotCardUtilities.ViewLotData(ALLTRIM(lotdata.lotnumber)) on selection bar 2 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdMoveLotDateCompleteToMfrDate.Click() IF 'LOTDATECMP' $ UPPER(SET('ORDER')) on selection bar 3 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdToggleLotDataOrder.Click('LOTNUMBER') on selection bar 4 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdToggleLotDataOrder.Click('FRNFRN') ELSE IF 'FRNFRN' $ UPPER(SET('ORDER')) on selection bar 3 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdToggleLotDataOrder.Click('LOTNUMBER') on selection bar 4 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdToggleLotDataOrder.Click('LOTDATECMP') ELSE on selection bar 3 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdToggleLotDataOrder.Click('LOTDATECMP') on selection bar 4 of SHORTCUT _screen.ActiveForm.C40pgAnalysis.Page2.C40cmdToggleLotDataOrder.Click('FRNFRN') ENDIF ENDIFI hope this help to get you started. Mostly all of our controls have this built into the application objects. So a text box or grid or list would have the same functionality.