Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shortcut menu with a grid on form 2

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
US
I have a grid, and in the right click method:

Code:
DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF shortcut PROMPT "Invoice Details" 
DEFINE BAR 2 OF shortcut PROMPT "Payment Details"
DEFINE BAR 3 OF shortcut PROMPT "Print Invoice"
ON SELECTION BAR 1 OF shortcut Thisform.ViewInvoice()
ON SELECTION BAR 2 OF shortcut Thisform.ViewPayment()
ON SELECTION BAR 3 OF shortcut Thisform.PrintInvoice()
ACTIVATE POPUP shortcut

I can't use Thisform.ViewInvoice() etc..

how to go arround that, i want to keep the method contained in the form and not create a function in my main.prg etc..

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Nevermind, i ended up doing this..

Code:
LOCAL lcCursor 
lcCursor = thisform.CurARMast 
IF EMPTY(lcCursor)
	RETURN
ENDIF 
SELECT (lcCursor)
IF EOF()
	RETURN
ENDIF 

DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF shortcut PROMPT "Invoice Details" 
DEFINE BAR 2 OF shortcut PROMPT "Payment Details"
DEFINE BAR 3 OF shortcut PROMPT "Print Invoice"
ON SELECTION BAR 1 OF shortcut do InvoiceMenu with 1,lcCursor 
ON SELECTION BAR 2 OF shortcut do InvoiceMenu with 2,lcCursor
ON SELECTION BAR 3 OF shortcut do InvoiceMenu with 3,lcCursor
ACTIVATE POPUP shortcut


Ali Koumaiha
TeknoSoft Inc.
Michigan
 
To answer your original question, though, replace Thisform with _Screen.Activeform in code that's not inside an object on the form.
 
thanks guys.

worked like a charm.. the other method you guys suggested.

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top