- Code: Select all Expand view
- function main()
#Include "FiveWin.ch"
LOCAL oDlg, oTree, oImageList
local oFont
local cDirect1:= space(40)
DEFINE FONT oFont NAME "Arial" SIZE 0, -11
DEFINE DIALOG oDlg FROM 0, 0 TO 26, 79 ;
TITLE "Test Tree" ;
GRADIENT { { 1, nRGB( 199, 216, 237 ), nRGB( 237, 242, 248 ) } }
oImageList = TImageList():New()
oImageList:Add( TBitmap():Define( , "folder.bmp", oDlg ),;
TBitmap():Define( , "folder.bmp", oDlg ) )
@ 0.25, 0.5 TREEVIEW oTree OF oDlg SIZE 306,170
oTree:bLClicked := { | nRow, nCol, nKeyFlags | MyClick1Test( nRow, nCol, oTree, cDirect1 ) }
@ 9.95, 22.5 BUTTON "&Exit" OF oDlg ACTION oDlg:End() SIZE 40, 12
ACTIVATE DIALOG oDlg CENTERED ON INIT AddItems1Test( oTree, oImageList, cDirect1 )
Return NIL
********************************************************************************
Function AddItems1Test( oTree, oImageList, cDirect1 )
local oItem1, oItem2, oItem3
local lItem1a:= .t., lItem2a:= .t., lItem3a:= .t.
oTree:SetImageList( oImageList )
oItem1 = oTree:Add( "Personnel", 1 )
oItem11 = oItem1:Add( "Add", 6) ; oItem11:Cargo:={"Personnel", 1}
oItem12 = oItem1:Add( "View", 6) ; oItem12:Cargo:={"Personnel", 2}
oItem13 = oItem1:Add( "Edit", 6) ; oItem13:Cargo:={"Personnel", 3}
oTree:Expand()
Return NIL
********************************************************************************
Function Myclick1Test( nRow, nCol, oTree, cDirect1 )
local oItem, array, Mydate, Mget, hItem, II, oItemRadio
oItem := oTree:HitTest( nRow, nCol )
IF oItem != NIL
IF oItem:Cargo != NIL
array := oItem:Cargo
DO CASE
CASE array[1] = "Personnel"
if array[2] = 1
msginfo(" Item 1")
elseif array[2] = 2
msginfo(" Item 2")
elseif array[2] = 3
msginfo(" Item 3")
endif
ENDCASE
ENDIF
ENDIF
return nil
********************************
How to make the above transparent
Thanks
Regards
ACWoo
Using FHW1201+bcc582+Harbour