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!
To change color of a tree object
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Enrico,
These new methods in Class TTreeView makes it automatic and FiveWin compatible:
This code in method New():
and finally just one C function call:
Now the sample code is just as:
No extra calls required
These new methods in Class TTreeView makes it automatic and FiveWin compatible:
Code: Select all
METHOD Initiate( hDlg ) INLINE Super:Initiate( hDlg ), ::SetColor( ::nClrText, ::nClrPane )
METHOD SetColor( nClrText, nClrPane ) INLINE ;
Super:SetColor( nClrText, nClrPane ), TVSetColor( ::hWnd, nClrText, nClrPane )
Code: Select all
if ! Empty( oWnd:hWnd )
::Create( CTRL_NAME )
oWnd:AddControl( Self )
::SetColor( nClrFore, nClrBack ) // New !
Code: Select all
CLIPPER TVSETCOLOR( PARAMS ) // hWnd, nClrFore, nClrBack
{
TreeView_SetBkColor( ( HWND ) _parnl( 1 ), _parnl( 3 ) );
TreeView_SetTextColor( ( HWND ) _parnl( 1 ), _parnl( 2 ) );
}
Code: Select all
@ 0, 0 TREEVIEW oTree COLOR CLR_WHITE, CLR_GREEN
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
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:
Please advise me what to do. Or else please provide me the correct
treeview.c link to compile without any warnings.
- Ramesh Babu P
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:
I don't have knowledge in C.Warning W8019 treeview.c 234: Code has no effect in function TVSETCOLOR
Warning W8019 treeview.c 235: Code has no effect in function TVSETCOLOR
Please advise me what to do. Or else please provide me the correct
treeview.c link to compile without any warnings.
- Ramesh Babu P
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: