[ wxwindows-Bugs-1769664 ] 1.2 wxWindow - Layout() is not called automatically

SourceForge.net noreply at sourceforge.net
Tue Aug 7 14:23:31 PDT 2007


Bugs item #1769664, was opened at 2007-08-07 17:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1769664&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: Common
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Andrey (andrey_yazhuk)
Assigned to: Nobody/Anonymous (nobody)
Summary: 1.2	wxWindow - Layout() is not called automatically

Initial Comment:
Current wxWidgets documentation for wxWindow::Layout() says "when auto layout is on, this function gets called automatically when the window is resized".

I overloaded Layout() in my class, if I derive the class from wxPanel, the function indeed gets called. If I derive the same class from wxWindow Layout() is not being called.

I examined the source code for ver 2.8.2 and found the following:

void wxPanel::OnSize(wxSizeEvent& event)
{
   if (GetAutoLayout())
     Layout();
   ...
}

There is nothing like that in wxWindow source code, it seems that auto layout works only for wxPanel-derived classes. 

Julian Smart commented on this:

Layout() not getting called automatically - I've often been bitten by this myself, and in principle I agree, this should be implemented in wxWindow as per the documentation. However... I just tried implementing it in SVN trunk and it broke the layout of the rich text control sample (the listbox + combobox has a parent that's derived from wxControl, and this parent window implements OnSize and calls Layout()). So it would need a bit more investigation to see whether the change would break too many applications. Another issue is that wxPanel::OnSize calls event.Skip(), which would need to be removed if wxWindow::OnSize implemented the same thing (to avoid double-layout) - and this is another potential for incompatibility. I'll have another look into this.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1769664&group_id=9863




More information about the wx-dev mailing list