X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/21db32c1294eff5c1b6b087d260d2accc17abb53..f60b1d829dd8a6d5e47a2adcd3690acb3bd10150:/include/wx/bookctrl.h diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 49952ecb2c..82f956d58e 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // Name: wx/bookctrl.h -// Purpose: wxBookCtrl: common base class for wxList/Tree/Notebook +// Purpose: wxBookCtrlBase: common base class for wxList/Tree/Notebook // Author: Vadim Zeitlin // Modified by: // Created: 19.08.03 @@ -32,26 +32,26 @@ WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages); class WXDLLEXPORT wxImageList; // ---------------------------------------------------------------------------- -// wxBookCtrl +// wxBookCtrlBase // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxBookCtrl : public wxControl +class WXDLLEXPORT wxBookCtrlBase : public wxControl { public: // construction // ------------ - wxBookCtrl() + wxBookCtrlBase() { Init(); } - wxBookCtrl(wxWindow *parent, - wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString) + wxBookCtrlBase(wxWindow *parent, + wxWindowID winid, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxEmptyString) { Init(); @@ -67,7 +67,7 @@ public: const wxString& name = wxEmptyString); // dtor - virtual ~wxBookCtrl(); + virtual ~wxBookCtrlBase(); // accessors @@ -84,7 +84,7 @@ public: { int n = GetSelection(); return n == wxNOT_FOUND ? NULL - : wx_const_cast(wxBookCtrl *, this)->GetPage(n); + : wx_const_cast(wxBookCtrlBase *, this)->GetPage(n); } // get the currently selected page or wxNOT_FOUND if none @@ -179,9 +179,6 @@ public: } } - virtual void ApplyParentThemeBackground(const wxColour& bg) - { SetBackgroundColour(bg); } - protected: // remove the page and return a pointer to it virtual wxWindow *DoRemovePage(size_t page) = 0; @@ -208,18 +205,18 @@ protected: bool m_ownsImageList; - DECLARE_NO_COPY_CLASS(wxBookCtrl) + DECLARE_NO_COPY_CLASS(wxBookCtrlBase) }; // ---------------------------------------------------------------------------- -// wxBookCtrlEvent: page changing events generated by derived classes +// wxBookCtrlBaseEvent: page changing events generated by derived classes // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxBookCtrlEvent : public wxNotifyEvent +class WXDLLEXPORT wxBookCtrlBaseEvent : public wxNotifyEvent { public: - wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, - int nSel = -1, int nOldSel = -1) + wxBookCtrlBaseEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, + int nSel = -1, int nOldSel = -1) : wxNotifyEvent(commandType, winid) { m_nSel = nSel; @@ -239,6 +236,37 @@ private: m_nOldSel; // previously selected page }; +// make a default book control for given platform +#if wxUSE_NOTEBOOK + // dedicated to majority of desktops + #include "wx/notebook.h" + #define wxBookCtrl wxNotebook + #define wxBookCtrlEvent wxNotebookEvent + #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED + #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING + #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_NOTEBOOK_PAGE_CHANGED(id, fn) + #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn) + #define wxBC_TOP wxNB_TOP + #define wxBC_BOTTOM wxNB_BOTTOM + #define wxBC_LEFT wxNB_LEFT + #define wxBC_RIGHT wxNB_RIGHT + #define wxBC_DEFAULT wxNB_DEFAULT +#else + // dedicated to Smartphones + #include "wx/choicebk.h" + #define wxBookCtrl wxChoicebook + #define wxBookCtrlEvent wxChoicebookEvent + #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED + #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING + #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_CHOICEBOOK_PAGE_CHANGED(id, fn) + #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_CHOICEBOOK_PAGE_CHANGING(id, fn) + #define wxBC_TOP wxCHB_TOP + #define wxBC_BOTTOM wxCHB_BOTTOM + #define wxBC_LEFT wxCHB_LEFT + #define wxBC_RIGHT wxCHB_RIGHT + #define wxBC_DEFAULT wxCHB_DEFAULT +#endif + #endif // wxUSE_BOOKCTRL #endif // _WX_BOOKCTRL_H_