X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50c06297bd2a5b496a899198a5957755655ab43d..717a70722efbd1931301d44344df83ec23118b7b:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 9b84741354..53dde1a4bf 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -12,17 +12,12 @@ #ifndef __WXSIZER_H__ #define __WXSIZER_H__ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "sizer.h" -#endif - #include "wx/defs.h" #include "wx/button.h" #include "wx/window.h" #include "wx/frame.h" #include "wx/dialog.h" -#include "wx/bookctrl.h" //--------------------------------------------------------------------------- // classes @@ -59,14 +54,19 @@ public: wxSizerFlags& Align(int alignment) // combination of wxAlignment values { - m_flags &= wxALL; + m_flags &= ~wxALIGN_MASK; m_flags |= alignment; return *this; } + wxSizerFlags& Expand() + { + m_flags |= wxEXPAND; + return *this; + } + // some shortcuts for Align() - wxSizerFlags& Expand() { return Align(wxEXPAND); } wxSizerFlags& Centre() { return Align(wxCENTRE); } wxSizerFlags& Center() { return Centre(); } wxSizerFlags& Left() { return Align(wxALIGN_LEFT); } @@ -86,7 +86,14 @@ public: wxSizerFlags& Border(int direction = wxALL) { // FIXME: default border size shouldn't be hardcoded +#ifdef __SMARTPHONE__ + // no borders by default on limited size screen + wxUnusedVar(direction); + + return *this; +#else return Border(direction, 5); +#endif } @@ -188,7 +195,7 @@ public: virtual wxSize GetSize() const; virtual wxSize CalcMin(); - virtual void SetDimension( wxPoint pos, wxSize size ); + virtual void SetDimension( const wxPoint& pos, const wxSize& size ); wxSize GetMinSize() const { return m_minSize; } @@ -248,6 +255,8 @@ public: void Show(bool show); bool IsShown() const; + void SetUserData(wxObject* userData) + { delete m_userData; m_userData = userData; } wxObject* GetUserData() const { return m_userData; } wxPoint GetPosition() const @@ -410,24 +419,24 @@ public: void SetMinSize( int width, int height ) { DoSetMinSize( width, height ); } - void SetMinSize( wxSize size ) + void SetMinSize( const wxSize& size ) { DoSetMinSize( size.x, size.y ); } // Searches recursively bool SetItemMinSize( wxWindow *window, int width, int height ) { return DoSetItemMinSize( window, width, height ); } - bool SetItemMinSize( wxWindow *window, wxSize size ) + bool SetItemMinSize( wxWindow *window, const wxSize& size ) { return DoSetItemMinSize( window, size.x, size.y ); } // Searches recursively bool SetItemMinSize( wxSizer *sizer, int width, int height ) { return DoSetItemMinSize( sizer, width, height ); } - bool SetItemMinSize( wxSizer *sizer, wxSize size ) + bool SetItemMinSize( wxSizer *sizer, const wxSize& size ) { return DoSetItemMinSize( sizer, size.x, size.y ); } bool SetItemMinSize( size_t index, int width, int height ) { return DoSetItemMinSize( index, width, height ); } - bool SetItemMinSize( size_t index, wxSize size ) + bool SetItemMinSize( size_t index, const wxSize& size ) { return DoSetItemMinSize( index, size.x, size.y ); } wxSize GetSize() const @@ -477,7 +486,10 @@ public: // Recursively call wxWindow::Show () on all sizer items. virtual void ShowItems (bool show); - void Show(bool show) { m_isShown = show; } + void Show(bool show) + { m_isShown = show; + ShowItems(show); + } bool IsShown() const { return m_isShown; } protected: