Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: killerbot on December 28, 2005, 09:57:34 pm

Title: bold
Post by: killerbot on December 28, 2005, 09:57:34 pm
Implementing a feature request and in some dialog I want to show the contents of a text ctrl or a static text in bold.

Any quick way of doing that :
 - some wxSTYLE I can fill in the xrc file ??? (would prefer this)
 - function call ?

Lieven
Title: Re: bold
Post by: Der Meister on December 28, 2005, 10:19:07 pm
I had a similar problem a few days ago in another project using wxWidgets and solved it by creating a wxFont (http://www.wxwidgets.org/manuals/2.6.2/wx_wxfont.html#wxfont) instance with the flags I needed and then I assigned this font to the control via its SetFont method. I'm not sure if there is an easier way but at least it works this way.
Title: Re: bold
Post by: killerbot on December 28, 2005, 11:59:00 pm
Thanks,

I solved it like you suggested.

Other question :
what wx... class provides for a file : date/time modification/creation, and it's size ?

Lieven
Title: Re: bold
Post by: thomas on December 29, 2005, 12:44:36 am
*cough* *cough*

Code
<object class="wxStaticText" name="foo">
<font>
<weight>bold</weight>
</font>
<label>foobar</label>
</object>

http://www.wxwidgets.org/manuals/2.6.2/wx_wxfilename.html#wxfilenamegetmodificationtime
http://www.wxwidgets.org/manuals/2.6.2/wx_wxfile.html#wxfilelength
http://www.wxwidgets.org/manuals/2.6.2/wx_wxfile.html#wxfileaccess
http://www.wxwidgets.org/manuals/2.6.2/wx_filefunctions.html#functionwxfileexists
http://www.wxwidgets.org/manuals/2.6.2/wx_filefunctions.html#wxgetfilekind
...to name a few examples.
Title: Re: bold
Post by: killerbot on December 29, 2005, 09:25:42 am
Thanks Thomas,

You are a living knowledge base.  :P

Lieven