[ wxwindows-Bugs-1801928 ] wxSizer::SetSizeHints/wxSizer::Fit can
fail to resize window
SourceForge.net
noreply at sourceforge.net
Mon Feb 11 18:00:53 PST 2008
Bugs item #1801928, was opened at 2007-09-25 12:54
Message generated for change (Comment added) made by vadz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1801928&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: Platform specific
Status: Open
Resolution: None
>Priority: 6
Private: No
Submitted By: Roger James (rogerjames99)
>Assigned to: Vadim Zeitlin (vadz)
Summary: wxSizer::SetSizeHints/wxSizer::Fit can fail to resize window
Initial Comment:
wxSizer::SetSizeHints calls wxSizer::Fit followed by wxWindow::SetSizeHints. wxSizer::Fit will recalcualte the new min and max sizes but not set them as size hints in the target window. It will then call wxWindow::SetSize, on the windows platfom this results in a WM_GETMINMAXINFO message being processed inline by a call to wxWindowMSW::HandleGetMinMaxInfo, this will be processed using the old size hints for the window as they have not yet been set by wxWindow::SetSizeHints. This means if these values are not default they will be used to limit the bounds of the current SetSize operation. The most obvious manifestation of this is when widgets have been removed or hidden from a dialog box causing its minimum size to shrink. A single call to wxSizer::SetSizeHints will not shrink the dialog box. Two consecutive calls are needed, or the call preceded by a call to wxWindow::SetMinSize(wxDefaultSize). This is beyond my competence to suggest a patch for (I have never really understood
sizers!). Setting the size hints to default within wxSizer::Fit seems a bit drastic as one might rightly assume that this should work within the constraints of the current size hints. Maybe they should be set to default at the top of the wxSizer::SetSizeHints code. Another approach may be to document the work round in the appropriate places.
Roger
----------------------------------------------------------------------
>Comment By: Vadim Zeitlin (vadz)
Date: 2008-02-12 03:00
Message:
Logged In: YES
user_id=71618
Originator: NO
We really, really need to do something about this. The same bug also
appears in wx code itself (in wxCollapsiblePane).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1801928&group_id=9863
More information about the wx-dev
mailing list