PureCOLOR library : coloring gadgets (and much more)

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

Moderator: gnozal

User avatar
GeBonet
Enthusiast
Enthusiast
Posts: 135
Joined: Fri Apr 04, 2008 6:20 pm
Location: Belgium

Re: PureCOLOR library : coloring gadgets (and much more)

Post by GeBonet »

You are right when you say :
I am not recommending not to use PureCOLOR (I use it myself), but to use PB genuine functions whenever it's possible. Etc...
And I think it's also true with all genuine functions... wherever possible and it exists ! :lol:
Sorry for my english :wink: ! (Windows Xp, Vista and Windows 7, Windows 10)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by gnozal »

SoS wrote:Hi gnozal
PureColor is not working in threadsafe mode.(winxp 32)
I get "unresolved external.... _PB_Stringbase".
Did you enable the 'UserLibThreadSafe' subsystem (see PureCOLOR.chm) ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nigel
User
User
Posts: 62
Joined: Tue Feb 23, 2010 8:39 pm
Location: Canada

Re: PureCOLOR library : coloring gadgets (and much more)

Post by nigel »

gnozal wrote:
nigel wrote:I am still interested in understanding your reasons for recommending against the use of Purecolor. Is it just because it involves an external library and because you think the Purebasic author may eventually improve colour support natively within the language itself ?
I am not recommending not to use PureCOLOR (I use it myself), but to use PB genuine functions whenever it's possible.
Several reasons :
- PureCOLOR does not support themes (it could have better support for themes, but it would be a lot of work and I am not using themes anyway, so...)
- some PB gadgets are not 100% Windows API compatible, so using an external library for coloring may have some unexpected results : the listicon grid lines issue, the combobox coloring not working when #PB_ComboBox_Image is used, ....
I don't think the PB authors will improve color support a lot because most users use themes, and they have 3 OS to support. But I may be wrong.

PureFORM uses PureCOLOR internally because it's an old app written with PB3.9x which had absolutely no color support at the time, nor icon menus.
However, in the generated code, you can choose between PureCOLOR and the genuine SetGadgetColor() function, and this for every class. It may not be supported by PB though.
gnozal

Inadvertantly, your answer has pointed me in the direction of resolving my problems.

This might sound rather astonishing, but as I am new to Purebasic and also to Windows GUI programming, I was not aware that theme choices determine the colour scheme used by a developed application. Like you, I do not use themes because I have no desire to use a background desktop wallpaper and prefer a plain unadorned working environment. I suppose you might say that I do use a theme in the sense that I choose "Classic" which includes a plain blue desktop background. My choice of "classic" results in a very unappealing grey coloured background to any developed application, whereas using the Windows XP theme generates a pleasant sandy beige application backdrop.

I had certainly assumed that every author of an application needed to program the colours for each interface element. This is a basic misunderstanding on my part and I am now happy to generally avoid specifying colour in Purebasic altogether.

Thanks again gnozal, I also appreciate the additional insights your answer has provided.
rnospam
New User
New User
Posts: 7
Joined: Fri Nov 13, 2009 10:33 pm

Re: PureCOLOR library : Frame3DGadget Text

Post by rnospam »

Goznal,

Would it be possible to add custom coloring to the Frame3DGadgets into the PureColor Library?

See this thread for details:
viewtopic.php?f=12&t=42743

Thanks for the excellent work, as coloring check box's and option boxes without your efforts would be a Hugh Pain.

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

Re: PureCOLOR library : coloring gadgets (and much more)

Post by gnozal »

Update (V16.0 for PB4.5x)

Changes :
- new function : PureCOLOR_DisableButton(GadgetNumber.l, Disabled.l)
  To be used instead of the PB genuine function DisableGadget() for colored and/or icon buttons.
  Should provide a better cosmetic result for disabled buttons.

Example : enabled buttons
               disabled buttons
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by IdeasVacuum »

Hello gnozal

This is the first time I have really needed to colour gadgets. Really impressed with PureCOLOR, it's very easy to use and fast! 8)

Did you notice that applying colour to individual ListIcon cells results in the grid lines disappearing? Is there a way to get them to stay?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by gnozal »

IdeasVacuum wrote:This is the first time I have really needed to colour gadgets. Really impressed with PureCOLOR, it's very easy to use and fast! 8)
Did you notice that applying colour to individual ListIcon cells results in the grid lines disappearing? Is there a way to get them to stay?
Yes.
PureCOLOR.chm wrote:If the grid lines disappear, use this workaround : SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by IdeasVacuum »

Thanks for your reply gnozal. Somehow did not see the work-around in the help, sorry to trouble you. :oops:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by gnozal »

IdeasVacuum wrote:Thanks for your reply gnozal. Somehow did not see the work-around in the help, sorry to trouble you. :oops:
No problem, you're welcome.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
[blendman]
Enthusiast
Enthusiast
Posts: 297
Joined: Thu Apr 07, 2011 1:14 pm
Location: 3 arks
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by [blendman] »

Hi

Is there a new version of the purecolor lib ?
For pb4.60 ? :)

Thank you very much.
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: PureCOLOR library : coloring gadgets (and much more)

Post by chi »

Yup, PureCOLOR for pb4.6 is online... Just download the 'Tools Updater' from gnozal´s hp ( http://gnozal.ucoz.com/#Tools ) and check for news from time to time.
Et cetera is my worst enemy
dige
Addict
Addict
Posts: 1247
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by dige »

PureCOLOR_SetButtonColor(0, #White, #Black) PB4.6B3 crashes, if the ButtonImageGadget ()
is disabled.

Code: Select all

  If OpenWindow(0, 0, 0, 120, 100, "ButtonImage", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    If LoadImage(0, #PB_Compiler_Home +  "Examples\Sources\Data\PureBasic.bmp")    ; change 2nd parameter to the path/filename of your image
      ButtonImageGadget(0, 10, 10, 100, 83, ImageID(0))
			
		EndIf
    
		DisableGadget(0, #TRUE)
		
		PureCOLOR_SetButtonColor(0, #White, #Black) 
		
		Repeat
		Until WaitWindowEvent() = #PB_Event_CloseWindow
	EndIf
"Daddy, I'll run faster, then it is not so far..."
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by gnozal »

dige wrote:PureCOLOR_SetButtonColor(0, #White, #Black) PB4.6B3 crashes, if the ButtonImageGadget ()
is disabled.
New build uploaded (should not crash anymore).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
dige
Addict
Addict
Posts: 1247
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: PureCOLOR library : coloring gadgets (and much more)

Post by dige »

Thank you! It works... :D
"Daddy, I'll run faster, then it is not so far..."
jassing
Addict
Addict
Posts: 1745
Joined: Wed Feb 17, 2010 12:00 am

PureForm,PureColor = goofy text?

Post by jassing »

Image
Notice the "blurry" text? It gets blurry as soon as the colour of the object beneath changes.
How can I avoid it?
Thanks.
Here's the code:

Code: Select all

 	
pWindow = OpenWindow(#PB_Any,0,0,10,10,"",#PB_Window_Invisible)
hWindow = OpenWindow(#PB_Any, 450, 200, 352, 62, "Having Fun", #PB_Window_Invisible|#PB_Window_SystemMenu,WindowID(pWindow))

hprog1 = ProgressBarGadget(#PB_Any, 6, 1, 340, 25, 0, 100, #PB_ProgressBar_Smooth)
hText1 = TextGadget(#PB_Any, 7, 3, 340, 20, "0%", #PB_Text_Center|#SS_CENTERIMAGE)

hProg2 = ProgressBarGadget(#PB_Any, 6, 31, 340, 25, 0, 100, #PB_ProgressBar_Smooth)
hText2 = TextGadget(#PB_Any, 5, 34, 340, 20, "0%", #PB_Text_Center|#SS_CENTERIMAGE)


SetGadgetFont(hText1, LoadFont(#Font_txt2, "Microsoft Sans Serif", 8, #PB_Font_Bold|#PB_Font_HighQuality))
SetGadgetFont(hText2, LoadFont(#Font_txt3, "Microsoft Sans Serif", 8, #PB_Font_Bold|#PB_Font_HighQuality))

PureCOLOR_SetGadgetColor(hText1, $FFFFFF, #PureCOLOR_DontSetBackColor)
PureCOLOR_SetGadgetColor(hText2, $FFFFFF, #PureCOLOR_DontSetBackColor)
Post Reply