Page 33 of 35

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

Posted: Wed Jun 23, 2010 10:38 pm
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:

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

Posted: Thu Jun 24, 2010 7:36 am
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) ?

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

Posted: Fri Jun 25, 2010 6:50 pm
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.

Re: PureCOLOR library : Frame3DGadget Text

Posted: Thu Jul 01, 2010 7:50 pm
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

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

Posted: Thu Jan 20, 2011 11:38 am
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

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

Posted: Sun May 08, 2011 5:16 am
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?

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

Posted: Tue May 17, 2011 8:21 am
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)

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

Posted: Tue May 24, 2011 4:22 am
by IdeasVacuum
Thanks for your reply gnozal. Somehow did not see the work-around in the help, sorry to trouble you. :oops:

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

Posted: Tue May 24, 2011 7:49 am
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.

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

Posted: Sun Jul 10, 2011 5:57 pm
by [blendman]
Hi

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

Thank you very much.

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

Posted: Sun Jul 10, 2011 6:59 pm
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.

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

Posted: Tue Jul 19, 2011 9:49 am
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

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

Posted: Tue Jul 19, 2011 10:56 am
by gnozal
dige wrote:PureCOLOR_SetButtonColor(0, #White, #Black) PB4.6B3 crashes, if the ButtonImageGadget ()
is disabled.
New build uploaded (should not crash anymore).

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

Posted: Tue Jul 19, 2011 11:11 am
by dige
Thank you! It works... :D

PureForm,PureColor = goofy text?

Posted: Sat Oct 15, 2011 7:13 pm
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)