It is currently Sun Nov 18, 2018 8:19 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: BackColor
PostPosted: Wed Sep 28, 2016 6:05 pm 
Offline
User
User

Joined: Sat Jan 17, 2015 5:24 pm
Posts: 20
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: BackColor
PostPosted: Thu Sep 29, 2016 9:03 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 508
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)


Top
 Profile  
Reply with quote  
 Post subject: Re: BackColor
PostPosted: Thu Sep 29, 2016 1:33 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5779
Location: Wales, UK
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

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: BackColor
PostPosted: Thu Sep 29, 2016 4:05 pm 
Offline
User
User

Joined: Sat Jan 17, 2015 5:24 pm
Posts: 20
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: BackColor
PostPosted: Thu Sep 29, 2016 4:39 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5779
Location: Wales, UK
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

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: BackColor
PostPosted: Fri Sep 30, 2016 3:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 742
Location: Cuernavaca, Mexico
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye