Page 3 of 3

CONTEXT MENU

Posted: Sun Mar 08, 2015 11:50 am
by Pablo César
Hi Serge !

I'm glad to know you liked it. :)
It was important for me, because it was an old demand.
serge_girard wrote:how to determine which ROW is being clicked ?
If you check the code with attention, you will see this function:

Code: Select all

Function GetCellClicked(cForm,cControl)
Local aRet, nIndex:=GetControlIndex(cControl,cForm)
Local aCellData:=_GetGridCellData(nIndex)

aRet:={aCellData[1],aCellData[2]}
Return aRet
This function will returns an array, containing {nRow,nCol} of CellClicked.
From this, you do what you want with this information. So ROW have been included in this. ;)

Rgds

Re: CONTEXT MENU

Posted: Sun Mar 08, 2015 4:50 pm
by serge_girard
Thanks Pablo, I allready figured out how to get it!

I use Define_Control_Context_Menu("Form_12", "Grid_12", aCell[2], aCell[1])
and in Define_Column_ToolTip
Local nRow := GetProperty(cParentForm,cControl, "CellRowFocused")

Serge

Re: CONTEXT MENU

Posted: Tue Mar 10, 2015 6:15 pm
by srvet_claudio
serge_girard wrote:Pablo,

This works great except for one thing: how to determine which ROW is being clicked?

Serge

Code: Select all

            <ParentWindowName>.<GridControlName>.CellRowFocused   --> nCellRowIndex
            <ParentWindowName>.<GridControlName>.CellColFocused   --> nCellColIndex
            <ParentWindowName>.<GridControlName>.CellRowClicked   --> nCellRowIndex
            <ParentWindowName>.<GridControlName>.CellColClicked   --> nCellColIndex

Re: CONTEXT MENU

Posted: Wed Mar 11, 2015 8:41 am
by serge_girard
Thanks !

Serge