PureCOLOR library : coloring gadgets (and much more)

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

Moderator: gnozal

PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> PureCOLOR doesn't check enabled/disabled status

No worries then, I'll handle it myself for now.

So, consider this a feature request then? :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Any chance that PureCOLOR could support coloring these gadgets?
I can set the color of the calender when I click the down-arrow to
expand it, but I need to set the color of them in the state they're
in at startup.

Code: Select all

If OpenWindow(0,200,200,200,100,"Calendar Colors",#PB_Window_SystemMenu)
  If CreateGadgetList(WindowID(0))
    d=Date()
    DateGadget(0,10,10,90,21,"",d)
    DateGadget(1,10,40,90,21,"",Date(Year(d),Month(d),Day(d),0,0,0),#DTS_TIMEFORMAT)
    Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
  EndIf
EndIf
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

PB wrote:Any chance that PureCOLOR could support coloring these gadgets?
I have no experience with calendar gadgets, I will have to do some research.
I'll add it to the wish list.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

You're going to hate me now that I've started using your lib, gnozal. ;)

Run this with XP skins enabled, and move the mouse over the tabs.
The text on them disappears. The Help file says SetGadgetColor can
be used with all gadgets except buttons, so... :)

Code: Select all

; Make sure XP Skins are enabled!

If OpenWindow(0, 200, 200, 200, 200, "",#PB_Window_SystemMenu)

  CreateGadgetList(WindowID(0))

  PanelGadget(0, 8, 8, 180, 180)
    AddGadgetItem (0, -1, "Panel 1")
    AddGadgetItem (0, -1, "Panel 2")
    AddGadgetItem (0, -1, "Panel 3")
  CloseGadgetList()
  
  PureCOLOR_SetGadgetColor(0, #PB_Gadget_BackColor, #Red)

  Repeat : Until WaitWindowEvent()= #PB_Event_CloseWindow

EndIf
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

PB wrote:You're going to hate me now that I've started using your lib, gnozal. ;)
Run this with XP skins enabled, and move the mouse over the tabs.
The text on them disappears. The Help file says SetGadgetColor can
be used with all gadgets except buttons, so... :)
I know, there are lots of issues with XP Skins ...
I didn't invest much time in PureCOLOR since PB4 because now there are genuine PB color functions ... Except for menus, but I didn't know it was gonna change in PB4.20 !
Concerning panelgadgets : I have some XP skin compatible code for coloring panel tabs (it is used in jaPBe) but I didn't have time implementing it in PureCOLOR.
And I could disable XP themes for some gadgets so they would work like in classic GUI.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

I love this utility!

XP Skin support not enabled.

PB4.2 though...

I do have one issue... at times when a button is colored, in a new window, it will all be BLACK.

This only happens on a button where there are different colors for UP and DOWN states.

I have about 20 buttons colored this way across 5 windows.

have moved the purecolor statements fomr the procedure to open the window (where I had them at the end of the procedure) to the place after the windows are opened before starting the main loop of the program. It seems to make no difference.

Only cure is to switch back to simple color of font and button and not have a different state for depressed... :(
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Rook Zimbabwe wrote:I love this utility!

XP Skin support not enabled.

PB4.2 though...

I do have one issue... at times when a button is colored, in a new window, it will all be BLACK.

This only happens on a button where there are different colors for UP and DOWN states.
Could you post some working code that shows the problem ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Post by GG »

Any chance to have a PureColor library for PB 4.20 ? I have some strange behaviour with PB4.20b2 and PureColor 4.10 with PureColor_Version() : When I use Purecolor_Version() with messagerequester, openwindow, or others, text which is before purecolor_version is not printed.

Example :
MessageRequester("Purecolor 4.10","PureColor : "+PureCOLOR_Version()+" - "+" Tag : "+Date$+" - "+dbpath$,#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget) : doesn't print "PureColor : "
MessageRequester("Purecolor 4.10","PureColor : "+" - "+" Tag : "+Date$+" - "+dbpath$,#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget) : It's OK.
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

GG wrote:Any chance to have a PureColor library for PB 4.20 ?
I have to wait for the next PB4.20 beta ... http://www.purebasic.fr/english/viewtopic.php?t=30803

Code: Select all

MessageRequester("Purecolor 4.10","PureColor : "+PureCOLOR_Version()+" - "+" Tag : "+Date$+" - "+dbpath$,#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget); : doesn't print "PureColor : " 
Works here with PB4.10.
And if you store PureCOLOR_Version() in a variable ?

Code: Select all

Version$ = PureCOLOR_Version()
MessageRequester("Purecolor 4.10","PureColor : "+Version$+" - "+" Tag : "+Date$+" - "+dbpath$,#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget); : doesn't print "PureColor : " 
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Post by GG »

Yes it works with pb 4.10. problem appears only with pb 4.20b2

And it works with purecolor_version() stored in a variable... But it's weird. The title in messagerequester is stored on the upper right blue banner (near the cross 'X' to close the window), instead of the upper left...
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Post by Marco2007 »

HI,

does anyone know. how to color the Menutitles? As you can see, they are white...

Code: Select all

If OpenWindow(0, 200, 200, 200, 100,"PureCOLOR Menu", #PB_Window_SystemMenu|#PB_Window_TitleBar) 
  ;  
  If CreateMenu(0, WindowID(0)) 
    MenuTitle("File") 
    PureCOLOR_MenuItem(0, 1,"New"+Chr(9)+"Ctrl+N")
    PureCOLOR_MenuItem(0, 2,"&Open"+Chr(9)+"Ctrl+O", Icon1) 
    PureCOLOR_MenuItem(0, 4,"&Save As..."+Chr(9)+"Ctrl+A")
    MenuBar()
    PureCOLOR_MenuItem(0, 5,"Exit")
    MenuTitle("Edit") 
    PureCOLOR_MenuItem(0, 6,"Copy"+Chr(9)+"Ctrl+C")
    MenuTitle("Edit") 
    PureCOLOR_MenuItem(0, 7,"Copy"+Chr(9)+"Ctrl+C")
    ;
    PureCOLOR_SetMenuOptions(0, -1, -1, RGB(0,0,255), #Black, RGB(87, 162, 96), -1, -1, -1, -1)
    ;
    PureCOLOR_ActivateColoredMenu(0)
    PureCOLOR_SetMenuOptions(0, -1, -1, #Green, -1, -1, #Red, -1, -1, -1)
  EndIf
  ;  
  Repeat
    Event = WaitWindowEvent()
    If Event = #PB_Event_CloseWindow 
      Break
    ElseIf Event = #PB_Event_Menu
      Debug EventMenu()
    EndIf
  ForEver
  ;
EndIf
This one is not working with PureColor.....
http://www.purebasic.fr/english/viewtop ... or%2A+brus


Thanx and Best regards
Marco
PureBasic for Windows
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Marco2007 wrote:HI,
does anyone know. how to color the Menutitles? As you can see, they are white...
There is currently no option to color the menu title text specifically, but using the existant options : now the menu title text is blue ...

Code: Select all

If OpenWindow(0, 200, 200, 200, 100,"PureCOLOR Menu", #PB_Window_SystemMenu|#PB_Window_TitleBar) 
  ;  
  If CreateMenu(0, WindowID(0)) 
    MenuTitle("File") 
    PureCOLOR_MenuItem(0, 1,"New"+Chr(9)+"Ctrl+N") 
    PureCOLOR_MenuItem(0, 2,"&Open"+Chr(9)+"Ctrl+O", Icon1) 
    PureCOLOR_MenuItem(0, 4,"&Save As..."+Chr(9)+"Ctrl+A") 
    MenuBar() 
    PureCOLOR_MenuItem(0, 5,"Exit") 
    MenuTitle("Edit") 
    PureCOLOR_MenuItem(0, 6,"Copy"+Chr(9)+"Ctrl+C") 
    MenuTitle("Edit") 
    PureCOLOR_MenuItem(0, 7,"Copy"+Chr(9)+"Ctrl+C") 
    ; 
    PureCOLOR_SetMenuOptions(0,#Blue, -1, #Green, #Yellow, #Blue, #Red, -1, -1, -1)
    PureCOLOR_ActivateColoredMenu(0) 
  EndIf 
  ;  
  Repeat 
    Event = WaitWindowEvent() 
    If Event = #PB_Event_CloseWindow 
      Break 
    ElseIf Event = #PB_Event_Menu 
      Debug EventMenu() 
    EndIf 
  ForEver 
  ; 
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

gnozal wrote:
Marco2007 wrote:HI,
does anyone know. how to color the Menutitles? As you can see, they are white...
There is currently no option to color the menu (title) text specifically, but using the existant options : now the menu title text is blue ...

Code: Select all

If OpenWindow(0, 200, 200, 200, 100,"PureCOLOR Menu", #PB_Window_SystemMenu|#PB_Window_TitleBar) 
  ;  
  If CreateMenu(0, WindowID(0)) 
    MenuTitle("File") 
    PureCOLOR_MenuItem(0, 1,"New"+Chr(9)+"Ctrl+N") 
    PureCOLOR_MenuItem(0, 2,"&Open"+Chr(9)+"Ctrl+O", Icon1) 
    PureCOLOR_MenuItem(0, 4,"&Save As..."+Chr(9)+"Ctrl+A") 
    MenuBar() 
    PureCOLOR_MenuItem(0, 5,"Exit") 
    MenuTitle("Edit") 
    PureCOLOR_MenuItem(0, 6,"Copy"+Chr(9)+"Ctrl+C") 
    MenuTitle("Edit") 
    PureCOLOR_MenuItem(0, 7,"Copy"+Chr(9)+"Ctrl+C") 
    ; 
    PureCOLOR_SetMenuOptions(0,#Blue, -1, #Green, #Yellow, #Blue, #Red, -1, -1, -1)
    PureCOLOR_ActivateColoredMenu(0) 
  EndIf 
  ;  
  Repeat 
    Event = WaitWindowEvent() 
    If Event = #PB_Event_CloseWindow 
      Break 
    ElseIf Event = #PB_Event_Menu 
      Debug EventMenu() 
    EndIf 
  ForEver 
  ; 
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

Using PB 4.10

When trying example PUREColor_Test_10 I get
POLINK Error, _PB_GetGadgetItemText unresolved external

I tried with threaded and non-threaded libraries...same
ay ideas?
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

kinglestat wrote:Using PB 4.10

When trying example PUREColor_Test_10 I get
POLINK Error, _PB_GetGadgetItemText unresolved external

I tried with threaded and non-threaded libraries...same
ay ideas?
No problem here with '#PureCOLOR_BackgroundImage demo' and PB4.10 ; did you use the PB4.10 PureCOLOR version http://freenet-homepage.de/gnozal/PureCOLOR__.zip ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply