CONTEXT MENU

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post 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
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CONTEXT MENU

Post 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
There's nothing you can do that can't be done...
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CONTEXT MENU

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CONTEXT MENU

Post by serge_girard »

Thanks !

Serge
There's nothing you can do that can't be done...
Post Reply