X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8231db24d2fc6faf6adee9aec2e89a6d60813a7..72c5855f5c9e6b5747dc9571d64e217eff26561d:/interface/wx/bookctrl.h diff --git a/interface/wx/bookctrl.h b/interface/wx/bookctrl.h index f62f142eea..27f241600f 100644 --- a/interface/wx/bookctrl.h +++ b/interface/wx/bookctrl.h @@ -3,9 +3,45 @@ // Purpose: interface of wxBookCtrlBase // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// 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 +}; + +/** + wxBookCtrl flags (common for wxNotebook, wxListbook, wxChoicebook, wxTreebook) +*/ +#define wxBK_DEFAULT 0x0000 +#define wxBK_TOP 0x0010 +#define wxBK_BOTTOM 0x0020 +#define wxBK_LEFT 0x0040 +#define wxBK_RIGHT 0x0080 +#define wxBK_ALIGN_MASK (wxBK_TOP | wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT) + + /** @class wxBookCtrlBase @@ -23,13 +59,19 @@ This is a pure virtual class so you cannot allocate it directly. @library{wxcore} - @category{miscwnd} + @category{bookctrl} @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,38 +107,17 @@ 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; - - /** - 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); + virtual int GetPageImage(size_t nPage) const = 0; /** Sets the image index for the given page. @a image is an index into the image list which was set with SetImageList(). */ - virtual bool SetPageImage(size_t page, int image); + virtual bool SetPageImage(size_t page, int image) = 0; //@} @@ -146,16 +167,15 @@ public: wxWindow* GetCurrentPage() const; /** - Sets the selection for the given page, returning the previous selection. - The call to this function generates the page changing events. + Sets the selection to the given page, returning the previous selection. - @deprecated - This function is deprecated and should not be used in new code. - Please use the ChangeSelection() function instead. + Notice that the call to this function generates the page changing + events, use the ChangeSelection() function if you don't want these + events to be generated. @see GetSelection() */ - virtual int SetSelection(size_t page); + virtual int SetSelection(size_t page) = 0; /** Cycles through the tabs. @@ -164,13 +184,25 @@ public: void AdvanceSelection(bool forward = true); /** - Changes the selection for the given page, returning the previous selection. + Changes the selection to the given page, returning the previous selection. - The call to this function does NOT generate the page changing events. - This is the only difference with SetSelection(). - See @ref overview_eventhandling_prog for more infomation. + This function behaves as SetSelection() but does @em not generate the + page changing events. + + See @ref overview_events_prog for more information. + */ + virtual int ChangeSelection(size_t page) = 0; + + /** + Returns the index of the specified tab window or @c wxNOT_FOUND + if not found. + + @param page One of the control pages. + @return The zero-based tab index or @c wxNOT_FOUND if not found. + + @since 2.9.5 */ - virtual int ChangeSelection(size_t page); + int FindPage(const wxWindow* page) const; //@} @@ -191,19 +223,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_NOWHERE | -There was no tab under this point. |
wxBK_HITTEST_ONICON | -The point was over an icon (currently wxMSW only). |
wxBK_HITTEST_ONLABEL | -The point was over a label (currently wxMSW only). |
wxBK_HITTEST_ONITEM | -The point was over an item, but not on the label or icon. |
wxBK_HITTEST_ONPAGE | -The point was over a currently selected page, not over any tab. - Note that this flag is present only if wxNOT_FOUND is returned. |