PureCOLOR_SetGadgetColor () Replacement?

Everything else that doesn't fall into one of the other PB categories.
dige
Addict
Addict
Posts: 1429
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

PureCOLOR_SetGadgetColor () Replacement?

Post by dige »

Hi folks,

unfortunately, Gnozals PureColorLib no longer works (since PB5.40).

With the PureCOLOR_SetGadgetColor(GadgetNumber.l, TextColor.l, BackColor.l)
command, I could change the Colors of many gadgets which are not supported by
SetGadgetColor() like:

+ FrameGadget ()
+ PanelGadget ()
+ ComboBoxGadget()
+ ScrollBarGadget()

/EDIT/
+ TrackBarGadget ()

Does anybody knows, what Gnozal has used for that command? Is it
possible to decode a tailbited lib?

If anybody have used the PureLVSORT Lib, you'll find here an
replacement: http://www.purebasic.fr/english/viewtop ... 5&start=15

Ciao dige
Last edited by dige on Sat Nov 14, 2015 4:56 pm, edited 1 time in total.
"Daddy, I'll run faster, then it is not so far..."
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by IdeasVacuum »

Hi dige - some of it, such as ListIcon row/cell colour is done natively by PB now, so as you say, there is just a short list of gadgets not supported by SetGadgetColor(). No doubt Gnozal was using Windows API. It's an area of the API that requires a huge amount of code to achieve tiny changes.

Of potential interest:
Scrollbar Gadget [Shardik]
Frame Gadget [Danilo]
Frame Gadget [Fluid Byte] ;Preserves Theme
Combo Box Gadget [bbanelli]
Panel Gadget Tabs [Sparkie]
Last edited by IdeasVacuum on Sun Nov 15, 2015 1:09 am, edited 1 time in total.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by Kwai chang caine »

Justly, often i wonder why buttongadget, FrameGadget, CheckBox can't use SetGadgetColor in PB ?? :shock:
Microsoft not expected this option about it ?
ImageThe happiness is a road...
Not a destination
dige
Addict
Addict
Posts: 1429
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by dige »

@IdeasVacuum thx.

It's a pity to have to replace a single command by several codes..

Is'nt it possible to find out, what have Gnozal used for hier PureCOLOR_SetGadgetColor () command?

Btw., it also worked for the TrackBarGadget()...
"Daddy, I'll run faster, then it is not so far..."
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by IdeasVacuum »

Well, 'under the hood', most likely there are several Procedures, invoked like this:

Code: Select all

Procedure SetGadgetColor(iGadgetID.i, iTextColourRGB.i, iBackColourRGB.i)
;#-----------------------------------------------------------------------
Protected iGadgetType.i = GadgetType(iGadgetID)

Select iGadgetType

        Case #PB_GadgetType_ComboBox: SetComboBoxColours(iGadgetID, iBackColourRGB, iTextColourRGB, Transparency.i = #TRANSPARENT)
        Case    #PB_GadgetType_Frame: SetFrameColours(iGadgetID, iBackColourRGB, iTextColourRGB) ;Border Colour = Text Colour
                          ;etc etc
EndSelect
EndProcedure
[/size]
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by IdeasVacuum »

Microsoft not expected this option about it ?
It can be done with Windows API, so I imagine the issue is not Microsoft but how to do it cross-platform.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by Kwai chang caine »

Thanks IdeasVacuum for your explanation 8)
It's right, like i use always windows i never think to that :oops:
But they are several PB function, with this observation "use only with windows" :wink:
When even, have a button in color in 2015, and all this big splendid library of 3D, it's not a big request no ?? :lol:
ImageThe happiness is a road...
Not a destination
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureCOLOR_SetGadgetColor () Replacement?

Post by IdeasVacuum »

I think PB really needs a GUI designer that is more comprehensive and flexible. I dislike QT because it is way too expensive, but it does show how GUI graphics should be.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply