lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Wrong wxFlexGridSizer usage in about_dialog.cpp


From: Greg Chicares
Subject: Re: [lmi] Wrong wxFlexGridSizer usage in about_dialog.cpp
Date: Wed, 13 Jan 2010 13:45:44 +0000
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

On 2010-01-12 23:36Z, Vadim Zeitlin wrote:
> On Mon, 11 Jan 2010 17:32:13 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> And here's something else that's wrong:
> GC>   Help | About
> GC>   click "Read the GNU General Public License"
> GC> The license text doesn't scroll in the html window. There was a scrollbar
> GC> there, at least on a 20060313 build that I have at hand. Now, however,
> GC> there's no scrollbar, and the scrolling keys do nothing: only the preamble
> GC> can be read.

[snip useful background information, which I was glad to learn]

>      html_window->GetInternalRepresentation()->Layout(1);
>      int width =
>              html_window->GetInternalRepresentation()->GetWidth()
>          +   wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)
>          ;
> -    int height = html_window->GetInternalRepresentation()->GetHeight();
> -    html_window->SetSize(width, height);
> +
> +    // Unlike in ShowModal() above, we don't want to size this window to fit
> +    // its contents vertically as the license text is so long that it will
> +    // almost surely not fit the display. Hence just (arbitrarily) make it
> +    // slightly larger than the main dialog so that this one appears to be on
> +    // top of it.
> +    int height = (3*GetSize().y)/2;
> +    html_window->SetMinSize(wxSize(width, height));

An arbitrary 3/2 adjustment feels wrong. And indeed it doesn't DTRT
on msw at 800x600 resolution: I can't scroll all the way to the bottom
of the license. The last line I can see is:
| proprietary programs.  If your program is a subroutine library, you may
and I can't see the "Close" button. At 1600x1200 resolution, OTOH, the
window is only about half as high as it "wants" to be, so the inability
to resize it feels like a defect.

This is the first thing a new user sees when running the program for the
first time, so I'm concerned about first impressions. Isn't there some way
to make it behave the way it used to? I suppose we want something like:

  int height = html_window->GetInternalRepresentation()->GetHeight();
  int max_height = /* the height that a maximized window would have */
  height = std::min(height, max_height);
  html_window->SetMinSize(wxSize(width, height));

so I think my only question is how to use wx to ascertain what height a
maximized window would have.




reply via email to

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