lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Segfault in lmi with wx-2.9.5


From: Greg Chicares
Subject: Re: [lmi] Segfault in lmi with wx-2.9.5
Date: Fri, 19 Jul 2013 22:52:58 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

On 2013-07-14 15:54Z, Vadim Zeitlin wrote:
> On Sun, 14 Jul 2013 12:53:12 +0000 Greg Chicares <address@hidden> wrote:
[...]
> GC> warning: not enough space for wxSpinCtrl!
> 
>  I've also looked at this while I was playing with the MSVC build and this
> is not really wxWidgets fault but it definitely could be more helpful about
> what's going on, so I've also improved the things a little here and now the
> debug output says:
> 
> wxSpinCtrl "SurviveToAge": initial width 10 is too small, at least 19 pixels 
> needed.
> wxSpinCtrl "SurviveToYear": initial width 10 is too small, at least 19 pixels 
> needed.
> wxSpinCtrl "IssueAge": initial width 10 is too small, at least 19 pixels 
> needed.
> wxSpinCtrl "RetirementAge": initial width 10 is too small, at least 19 pixels 
> needed.
> wxSpinCtrl "SolveBeginYear": initial width 10 is too small, at least 19 
> pixels needed.
> wxSpinCtrl "SolveBeginTime": initial width 10 is too small, at least 19 
> pixels needed.
> wxSpinCtrl "SolveEndYear": initial width 10 is too small, at least 19 pixels 
> needed.
> wxSpinCtrl "SolveEndTime": initial width 10 is too small, at least 19 pixels 
> needed.
> wxSpinCtrl "SolveTargetYear": initial width 10 is too small, at least 19 
> pixels needed.
> wxSpinCtrl "SolveTargetTime": initial width 10 is too small, at least 19 
> pixels needed.

Much more informative, thanks.

>  As you can see, the problem is that these controls are created with a
> hard-coded width of 10 pixels in the XRC file which is too small to
> accommodate both the spin button (whose width is 17 on my system) and
> wxTextCtrl. The simplest solution would be to just remove the width
> completely. If you want to impose some minimal width on the control, then
> specifying a width in dialog units (i.e. with "d" suffix) and adding ~6
> (one dialog unit is 1/4th of the average character width and spin button is
> usually somewhat larger than an average character) should take care of
> this.

Removing the width works great for the first four controls.

For the last six, I really want the statictext-and-spincontrol combination
to expand to the width of the radiobox above. Experimentally, I found that
they do so if I code the width as 20. If I omit the width, then they expand
too much.

>  Of course, ideally wxWidgets would allow you to specify the width of the
> text part of the control only, and do it in characters it contains (because
> you'd probably like to say "it should be wide enough for 3 digits" and not
> bother with the dialog units) and both of these enhancements had been
> discussed but haven't been implemented so far.

That would be handy. Here, for instance:

  <object class="wxComboBox" name="Country">
      <help>Country (ISO 3166-1-Alpha-2 code)</help>
      <size>40,-1</size>
      <style>wxCB_DROPDOWN|wxCB_READONLY</style>
  </object>

I spent time experimentally determining that forty units is wide enough
to accommodate "MM". It would be nicer to express that as "3 characters"
(potentially of maximum width).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]