X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..64a044d5a64dd92473b4cc666a6877db78bd37d3:/interface/wx/window.h diff --git a/interface/wx/window.h b/interface/wx/window.h index 2161f7dda8..b1fe0fa9e7 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -8,7 +8,6 @@ /** @class wxWindow - @wxheader{window.h} wxWindow is the base class for all windows and represents any visible object on screen. All controls, top level windows and so on are windows. Sizers and @@ -1589,6 +1588,21 @@ public: bool PopupMenu(wxMenu* menu, int x, int y); //@} + /** + Posts a size event to the window. + + This is the same as SendSizeEvent() with @c wxSEND_EVENT_POST argument. + */ + void PostSizeEvent(); + + /** + Posts a size event to the parent of this window. + + This is the same as SendSizeEventToParent() with @c wxSEND_EVENT_POST + argument. + */ + void PostSizeEventToParent(); + /** Pushes this event handler onto the event stack for the window. @@ -1785,6 +1799,42 @@ public: virtual void ScrollWindow(int dx, int dy, const wxRect* rect = NULL); + /** + This function sends a dummy @ref overview_wxsizeevent "size event" to + the window allowing it to re-layout its children positions. + + It is sometimes useful to call this function after adding or deleting a + children after the frame creation or if a child size changes. Note that + if the frame is using either sizers or constraints for the children + layout, it is enough to call wxWindow::Layout() directly and this + function should not be used in this case. + + If @a flags includes @c wxSEND_EVENT_POST value, this function posts + the event, i.e. schedules it for later processing, instead of + dispatching it directly. You can also use PostSizeEvent() as a more + readable equivalent of calling this function with this flag. + + @param flags + May include @c wxSEND_EVENT_POST. Default value is 0. + */ + void SendSizeEvent(int flags = 0); + + /** + Safe wrapper for GetParent()->SendSizeEvent(). + + This function simply checks that the window has a valid parent which is + not in process of being deleted and calls SendSizeEvent() on it. It is + used internally by windows such as toolbars changes to whose state + should result in parent re-layout (e.g. when a toolbar is added to the + top of the window, all the other windows must be shifted down). + + @see PostSizeEventToParent() + + @param flags + See description of this parameter in SendSizeEvent() documentation. + */ + void SendSizeEventToParent(int flags = 0); + /** Sets the accelerator table for this window. See wxAcceleratorTable. */