X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbfb8bcc3fa17e079d4219655b173f8ed2ccc65a..27ea6757f36b847e94fc9003c34d5768c341aa13:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 28965fe97e..bbab8447f9 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -18,7 +18,6 @@ #include "wx/window.h" #include "wx/frame.h" #include "wx/dialog.h" -#include "wx/bookctrl.h" //--------------------------------------------------------------------------- // classes @@ -55,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); } @@ -82,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 } @@ -241,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 @@ -263,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, @@ -309,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 @@ -473,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 );