X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f944aec0cf131c1be0b8c127ba1ecdbc8410c9b2..9c97f8ea883afa5db14c37bea63f6d4c327b4596:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index a6a1252fb4..bd932e89ce 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -84,9 +84,15 @@ public: static int GetDefaultBorder() { #if wxUSE_BORDER_BY_DEFAULT + #ifdef __WXGTK20__ + // GNOME HIG says to use 6px as the base unit: + // http://library.gnome.org/devel/hig-book/stable/design-window.html.en + return 6; + #else // FIXME: default border size shouldn't be hardcoded and at the very // least they should depend on the current font size return 5; + #endif #else return 0; #endif @@ -170,6 +176,13 @@ public: return *this; } + // makes the item ignore window's visibility status + wxSizerFlags& ReserveSpaceEvenIfHidden() + { + m_flags |= wxRESERVE_SPACE_EVEN_IF_HIDDEN; + return *this; + } + // accessors for wxSizer only int GetProportion() const { return m_proportion; } int GetFlags() const { return m_flags; } @@ -332,10 +345,12 @@ public: { return m_kind == Item_Sizer ? m_sizer : NULL; } wxSize GetSpacer() const; - // this function behaves obviously for the windows and spacers but for the + // 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 + // false if all of them are hidden. Also, it always returns true if + // wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was used. bool IsShown() const; + void Show(bool show); void SetUserData(wxObject* userData) @@ -601,6 +616,9 @@ public: virtual void Layout(); + wxSize ComputeFittingClientSize(wxWindow *window); + wxSize ComputeFittingWindowSize(wxWindow *window); + wxSize Fit( wxWindow *window ); void FitInside( wxWindow *window ); void SetSizeHints( wxWindow *window ); @@ -652,8 +670,6 @@ protected: // the window this sizer is used in, can be NULL wxWindow *m_containingWindow; - wxSize GetMaxWindowSize( wxWindow *window ) const; - wxSize GetMinWindowSize( wxWindow *window ); wxSize GetMaxClientSize( wxWindow *window ) const; wxSize GetMinClientSize( wxWindow *window ); wxSize VirtualFitSize( wxWindow *window ); @@ -799,6 +815,7 @@ public: wxBoxSizer(int orient) { m_orient = orient; + m_totalProportion = 0; wxASSERT_MSG( m_orient == wxHORIZONTAL || m_orient == wxVERTICAL, _T("invalid value for wxBoxSizer orientation") ); @@ -902,8 +919,7 @@ protected: void AdjustPropLastItem(wxSizer *psz, wxSizerItem *itemLast); -private: - DECLARE_DYNAMIC_CLASS(wxWrapSizer); + DECLARE_DYNAMIC_CLASS(wxWrapSizer) }; //---------------------------------------------------------------------------