Page 1 of 1

BackColor

Posted: Wed Sep 28, 2016 6:05 pm
by k3pto
A couple questions about the forms editor:

Is there any way to change the BackColor of Buttons and CheckBoxes?

Is there a way to set the default font used by the gadgets rather than manually changing each one?

Re: BackColor

Posted: Thu Sep 29, 2016 9:03 am
by Marc56us
k3pto wrote:A couple questions about the forms editor:

Is there any way to change the BackColor of Buttons and CheckBoxes?
No
(in pure pb)
k3pto wrote:Is there a way to set the default font used by the gadgets rather than manually changing each one?
Yes

In your main code, before call OpenWindow, use: SetGadgetFont(#PB_Default, ...

Something like that:

Code: Select all

Enumeration 
    #Font_Verdana_10
EndEnumeration

LoadFont(#Font_Verdana_10, "Verdana", 10)
SetGadgetFont(#PB_Default, FontID(#Font_Verdana_10))

XIncludeFile "<...>.pbf"

OpenWindow_0()
(and you can still change the font of some gadget individually if you want)

8)

Re: BackColor

Posted: Thu Sep 29, 2016 1:33 pm
by IdeasVacuum
Is there any way to change the BackColor of Buttons and CheckBoxes?
Windows Themes can get in the way, but there is a callback method to change the backcolour of CheckBox and Option gadgets (on Windows OS).
Changing the backcolour of buttons is possible but the result not very satisfactory - better instead to use an ImageButton or diy your own buttons using canvas gadgets.

netmaestro's code (brilliant by default)
http://www.purebasic.fr/english/viewtopic.php?t=24808

Re: BackColor

Posted: Thu Sep 29, 2016 4:05 pm
by k3pto
Hi Marc56us and IdeasVacuum,

Thank you Marc56us for the font solution. It does exactly what I had hoped. Now, if there was a way to change the default font used by the editor... :wink:

IdeasVacuum: the solution by netmaestro is OK for someone who REALLY needs to change the color. My need is more of a curiosity to determine the features of PB.

Thank you both for the responses.

Re: BackColor

Posted: Thu Sep 29, 2016 4:39 pm
by IdeasVacuum
Default font used by the IDE:
File/Preferences/Editor/Editing/Select Font (My favourite is DejaVu Sans Mono)

RSBasic has written a library of 'how to' tips and tricks:
http://www.purebasic.fr/english/viewtop ... 27&t=62741

Re: BackColor

Posted: Fri Sep 30, 2016 3:49 pm
by blueb
IdeasVacuum wrote:...My favourite is DejaVu Sans Mono)
Thanks IdeasVacuum.. Nice font. :)

Only took a few minutes to find the site and install it!

http://dejavu-fonts.org/wiki/Download