X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49dcc246bfddae204903a19181597ccd5bec3901..e276acb530f41f0b87c4576c0215201a8a767dff:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 59b834d2f3..26a32ba3ea 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -58,6 +58,15 @@ public: return *this; } + wxSizerFlags& Expand() + { + m_flags |= wxEXPAND; + return *this; + } + + // notice that Align() replaces the current alignment flags, use specific + // methods below such as Top(), Left() &c if you want to set just the + // vertical or horizontal alignment wxSizerFlags& Align(int alignment) // combination of wxAlignment values { m_flags &= ~wxALIGN_MASK; @@ -66,19 +75,34 @@ public: return *this; } - wxSizerFlags& Expand() + // some shortcuts for Align() + wxSizerFlags& Centre() { return Align(wxALIGN_CENTRE); } + wxSizerFlags& Center() { return Centre(); } + + wxSizerFlags& Top() { - m_flags |= wxEXPAND; + m_flags &= ~(wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL); + return *this; + } + + wxSizerFlags& Left() + { + m_flags &= ~(wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL); + return *this; + } + + wxSizerFlags& Right() + { + m_flags = (m_flags & ~wxALIGN_CENTRE_HORIZONTAL) | wxALIGN_RIGHT; + return *this; + } + + wxSizerFlags& Bottom() + { + m_flags = (m_flags & ~wxALIGN_CENTRE_VERTICAL) | wxALIGN_BOTTOM; return *this; } - // some shortcuts for Align() - wxSizerFlags& Centre() { return Align(wxALIGN_CENTRE); } - wxSizerFlags& Center() { return Centre(); } - wxSizerFlags& Top() { return Align(wxALIGN_TOP); } - wxSizerFlags& Left() { return Align(wxALIGN_LEFT); } - wxSizerFlags& Right() { return Align(wxALIGN_RIGHT); } - wxSizerFlags& Bottom() { return Align(wxALIGN_BOTTOM); } // default border size used by Border() below static int GetDefaultBorder() @@ -360,9 +384,9 @@ public: wxPoint GetPosition() const { return m_pos; } - // Called once the first component of an item has been decided. This is - // used in algorithms that depend on knowing the size in one direction - // before the min size in the other direction can be known. + // Called once the first component of an item has been decided. This is + // used in algorithms that depend on knowing the size in one direction + // before the min size in the other direction can be known. // Returns true if it made use of the information (and min size was changed). bool InformFirstDirection( int direction, int size, int availableOtherDir=-1 ); @@ -447,7 +471,7 @@ protected: private: DECLARE_CLASS(wxSizerItem) - DECLARE_NO_COPY_CLASS(wxSizerItem) + wxDECLARE_NO_COPY_CLASS(wxSizerItem); }; WX_DECLARE_EXPORTED_LIST( wxSizerItem, wxSizerItemList ); @@ -517,7 +541,7 @@ public: wxSizerItem* Insert(size_t index, int width, int height, - const wxSizerFlags& flags); + const wxSizerFlags& flags); virtual wxSizerItem* Insert( size_t index, wxSizerItem *item); wxSizerItem* InsertSpacer(size_t index, int size); @@ -576,7 +600,7 @@ public: // Returns true if it made use of the informtion (and recalculated min size) virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) ) { return false; } - + void SetMinSize( int width, int height ) { DoSetMinSize( width, height ); } void SetMinSize( const wxSize& size ) @@ -641,6 +665,9 @@ public: void SetDimension(int x, int y, int width, int height) { SetDimension(wxPoint(x, y), wxSize(width, height)); } + size_t GetItemCount() const { return m_children.GetCount(); } + bool IsEmpty() const { return m_children.IsEmpty(); } + wxSizerItem* GetItem( wxWindow *window, bool recursive = false ); wxSizerItem* GetItem( wxSizer *sizer, bool recursive = false ); wxSizerItem* GetItem( size_t index ); @@ -731,8 +758,8 @@ private: // wxFlexGridSizer //--------------------------------------------------------------------------- -// the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible" -// direction +// values which define the behaviour for resizing wxFlexGridSizer cells in the +// "non-flexible" direction enum wxFlexSizerGrowMode { // don't resize the cells in non-flexible direction at all @@ -761,6 +788,8 @@ public: void AddGrowableCol( size_t idx, int proportion = 0 ); void RemoveGrowableCol( size_t idx ); + bool IsRowGrowable( size_t idx ); + bool IsColGrowable( size_t idx ); // the sizer cells may grow in both directions, not grow at all or only // grow in one direction but not the other @@ -809,7 +838,7 @@ protected: private: DECLARE_CLASS(wxFlexGridSizer) - DECLARE_NO_COPY_CLASS(wxFlexGridSizer) + wxDECLARE_NO_COPY_CLASS(wxFlexGridSizer); }; //--------------------------------------------------------------------------- @@ -932,7 +961,7 @@ protected: private: DECLARE_CLASS(wxStaticBoxSizer) - DECLARE_NO_COPY_CLASS(wxStaticBoxSizer) + wxDECLARE_NO_COPY_CLASS(wxStaticBoxSizer); }; #endif // wxUSE_STATBOX @@ -980,7 +1009,7 @@ protected: private: DECLARE_CLASS(wxStdDialogButtonSizer) - DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer) + wxDECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer); }; #endif // wxUSE_BUTTON @@ -1008,9 +1037,9 @@ inline void wxSizerItem::SetSpacer(const wxSize& size) } inline void wxSizerItem::SetSpacer(int width, int height) -{ - DoSetSpacer(wxSize(width, height)); -} +{ + DoSetSpacer(wxSize(width, height)); +} #endif // WXWIN_COMPATIBILITY_2_8