PureBasic Forum
https://www.purebasic.fr/english/

BackColor
https://www.purebasic.fr/english/viewtopic.php?f=22&t=66682
Page 1 of 1

Author:  k3pto [ Wed Sep 28, 2016 6:05 pm ]
Post subject:  BackColor

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?

Author:  Marc56us [ Thu Sep 29, 2016 9:03 am ]
Post subject:  Re: BackColor

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:
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)

Author:  IdeasVacuum [ Thu Sep 29, 2016 1:33 pm ]
Post subject:  Re: BackColor

Quote:
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

Author:  k3pto [ Thu Sep 29, 2016 4:05 pm ]
Post subject:  Re: BackColor

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.

Author:  IdeasVacuum [ Thu Sep 29, 2016 4:39 pm ]
Post subject:  Re: BackColor

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/viewtopic.php?f=27&t=62741

Author:  blueb [ Fri Sep 30, 2016 3:49 pm ]
Post subject:  Re: BackColor

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

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/