Introduced the ability to size a book control based on the currently selected page
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -131,6 +131,10 @@ public:
|
|||||||
// returns true if we have wxCHB_TOP or wxCHB_BOTTOM style
|
// returns true if we have wxCHB_TOP or wxCHB_BOTTOM style
|
||||||
bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); }
|
bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); }
|
||||||
|
|
||||||
|
// set/get option to shrink to fit current page
|
||||||
|
void SetShrinkMode(bool shrink) { m_shrinkToFit = shrink; }
|
||||||
|
bool GetShrinkMode() const { return m_shrinkToFit; }
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
@@ -229,6 +233,9 @@ protected:
|
|||||||
// controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook)
|
// controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook)
|
||||||
wxControl *m_bookctrl;
|
wxControl *m_bookctrl;
|
||||||
|
|
||||||
|
// Whether to shrink to fit current page
|
||||||
|
bool m_shrinkToFit;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
|
@@ -53,6 +53,7 @@ void wxBookCtrlBase::Init()
|
|||||||
m_bookctrl = NULL;
|
m_bookctrl = NULL;
|
||||||
m_imageList = NULL;
|
m_imageList = NULL;
|
||||||
m_ownsImageList = false;
|
m_ownsImageList = false;
|
||||||
|
m_shrinkToFit = false;
|
||||||
|
|
||||||
#if defined(__WXWINCE__)
|
#if defined(__WXWINCE__)
|
||||||
m_internalBorder = 1;
|
m_internalBorder = 1;
|
||||||
@@ -143,6 +144,9 @@ wxSize wxBookCtrlBase::DoGetBestSize() const
|
|||||||
bestSize.y = childBestSize.y;
|
bestSize.y = childBestSize.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_shrinkToFit && GetCurrentPage())
|
||||||
|
bestSize = GetCurrentPage()->GetBestSize();
|
||||||
|
|
||||||
// convert display area to window area, adding the size necessary for the
|
// convert display area to window area, adding the size necessary for the
|
||||||
// tabs
|
// tabs
|
||||||
|
Reference in New Issue
Block a user