]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/bookctrl.h
use wxSTRINGIZE instead of redefining a special STRINGIZE in this file
[wxWidgets.git] / include / wx / bookctrl.h
index d1dfe04f5022779e39e30b428ba65b919b7eb9c8..2d5c4ad04ae2f1b32c02dbdf9110d151c076e806 100644 (file)
@@ -27,6 +27,20 @@ WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages);
 
 class WXDLLEXPORT wxImageList;
 
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// wxBookCtrl hit results
+enum
+{
+    wxBK_HITTEST_NOWHERE = 1,   // not on tab
+    wxBK_HITTEST_ONICON  = 2,   // on icon
+    wxBK_HITTEST_ONLABEL = 4,   // on label
+    wxBK_HITTEST_ONITEM  = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL,
+    wxBK_HITTEST_ONPAGE  = 8    // not on tab control, but over the selected page
+};
+
 // ----------------------------------------------------------------------------
 // wxBookCtrlBase
 // ----------------------------------------------------------------------------
@@ -118,9 +132,6 @@ public:
     // calculate the size of the control from the size of its page
     virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const = 0;
 
-    // get the default alignment
-    virtual int GetDefaultAlignment() const { return wxBK_TOP; }
-
     // get/set size of area between book control area and page area
     unsigned int GetInternalBorder() const { return m_internalBorder; }
     void SetInternalBorder(unsigned int border) { m_internalBorder = border; }
@@ -130,7 +141,7 @@ public:
     int GetControlMargin() const { return m_controlMargin; }
 
     // returns true if we have wxBK_TOP or wxBK_BOTTOM style
-    bool IsVertical() const { return HasFlag(wxBK_ALIGN_MASK) ? HasFlag(wxBK_BOTTOM | wxBK_TOP) : (0 != (GetDefaultAlignment() & (wxBK_BOTTOM | wxBK_TOP))); }
+    bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); }
 
     // set/get option to shrink to fit current page
     void SetFitToCurrentPage(bool fit) { m_fitToCurrentPage = fit; }
@@ -202,6 +213,10 @@ public:
         return wxNOT_FOUND;
     }
 
+
+    // we do have multiple pages
+    virtual bool HasMultiplePages() const { return true; }
+
 protected:
     // Should we accept NULL page pointers in Add/InsertPage()?
     //
@@ -317,6 +332,7 @@ private:
     #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 wxBookctrlEventHandler(func)           wxNotebookEventHandler(func)
 #else
     // dedicated to Smartphones
     #include "wx/choicebk.h"
@@ -326,6 +342,7 @@ private:
     #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 wxBookctrlEventHandler(func)           wxChoicebookEventHandler(func)
 #endif
 
 #if WXWIN_COMPATIBILITY_2_6