TreeGadget + ListIconGadget COLORS

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pantcho!.

Hello People.
i saw Danilo Example for Listbox Colors
and i tried to use it with Tree and Listicon gadgets
and all my tries went....

if anyone can help...

thank you.

Pantcho.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Does this help?? ...

Code: Select all

hWnd=OpenWindow(0,10,10,300,200,#PB_Window_SystemMenu,"Color List View")
If hWnd=0 Or CreateGadgetList(hWnd)=0:End:EndIf
 
LI=ListIconGadget(1,10,10,280,180,"Name",100,#PB_ListIcon_GridLines)
AddGadgetColumn(1,1,"Address",120)
AddGadgetColumn(1,2,"Phone",50)

SendMessage_(LI, #LVM_SETBKCOLOR,0,$ffffaa)
SendMessage_(LI, #LVM_SETTEXTBKCOLOR,0,$ffffaa)
 
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
:)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Another example using TreeGadget this time...

Code: Select all

#TVM_SETBKCOLOR=$1100+29
#TVM_SETTEXTCOLOR=$1100+30
 
hWnd=OpenWindow(0,10,10,300,200,#PB_Window_SystemMenu,"Color List View")
If hWnd=0 Or CreateGadgetList(hWnd)=0:End:EndIf
 
LI=TreeGadget(1,10,10,200,180)
SendMessage_(LI, #TVM_SETBKCOLOR,0,$ffffaa)
SendMessage_(LI, #TVM_SETTEXTCOLOR,0,$0000ff)
AddGadgetItem(1,-1,"Test 1")
AddGadgetItem(1,-1,"Test 2")
 
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pantcho!.

Fanks!
that is a great example paul , Thank u!

any chance of changing the Selected text color?
the Blue Background to Black and the text to green? :P
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

Pantcho, i hacent send you the codes but im not finished yet, im still on experimental stage, and i lose your email... sorry : (
I will send it when i have some decent code.

Thanks
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pantcho!.

Hey ricardo :P
i am now going to army and i will be back on friday.
so if u want u can email me until then in - [url]mailto:noamidc@012.net.il[/url]
and u can send me everything u want even if its some cool snippets!
:P

cya
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

That works fine, but does anybody know if it is possible to have items with different text colors in the same listicon?, and be able to change the text colors dinamically?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pantcho!.

i would like to know that also!!

and even the highliter color of the tree or the gdaget iteself
like if i pick an item on a listbox or tree i want that the highlight will be on black background and green forground...
how can i do that?
Post Reply