as subject.
Thanks,
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
local oDlg, oTree
DEFINE DIALOG oDlg
@ 0, 0 TREEVIEW oTree OF oDlg SIZE 200, 200
oTree:bLDblClick := { |nRow, nCol, nKeyFlags, oItem| MsgInfo(oItem:GetSelText())}
oTree:bKeyDown = { | nKey, nFlags | KeyDown(nKey, nFlags, oTree)}
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
function KeyDown(nKey, nFlags, oItem)
? nKey, "I am here"
IF nKey=VK_RETURN
MsgInfo(oItem:GetSelText())
ENDIF
RETURN