To change color of a tree object

Postby Antonio Linares » Sun Sep 24, 2006 8:46 pm

Enrico,

Excellent :-) I also tried it but my code had a mistake so I thought that the implementation was going to be more complex.

Very good!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun Sep 24, 2006 9:01 pm

Enrico,

These new methods in Class TTreeView makes it automatic and FiveWin compatible:
Code: Select all  Expand view
   METHOD Initiate( hDlg ) INLINE Super:Initiate( hDlg ), ::SetColor( ::nClrText, ::nClrPane )

   METHOD SetColor( nClrText, nClrPane ) INLINE ;
      Super:SetColor( nClrText, nClrPane ), TVSetColor( ::hWnd, nClrText, nClrPane )

This code in method New():
Code: Select all  Expand view
   if ! Empty( oWnd:hWnd )
      ::Create( CTRL_NAME )
      oWnd:AddControl( Self )
      ::SetColor( nClrFore, nClrBack ) // New !

and finally just one C function call:
Code: Select all  Expand view
CLIPPER TVSETCOLOR( PARAMS ) // hWnd, nClrFore, nClrBack
{
   TreeView_SetBkColor( ( HWND ) _parnl( 1 ), _parnl( 3 ) );
   TreeView_SetTextColor( ( HWND ) _parnl( 1 ), _parnl( 2 ) );      
}

Now the sample code is just as:
Code: Select all  Expand view
    @ 0, 0 TREEVIEW oTree COLOR CLR_WHITE, CLR_GREEN

No extra calls required :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Postby RAMESHBABU » Sun Oct 01, 2006 9:38 am

Hello Mr.Antonio


CLIPPER TVSETCOLOR( PARAMS ) // hWnd, nClrFore, nClrBack
{
TreeView_SetBkColor( ( HWND ) _parnl( 1 ), _parnl( 3 ) );
TreeView_SetTextColor( ( HWND ) _parnl( 1 ), _parnl( 2 ) );
}


should be included where?

Regards

-Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby Antonio Linares » Sun Oct 01, 2006 11:09 am

Ramesh,

Into source\winapi\treeview.c
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby RAMESHBABU » Sun Oct 01, 2006 2:20 pm

Hello Mr. Antonio

Thank you for your suggestion.

I have inserted the following code at the bottom of treeview.c in
winapi directory and tried to compile it. It is giving the following
errors:

Warning W8019 treeview.c 234: Code has no effect in function TVSETCOLOR

Warning W8019 treeview.c 235: Code has no effect in function TVSETCOLOR


I don't have knowledge in C.

Please advise me what to do. Or else please provide me the correct
treeview.c link to compile without any warnings.

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby Antonio Linares » Sun Oct 01, 2006 6:20 pm

Ramesh,

You can ignore those warnings.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests