Hi,
I want to start a popup menu in ttreeview class. I have used bRClicked. It opens the popup menu at right position but i also want to select the item that is right clicked position. but i could not select it.
Is there any way to do this?
Thanks
#include "FiveWin.ch"
function Main()
local oDlg, oTree
DEFINE DIALOG oDlg
@ 0, 0 TREEVIEW oTree OF oDlg SIZE 200, 200
oTree:bRClicked := { | nRow, nCol, nKeyFlags, oSelf | ShowPopup( nRow, nCol, nKeyFlags, oSelf)}
ACTIVATE DIALOG oDlg CENTERED ON INIT DefineTree( oTree )
return nil
function DefineTree(oTree)
local oMenu := array(3), ;
oSubMenu := array(10)
oMenu[1]:= oTree:Add( "Principal" )
oSubMenu[1]:= oMenu[1]:Add( "Imprimir..." )
oMenu[2]:= oTree:Add( "Proyectos" )
oSubMenu[6]:= oMenu[2]:Add( "Definir Proyectos" )
oSubmenu[7]:= oMenu[2]:Add( "Actualización datos" )
oTree:expand()
return nil
STATIC function ShowPopup( nRow, nCol, nKeyFlags, oTree)
local oPopup
//local oItem := oTree:GetSelected()
IF oTree:ClassName="TTREEVIEW"
//oTree:Select(oItem)
MENU oPopup POPUP
MENUITEM "Print" ACTION Dummy()
SEPARATOR
MENUITEM "Change" ACTION Dummy()
MENUITEM "Send to PDF" ACTION Dummy()
SEPARATOR
MENUITEM oTree:GetSelText()+" Properties" ACTION Dummy()
ENDMENU
ACTIVATE POPUP oPopup AT nRow, nCol OF oTree
ENDIF
RETURN
FUNCTION DUMMY()
RETURN
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 93 guests