Re: wxRadioBox font size of choices

66 views
Skip to first unread message

Erik Jensen

unread,
Sep 21, 2004, 2:40:20 PM9/21/04
to Markus Erdmann
Problem seems to be that after setting a new font, the size is not
updated automatically. So i usually do something like this:

somecheckbox->SetFont( *bigfont );
somecheckbox->SetSize( somecheckbox->GetBestSize() );

Regard,
Erik


ME> Hello NG,

ME> i set the wxFont to a bigger format. Then I create a wxRadioBox with
ME> multiple choices. The problem is that the choices - or better the label
ME> of the Buttons - are appearing in the new font size, what is my
ME> intention. But the size.y (=height) of the buttons does not change and
ME> so the label of the buttons isn't fully displayed.
ME> How can I display the whole label of the button?


ME> Thanks for your help.

ME> Markus

ME> There were a similar question
ME> date:2004-07-10
ME> subject:"Text cut off on Radio Box Labels" ...no answer so far.

Vadim Zeitlin

unread,
Sep 25, 2004, 1:45:55 PM9/25/04
to wx-u...@lists.wxwidgets.org
On Sat, 25 Sep 2004 10:43:07 -0700 Robin Dunn <ro...@alldunn.com> wrote:

RD> IIRC we decided to do that in all controls instead of always changing
RD> the size like in statictext because of the surprise layout problems it
RD> might cause some existing apps.

Ok, sorry, I forgot that we did take a decision about it. What would be
the best place to document this in so that neither I nor anyone else
forgets it again? In wxWindow::SetFont() docs maybe?

Thanks,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


Robin Dunn

unread,
Sep 25, 2004, 1:43:07 PM9/25/04
to wx-u...@lists.wxwidgets.org
Vadim Zeitlin wrote:
> On Tue, 21 Sep 2004 20:40:20 +0200 Erik Jensen <doub...@web.de> wrote:
>
> EJ> Problem seems to be that after setting a new font, the size is not
> EJ> updated automatically. So i usually do something like this:
> EJ>
> EJ> somecheckbox->SetFont( *bigfont );
> EJ> somecheckbox->SetSize( somecheckbox->GetBestSize() );
>
> We probably should update the size automatically or at least provide an
> UpdateSize() method which would do SetSize(GetBestSize()) because the above
> looks a bit ugly in user code.
>
> Right now things are really inconsistent because we do update the size for
> wxStaticText (but only if it doesn't have wxST_NO_AUTORESIZE flag) but not
> for any other control. OTOH always updating the size by default probably
> would break some existing code...

It does (or should be) invalidate the cached best size so if the control
is in a sizer and has no minsize it will be resized at the next Layout.

IIRC we decided to do that in all controls instead of always changing

the size like in statictext because of the surprise layout problems it

might cause some existing apps.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


Vadim Zeitlin

unread,
Sep 25, 2004, 8:04:45 AM9/25/04
to wx-u...@lists.wxwidgets.org
On Tue, 21 Sep 2004 20:40:20 +0200 Erik Jensen <doub...@web.de> wrote:

EJ> Problem seems to be that after setting a new font, the size is not
EJ> updated automatically. So i usually do something like this:
EJ>
EJ> somecheckbox->SetFont( *bigfont );
EJ> somecheckbox->SetSize( somecheckbox->GetBestSize() );

We probably should update the size automatically or at least provide an
UpdateSize() method which would do SetSize(GetBestSize()) because the above
looks a bit ugly in user code.

Right now things are really inconsistent because we do update the size for
wxStaticText (but only if it doesn't have wxST_NO_AUTORESIZE flag) but not
for any other control. OTOH always updating the size by default probably
would break some existing code...

Regards,

Reply all
Reply to author
Forward
0 new messages