(Actually, I will soon be needing this myself anyhow!)
Change TreeGadget Icon
I've written some functions for Treegadget, PanelGadget and Listicongadget to put/remove images, to custom checkboxes etc
commands :
The code is a little bit long and is almost no commented (Sorry, all comments are in French and only for myself) 
The chm file is only in french, may be i will translate it if i have enough time.
The code, examples and icons are in a zip file here
You can use the code as you want, you can modify it as you want etc.
You can use images loaded with PB commands, you can set transparency for them or changes transparency. All images are converted by the code in icon format. Original ones are not modified but you do not free them. For listicon, systems arrows are supported. Image parameter is the static id, not the ImageID()!
Before using the commands, you have to put the command and when you quit 
If you free a gadget, use the command  before using Freegadget().
FreeGadgetImages(Gadget.l) doesn't Free the gadget !
Shell32.dll must be at least version 4.71 (no problem since Win98)
The code tests this dll and if the version is < 4.71, the app will close (take a closer look at the procedure ItemImage_init()
In some case, Listicongadget crash with #PB_ListIcon_SmallIcon or #PB_ListIcon_LargeIcon display modes. I've reported this bug on french forum.
if you find some bugs, report them here

			
			
													commands :
Code: Select all
 GetColumnAlignment()
 GetHeaderImage()
 GetHeaderImageAlignment()
 GetitemImage()
 GetItemIndentation()
 ListIconGadgetDisplayMode()
 FreeGadgetImages()
 RemoveHeaderImage()
 RemoveItemImage()
 SetColumnAlignment()
 SetCustomCheckBoxes()
 SetHeaderImage()
 SetHeaderImageAlignment()
 SetitemImage()
 SetItemIndentation()
 ShiftSubItem()
The chm file is only in french, may be i will translate it if i have enough time.
The code, examples and icons are in a zip file here
You can use the code as you want, you can modify it as you want etc.
You can use images loaded with PB commands, you can set transparency for them or changes transparency. All images are converted by the code in icon format. Original ones are not modified but you do not free them. For listicon, systems arrows are supported. Image parameter is the static id, not the ImageID()!
Before using the commands, you have to put the command
Code: Select all
ItemImage_init()Code: Select all
Free_ItemImage_End()Code: Select all
FreeGadgetImages(Gadget.l)FreeGadgetImages(Gadget.l) doesn't Free the gadget !
Shell32.dll must be at least version 4.71 (no problem since Win98)
The code tests this dll and if the version is < 4.71, the app will close (take a closer look at the procedure ItemImage_init()
In some case, Listicongadget crash with #PB_ListIcon_SmallIcon or #PB_ListIcon_LargeIcon display modes. I've reported this bug on french forum.
if you find some bugs, report them here

					Last edited by Denis on Mon Aug 21, 2006 10:10 pm, edited 2 times in total.
									
			
									A+
Denis
						Denis
- Psychophanta
 - Always Here

 - Posts: 5153
 - Joined: Wed Jun 11, 2003 9:33 pm
 - Location: Anare
 - Contact:
 
Hi PsychophantaPsychophanta wrote:Hi , Denis, it is very interesting.
Thanks!
What about make a help and a lib (or simple .pbi include file)?
i will translate chm help file in english
for the lib, done it if you want but i won't done a lib. The code is free, you can also modify it as you want.
I don't use pbi file format, only pb :roll: , may be for next version (i want to write another commands)
A+
Denis
						Denis
- Psychophanta
 - Always Here

 - Posts: 5153
 - Joined: Wed Jun 11, 2003 9:33 pm
 - Location: Anare
 - Contact:
 
- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
Very nice set of functions !
But some of them are XP only, I think : in the listicon functions you are using #HDF_SORTUP / #HDF_SORTDOWN. IIRC, these only work with XP and v6 manifest.
			
			
									
									But some of them are XP only, I think : in the listicon functions you are using #HDF_SORTUP / #HDF_SORTDOWN. IIRC, these only work with XP and v6 manifest.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						Thanks Gnozal,gnozal wrote:Very nice set of functions !
But some of them are XP only, I think : in the listicon functions you are using #HDF_SORTUP / #HDF_SORTDOWN. IIRC, these only work with XP and v6 manifest.
yes, system arrows are XP only (Comctl32.dll version >= 6.0) or #PB_OS_Windows_Server_2003 And Comctl32.dll version >= 5.1
The commands test if themes are supported (procedure Themes_Disponibles() ) to avoid trouble version. If themes are available, it return #true else it rteturns #false. Trying to to put arrows if you does'nt have themes wont be crash, the function return -1.
To avoid problem with your lib PureColor, i've written this set without callback. I've added a second transparency parameter to be able to draw correctly the image when background color are set in ownerdrawn style, but if the item are selected, the transparency color are still system one if i remember my tests.
Better way will be to have a callback to draw correctly all images in all styles (native commands set will be the must).
I will update chm french help file (somes small errors (copy/paste
A+
Denis
						Denis
- Psychophanta
 - Always Here

 - Posts: 5153
 - Joined: Wed Jun 11, 2003 9:33 pm
 - Location: Anare
 - Contact:
 

