X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526954c5968baa29218c994ec48e476ae2bd4b9f..5eeccdd52c8a7140bfa220d412aa9dc181f7a4d8:/interface/wx/bookctrl.h diff --git a/interface/wx/bookctrl.h b/interface/wx/bookctrl.h index 6fd8c596a0..41ef787efe 100644 --- a/interface/wx/bookctrl.h +++ b/interface/wx/bookctrl.h @@ -6,6 +6,31 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + Bit flags returned by wxBookCtrl::HitTest(). + + Notice that wxOSX currently only returns wxBK_HITTEST_ONLABEL or + wxBK_HITTEST_NOWHERE and never the other values, so you should only test + for these two in the code that should be portable under OS X. + */ +enum +{ + /// No tab at the specified point. + wxBK_HITTEST_NOWHERE = 1, + + /// The point is over an icon. + wxBK_HITTEST_ONICON = 2, + + /// The point is over a tab label. + wxBK_HITTEST_ONLABEL = 4, + + /// The point if over a tab item but not over its icon or label. + wxBK_HITTEST_ONITEM = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL, + + /// The point is over the page area. + wxBK_HITTEST_ONPAGE = 8 +}; + /** @class wxBookCtrlBase @@ -27,9 +52,15 @@ @see @ref overview_bookctrl */ -class wxBookCtrlBase : public wxControl +class wxBookCtrlBase : public wxControl, public wxWithImages { public: + enum + { + /// Symbolic constant indicating that no image should be used. + NO_IMAGE = -1 + }; + /** Default ctor. */ @@ -65,33 +96,12 @@ public: */ //@{ - /** - Sets the image list for the page control and takes ownership of the list. - - @see wxImageList, SetImageList() - */ - void AssignImageList(wxImageList* imageList); - - /** - Returns the associated image list. - - @see wxImageList, SetImageList() - */ - wxImageList* GetImageList() const; /** Returns the image index for the given page. */ virtual int GetPageImage(size_t nPage) const = 0; - /** - Sets the image list for the page control. - It does not take ownership of the image list, you must delete it yourself. - - @see wxImageList, AssignImageList() - */ - virtual void SetImageList(wxImageList* imageList); - /** Sets the image index for the given page. @a image is an index into the image list which was set with SetImageList(). @@ -191,19 +201,10 @@ public: @param pt Specifies the point for the hit test. @param flags - Return value for detailed information. One of the following values: - - - - - - - - - - -
wxBK_HITTEST_NOWHEREThere was no tab under this point.
wxBK_HITTEST_ONICONThe point was over an icon (currently wxMSW only).
wxBK_HITTEST_ONLABELThe point was over a label (currently wxMSW only).
wxBK_HITTEST_ONITEMThe point was over an item, but not on the label or icon.
wxBK_HITTEST_ONPAGEThe point was over a currently selected page, not over any tab. - Note that this flag is present only if wxNOT_FOUND is returned.
+ Return more details about the point, see returned value is a + combination of ::wxBK_HITTEST_NOWHERE, ::wxBK_HITTEST_ONICON, + ::wxBK_HITTEST_ONLABEL, ::wxBK_HITTEST_ONITEM, + ::wxBK_HITTEST_ONPAGE. @return Returns the zero-based tab index or @c wxNOT_FOUND if there is no tab at the specified position. @@ -221,6 +222,10 @@ public: /** Adds a new page. + + The page must have the book control itself as the parent and must not + have been added to this control previously. + The call to this function may generate the page changing events. @param page @@ -239,7 +244,7 @@ public: @see InsertPage() */ virtual bool AddPage(wxWindow* page, const wxString& text, - bool select = false, int imageId = wxNOT_FOUND); + bool select = false, int imageId = NO_IMAGE); /** Deletes all pages. @@ -276,7 +281,7 @@ public: wxWindow* page, const wxString& text, bool select = false, - int imageId = wxNOT_FOUND) = 0; + int imageId = NO_IMAGE) = 0; /** Deletes the specified page, without deleting the associated window. @@ -346,7 +351,7 @@ public: @class wxBookCtrlEvent This class represents the events generated by book controls (wxNotebook, - wxListbook, wxChoicebook, wxTreebook). + wxListbook, wxChoicebook, wxTreebook, wxAuiNotebook). The PAGE_CHANGING events are sent before the current page is changed. It allows the program to examine the current page (which can be retrieved @@ -365,7 +370,7 @@ public: @library{wxcore} @category{events,bookctrl} - @see wxNotebook, wxListbook, wxChoicebook, wxTreebook, wxToolbook + @see wxNotebook, wxListbook, wxChoicebook, wxTreebook, wxToolbook, wxAuiNotebook */ class wxBookCtrlEvent : public wxNotifyEvent {