BackColor

You need some new stunning features ? Tell us here.
k3pto
User
User
Posts: 50
Joined: Sat Jan 17, 2015 5:24 pm

BackColor

Post 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?
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: BackColor

Post 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)
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: BackColor

Post 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
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
k3pto
User
User
Posts: 50
Joined: Sat Jan 17, 2015 5:24 pm

Re: BackColor

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: BackColor

Post 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
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: BackColor

Post 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
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Post Reply