Page 1 of 35

PureCOLOR library : coloring gadgets (and much more)

Posted: Mon Oct 25, 2004 7:30 am
by gnozal
PureCOLOR library (PB5.1x : v16.11 MAR 27th 2013)

Purpose

Code: Select all

Coloring gadgets as simply as possible, and some other nice coloring functions, like ownerdrawn icon menus.

Note for the PB 4.xx versions ; some PureCOLOR features now exist as native Purebasic 4.xx functions.
I recommend using the genuine PB functions whenever it's possible.
Functions
PB4.xx : http://gnozal.ucoz.com/PureCOLOR_.htm

Download
Only available for Purebasic Windows x86
v14.0x
PB3.94 : http://gnozal.ucoz.com/PureCOLOR.zip
PB4.0x : http://gnozal.ucoz.com/PureCOLOR_.zip
PB4.1x : http://gnozal.ucoz.com/PureCOLOR__.zip
PB4.2x : http://gnozal.ucoz.com/PureCOLOR___.zip
PB4.3x : http://gnozal.ucoz.com/PureCOLOR_430.zip
v15.05
PB4.4x : http://gnozal.ucoz.com/PureCOLOR_440.zip
v16.10
PB4.5x : http://gnozal.ucoz.com/PureCOLOR_450.zip
v16.11
PB4.6x : http://gnozal.ucoz.com/PureCOLOR_460.zip
PB5.0x : http://gnozal.ucoz.com/PureCOLOR_500.zip
PB5.1x : http://gnozal.ucoz.com/PureCOLOR_510.zip

Notes :
1. Transparency : #PureCOLOR_DontSetBackColor is only supported for Text/Option/CheckBox gadgets
2. XP themes : PureCOLOR does not fully support XP themes.
  If your application is themed,
  - PanelGadget backcolor is ignored
  - Some gadgets will loose their theme in order to keep their colors
3. Class issues : for better result (less flickering), PureCOLOR uses SetClassLong() to color PanelGadgets, ContainerGadgets and PureScrollAreaGadgets.
  This means that if you colorize one gadget, all gadgets within the same class will have the same colors.
4. ListIconGadget grid lines and PureCOLOR :
  Since version 4.30, PB uses ownerdraw for the gridlines, and this may conflict with some PureCOLOR functions.
  If the grid lines disappear, use this workaround : SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)
5. ComboBoxGadgets and PureCOLOR :
  Since version 4.50, the ComboBoxGadget supports images. This ComboBoxGadget (with #PB_ComboBox_Image) is no longer using a (Windows) ComboBox class,
  it uses a ComboBoxEx class instead and this consists of a container in which is placed an ownerdrawn combobox.
  PureCOLOR only supports the ComboBox class (ComboBoxGadget without #PB_ComboBox_Image flag).

Other libs and tools at http://gnozal.ucoz.com/

Posted: Mon Oct 25, 2004 7:32 am
by gnozal
It's a beta version, it works with some gadgets like String/Text/Option... and not with others like Button. But it's a start !

Posted: Mon Oct 25, 2004 3:24 pm
by DarkDragon

Posted: Tue Oct 26, 2004 7:32 am
by gnozal
Now works with Purebasic 3.92 final

Posted: Wed Oct 27, 2004 2:13 pm
by ebs
@gnozal,

Nice!
It works well, except when Windows XP theme support is enabled. :cry:

When you type into a string gadget, the letters are "fuzzy" and get overwritten, and the backspace key doesn't work properly.

Is there anything you can do to fix this?

Regards,
Eric

Posted: Wed Oct 27, 2004 2:41 pm
by gnozal
I don't have WinXP, my old Win98SE still rocks 8)
Sorry

Posted: Wed Oct 27, 2004 2:45 pm
by Rings
gnozal wrote:I don't have WinXP, my old Win98SE still rocks 8)
Sorry
lol

Posted: Wed Oct 27, 2004 2:49 pm
by Denis
ebs wrote:It works well, except when Windows XP theme support is enabled. :cry:
Eric
Hi ebs,

i've written some month ago a lib to put color for some gadgets (not putting on english forum);

According MS doc, its not possible to put colors when XP style are on (except for Fram3DGadget and only for background color if i remeber, may be for another window ?).

To put color with the color events, you have first to remove XP style from the gadget but unfortunatly, the gadget will have the "old style" ie not XP.

Thats why it's not possible to put colors for progressbargadget with XP style.

I thing i've already put a piece of code on english forum to remove XP style (not difficult, only done according MS doc).

Posted: Wed Oct 27, 2004 3:09 pm
by ebs
Denis,
According MS doc, its not possible to put colors when XP style are on...
Yes, that's what I thought. I used your ProgressBar and Color libraries a while ago. They work great when XP themes are off.
I thing i've already put a piece of code on english forum to remove XP style...
I tried searching for this on the forum, but I couldn't find it. Would you mind re-posting it, please?

Regards,
Eric

Posted: Wed Oct 27, 2004 6:34 pm
by Denis
I use this way in my libs Morlisticongadget (for Header column button) and in Moreprogressbargadget

Try this Ebs

Code: Select all

Enumeration
  #Window
  #ProgressBar1
  #OptionGadget1
  #OptionGadget2
  #UxTheme_dll
EndEnumeration

If OpenWindow(Window, 300, 500, 360, 150, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "  XP Styles or Not")
  
  If CreateGadgetList(WindowID())
    ProgressBarGadget(#ProgressBar1, 50, 60, 99, 11, 0, 700)
    OptionGadget(#OptionGadget1, 30, 15, 200, 18, "Try with XP style")
    OptionGadget(#OptionGadget2, 30, 95, 200, 18, "Try without XP style")

     Result = OpenLibrary(#UxTheme_dll,"UxTheme.dll")
     If Result 
       ; here is the code to remove XP style
        CallFunction(#UxTheme_dll, "SetWindowTheme",GadgetID(#ProgressBar1) , "", "") 
        CallFunction(#UxTheme_dll, "SetWindowTheme",GadgetID(#OptionGadget2) , "", "") 
        CloseLibrary(#UxTheme_dll)
     EndIf
     
    UpdateWindow_(WindowID())
     For i.w = 1 To 700
       SetGadgetState(#ProgressBar1, i)
         Delay(1)
     Next i
    
    Repeat
    Until WaitWindowEvent() = #PB_EventCloseWindow
    
  EndIf
EndIf
End

Posted: Wed Oct 27, 2004 8:27 pm
by PB
> i've written some month ago a lib to put color for some gadgets (not putting on english forum)

Why didn't you announce it here on the English forums? :(

Posted: Wed Oct 27, 2004 8:29 pm
by Denis
Because i didn't done documentation, and it's not working as well as i want. And i 've not enough time to work on it much more

Posted: Sat Nov 27, 2004 10:56 am
by gnozal
Library UPDATE

See first post of thread.

Posted: Mon Dec 13, 2004 8:36 am
by gnozal
PureCOLOR library update

- some fixes (colored buttons)

Posted: Mon Dec 13, 2004 10:45 pm
by ABBKlaus
@gnozal

Hi,

i´m very interested in the source code of the colored buttons you created for your lib :D
could you pleaseeeeee post it :wink:

thx in advance and good work