X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2d5a7ee008faae08694abd039f7da235da8bce5..00958db524c4b0e2d72466d5416ce9fad41f42b6:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 90611c917b..1b7071d626 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -298,6 +298,9 @@ public: int GetMaxWidth() const { return m_maxWidth; } int GetMaxHeight() const { return m_maxHeight; } + // Override this method to control the values given to Sizers etc. + virtual wxSize GetMaxSize() const { return wxSize( m_maxWidth, m_maxHeight ); } + // window state // ------------ @@ -702,15 +705,6 @@ public: void SetConstraints( wxLayoutConstraints *constraints ); wxLayoutConstraints *GetConstraints() const { return m_constraints; } - // when using constraints, it makes sense to update children positions - // automatically whenever the window is resized - this is done if - // autoLayout is on - void SetAutoLayout( bool autoLayout ) { m_autoLayout = autoLayout; } - bool GetAutoLayout() const { return m_autoLayout; } - - // do layout the window and its children - virtual bool Layout(); - // implementation only void UnsetConstraints(wxLayoutConstraints *c); wxWindowList *GetConstraintsInvolvedIn() const @@ -733,16 +727,25 @@ public: virtual void GetClientSizeConstraint(int *w, int *h) const ; virtual void GetPositionConstraint(int *x, int *y) const ; +#endif // wxUSE_CONSTRAINTS + + // when using constraints or sizers, it makes sense to update + // children positions automatically whenever the window is resized + // - this is done if autoLayout is on + void SetAutoLayout( bool autoLayout ) { m_autoLayout = autoLayout; } + bool GetAutoLayout() const { return m_autoLayout; } + + // lay out the window and its children + virtual bool Layout(); + // sizers - void SetSizer( wxSizer *sizer ); + void SetSizer(wxSizer *sizer, bool deleteOld = TRUE ); wxSizer *GetSizer() const { return m_windowSizer; } // Track if this window is a member of a sizer void SetContainingSizer(wxSizer* sizer) { m_containingSizer = sizer; } wxSizer *GetContainingSizer() const { return m_containingSizer; } -#endif // wxUSE_CONSTRAINTS - // backward compatibility // ---------------------- #if WXWIN_COMPATIBILITY @@ -843,6 +846,7 @@ protected: // constraints this window is involved in wxWindowList *m_constraintsInvolvedIn; +#endif // wxUSE_CONSTRAINTS // this window's sizer wxSizer *m_windowSizer; @@ -852,7 +856,6 @@ protected: // Layout() window automatically when its size changes? bool m_autoLayout:1; -#endif // wxUSE_CONSTRAINTS // window state bool m_isShown:1; @@ -965,7 +968,7 @@ protected: // Makes an adjustment to the window position (for example, a frame that has // a toolbar that it manages itself). - virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags); + virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) const; private: @@ -1077,3 +1080,5 @@ inline int NewControlId() { return wxWindowBase::NewControlId(); } #endif // _WX_WINDOW_H_BASE_ + +// vi:sts=4:sw=4:et