X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00dc67b89145eb35f35c1cac1e964f093c159861..b7e5ba8f2d676583c790c59388eba8bfa9bd33c2:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 4593844fdb..bbab8447f9 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -54,7 +54,7 @@ public: wxSizerFlags& Align(int alignment) // combination of wxAlignment values { - m_flags &= wxALIGN_MASK; + m_flags &= ~wxALIGN_MASK; m_flags |= alignment; return *this; @@ -252,9 +252,14 @@ public: { return m_kind == Item_Sizer ? m_sizer : NULL; } wxSize GetSpacer() const; - void Show(bool show); + // this function behaves obviously for the windows and spacers but for the + // sizers it returns true if any sizer element is shown and only returns + // false if all of them are hidden bool IsShown() const; + void Show(bool show); + void SetUserData(wxObject* userData) + { delete m_userData; m_userData = userData; } wxObject* GetUserData() const { return m_userData; } wxPoint GetPosition() const @@ -274,6 +279,8 @@ protected: // common part of ctors taking wxSizerFlags void Init(const wxSizerFlags& flags); + + // discriminated union: depending on m_kind one of the fields is valid enum { Item_None, @@ -320,7 +327,7 @@ WX_DECLARE_EXPORTED_LIST( wxSizerItem, wxSizerItemList ); class WXDLLEXPORT wxSizer: public wxObject, public wxClientDataContainer { public: - wxSizer(); + wxSizer() { } ~wxSizer(); // methods for adding elements to the sizer: there are Add/Insert/Prepend @@ -484,18 +491,13 @@ public: // Recursively call wxWindow::Show () on all sizer items. virtual void ShowItems (bool show); - void Show(bool show) - { m_isShown = show; - ShowItems(show); - } - bool IsShown() const { return m_isShown; } + void Show(bool show) { ShowItems(show); } protected: wxSize m_size; wxSize m_minSize; wxPoint m_position; wxSizerItemList m_children; - bool m_isShown; wxSize GetMaxWindowSize( wxWindow *window ) const; wxSize GetMinWindowSize( wxWindow *window );