PureCOLOR library : coloring gadgets (and much more)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

PureCOLOR library : coloring gadgets (and much more)

Post 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/
Last edited by gnozal on Tue Aug 18, 2009 11:49 am, edited 77 times in total.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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 !
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

bye,
Daniel
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Now works with Purebasic 3.92 final
ebs
Enthusiast
Enthusiast
Posts: 530
Joined: Fri Apr 25, 2003 11:08 pm

Post 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
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

I don't have WinXP, my old Win98SE still rocks 8)
Sorry
User avatar
Rings
Moderator
Moderator
Posts: 1427
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

gnozal wrote:I don't have WinXP, my old Win98SE still rocks 8)
Sorry
lol
SPAMINATOR NR.1
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post 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).
A+
Denis
ebs
Enthusiast
Enthusiast
Posts: 530
Joined: Fri Apr 25, 2003 11:08 pm

Post 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
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post 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
A+
Denis
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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? :(
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post 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
A+
Denis
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Library UPDATE

See first post of thread.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

PureCOLOR library update

- some fixes (colored buttons)
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post 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
Post Reply