FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How To Make Tree Transparent
Posts: 175
Joined: Tue Nov 10, 2009 10:56 AM
How To Make Tree Transparent
Posted: Sun May 06, 2012 04:45 AM
Hi


Code (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How To Make Tree Transparent
Posted: Sun May 06, 2012 09:02 AM

Acwoo,

You can only change its colors using:

oTree:SetColor( nClrText, nClrPane )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 175
Joined: Tue Nov 10, 2009 10:56 AM
Re: How To Make Tree Transparent
Posted: Sun May 06, 2012 12:56 PM

Thanks very much.

Regards

ACWoo

Continue the discussion