Page 1 of 1

PureCOLOR_SetGadgetColor () Replacement?

Posted: Fri Nov 13, 2015 10:33 am
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

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Fri Nov 13, 2015 4:30 pm
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]

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Fri Nov 13, 2015 9:02 pm
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 ?

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Sat Nov 14, 2015 4:56 pm
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()...

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Sun Nov 15, 2015 12:57 am
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]

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Sun Nov 15, 2015 1:11 am
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.

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Sun Nov 15, 2015 8:56 pm
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:

Re: PureCOLOR_SetGadgetColor () Replacement?

Posted: Mon Nov 16, 2015 5:20 am
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.