X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12028905135250524409f1e7b9bfa9c55e5ce16b..80b2db4ee671f62a1de0f9f91e007c83449df107:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 96024f1559..76687aed61 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -499,27 +499,47 @@ private: #endif // wxUSE_STATBOX -//--------------------------------------------------------------------------- -// wxNotebookSizer -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// wxBookCtrlSizer +// ---------------------------------------------------------------------------- -#if wxUSE_NOTEBOOK +#if wxUSE_BOOKCTRL -class WXDLLEXPORT wxNotebook; +// this sizer works with wxNotebook/wxListbook/... and sizes the control to +// fit its pages +class WXDLLEXPORT wxBookCtrl; -class WXDLLEXPORT wxNotebookSizer: public wxSizer +class WXDLLEXPORT wxBookCtrlSizer : public wxSizer { public: - wxNotebookSizer( wxNotebook *nb ); + wxBookCtrlSizer(wxBookCtrl *bookctrl); - void RecalcSizes(); - wxSize CalcMin(); + virtual void RecalcSizes(); + virtual wxSize CalcMin(); - wxNotebook *GetNotebook() const - { return m_notebook; } + wxBookCtrl *GetControl() const { return m_bookctrl; } protected: - wxNotebook *m_notebook; + wxBookCtrl *m_bookctrl; + +private: + DECLARE_CLASS(wxBookCtrlSizer) + DECLARE_NO_COPY_CLASS(wxBookCtrlSizer) +}; + + +#if wxUSE_NOTEBOOK + +// before wxBookCtrl we only had wxNotebookSizer, keep it for backwards +// compatibility +class WXDLLEXPORT wxNotebook; + +class WXDLLEXPORT wxNotebookSizer : public wxBookCtrlSizer +{ +public: + wxNotebookSizer(wxNotebook *nb); + + wxNotebook *GetNotebook() const { return (wxNotebook *)m_bookctrl; } private: DECLARE_CLASS(wxNotebookSizer) @@ -528,6 +548,7 @@ private: #endif // wxUSE_NOTEBOOK +#endif // wxUSE_BOOKCTRL + +#endif // __WXSIZER_H__ -#endif - // __WXSIZER_H__