Page 2 of 2

Posted: Mon Aug 21, 2006 12:14 pm
by srod
You're welcome. :)

(Actually, I will soon be needing this myself anyhow!)

Posted: Mon Aug 21, 2006 7:49 pm
by Denis
I've written some functions for Treegadget, PanelGadget and Listicongadget to put/remove images, to custom checkboxes etc

commands :

Code: Select all

 GetColumnAlignment()
 GetHeaderImage()
 GetHeaderImageAlignment()
 GetitemImage()
 GetItemIndentation()
 ListIconGadgetDisplayMode()
 FreeGadgetImages()
 RemoveHeaderImage()
 RemoveItemImage()
 SetColumnAlignment()
 SetCustomCheckBoxes()
 SetHeaderImage()
 SetHeaderImageAlignment()
 SetitemImage()
 SetItemIndentation()
 ShiftSubItem()
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

Code: Select all

ItemImage_init()
and when you quit

Code: Select all

Free_ItemImage_End()
If you free a gadget, use the command

Code: Select all

FreeGadgetImages(Gadget.l)
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

Image

Posted: Mon Aug 21, 2006 8:24 pm
by Psychophanta
Hi , Denis, it is very interesting.
Thanks!

Posted: Mon Aug 21, 2006 8:33 pm
by Denis
Psychophanta wrote:Hi , Denis, it is very interesting.
Thanks!
What about make a help and a lib (or simple .pbi include file)?
Hi Psychophanta

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)

Posted: Mon Aug 21, 2006 8:38 pm
by Psychophanta
Yes, should be good to see the help in english.
About the lib, i think it is good as normal source.

By the way, but sorry i deleted part of my above post because i just saw that you really included the help file :wink:

Posted: Tue Aug 22, 2006 7:43 am
by gnozal
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.

Posted: Tue Aug 22, 2006 9:17 am
by Denis
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.
Thanks Gnozal,

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 :mrgreen: ) and english one is almost done.

Posted: Tue Aug 22, 2006 4:30 pm
by Denis
Zip file updated here

- Added english chm help file
- Corrected french chm help file
- Corrected 3 procedure (added a test for XP themes) in commands set

Posted: Tue Aug 22, 2006 11:41 pm
by Psychophanta
Thanks a lot! :D

Posted: Tue Oct 17, 2006 9:41 am
by dige
@srod: that SetTreeIcon Proc helps me a lot ... thank you very much!

@Denis: thx for sharing, it's very usefull