SetGadgetColor()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

SetGadgetColor()

Post by dobro »

currently the syntax is:

Code: Select all

SetGadgetColor(#listview_signet, #PB_Gadget_BackColor, coul_fond)
SetGadgetColor(#listview_signet, #PB_Gadget_FrontColor, coul_commentaire)
in the future a syntax like this, will be a good thing

Code: Select all

SetGadgetColor(#gadget, $BackColor, $FrontColor)
one instruction :)

Using #pb_ignore

Code: Select all

SetGadgetColor(#gadget,#pb_ignore, $FrontColor)
and of course ... support more gadget :)
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: SetGadgetColor()

Post by Bisonte »

You missed something....

Code: Select all

SetGadgetColor(Gadget, BackColor, FrontColor, LineColor, TitleFrontColor, TitleBackColor, GrayTextColor)
Are you sure that you want this ?
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: SetGadgetColor()

Post by ozzie »

We're all entitled to do things our favorite way, but here's my 2 cents worth:

When I first came to PB from VB6, I was concerned about this as well and so wrote this simple macro:

Code: Select all

Macro SetGadgetColors(GadgetNo, pFrontColor, pBackColor)
  SetGadgetColor(GadgetNo, #PB_Gadget_FrontColor, pFrontColor)
  SetGadgetColor(GadgetNo, #PB_Gadget_BackColor, pBackColor)
EndMacro
However, I subsequently found this was actually a bit of a pain as I didn't always want to set both colors, so I don't use the macro anymore. It's just remaining in my program to satisfy my early use of it. I now always use SetGadgetColor().
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: SetGadgetColor()

Post by dobro »

Bisonte wrote:You missed something....

Code: Select all

SetGadgetColor(Gadget, BackColor, FrontColor, LineColor, TitleFrontColor, TitleBackColor, GrayTextColor)
Are you sure that you want this ?

I asked this? :?

ozzie wrote: However, I subsequently found this was actually a bit of a pain as I didn't always want to set both colors, so I don't use the macro anymore. It's just remaining in my program to satisfy my early use of it. I now always use SetGadgetColor().
This is why I advocate the use of #pb_ignore
Last edited by dobro on Thu Sep 19, 2013 11:17 am, edited 1 time in total.
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: SetGadgetColor()

Post by Bisonte »

dobro wrote:
Bisonte wrote:You missed something....

Code: Select all

SetGadgetColor(Gadget, BackColor, FrontColor, LineColor, TitleFrontColor, TitleBackColor, GrayTextColor)
Are you sure that you want this ?
I asked this? :?
Yes...
If you have SetGadgetColor(Gadget, BackColor, FrontColor) ... how I set the other colortypes ?
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: SetGadgetColor()

Post by dobro »

Bisonte wrote: Yes...
If you have SetGadgetColor(Gadget, BackColor, FrontColor) ... how I set the other colortypes ?
how are you doing now?
I talk about SetGadgetColor () function
now, do not use this feature for you to color the lines that I know!

in french :

actuellement tu fais comment ?
je parle de la fonction SetGadgetColor()
actuellement, tu ne te sert pas de cette fonction pour colorer les lignes, que je sache !
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: SetGadgetColor()

Post by Bisonte »

I also talk about it...

for example : SetGadgetColor(MyListIconGadget, #PB_Gadget_LineColor, Color)

Look here : http://www.purebasic.com/documentation/ ... color.html
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: SetGadgetColor()

Post by dobro »

oh yes, I had not seen the new arguments :oops:
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
Post Reply