X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..f2e4cf3dc689b4e9d362637a9f9347fb49fd18d4:/interface/wx/bookctrl.h?ds=sidebyside diff --git a/interface/wx/bookctrl.h b/interface/wx/bookctrl.h index 3665a5e87c..6fd8c596a0 100644 --- a/interface/wx/bookctrl.h +++ b/interface/wx/bookctrl.h @@ -3,22 +3,403 @@ // Purpose: interface of wxBookCtrlBase // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxBookCtrlBase - @todo Document this class. + A book control is a convenient way of displaying multiple pages of information, + displayed one page at a time. wxWidgets has five variants of this control: + + @li wxChoicebook: controlled by a wxChoice + @li wxListbook: controlled by a wxListCtrl + @li wxNotebook: uses a row of tabs + @li wxTreebook: controlled by a wxTreeCtrl + @li wxToolbook: controlled by a wxToolBar + + This abstract class is the parent of all these book controls, and provides + their basic interface. + 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 { public: + /** + Default ctor. + */ + wxBookCtrlBase(); + + /** + Constructs the book control with the given parameters. + See Create() for two-step construction. + */ + wxBookCtrlBase(wxWindow *parent, + wxWindowID winid, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxEmptyString); + + /** + Constructs the book control with the given parameters. + */ + bool Create(wxWindow *parent, + wxWindowID winid, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxEmptyString); + + + /** + @name Image list functions + + Each page may have an attached image. + The functions of this group manipulate that image. + */ + //@{ + + /** + 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(). + */ + virtual bool SetPageImage(size_t page, int image) = 0; + + //@} + + + + /** + @name Page text functions + + Each page has a text string attached. + The functions of this group manipulate that text. + */ + //@{ + + /** + Returns the string for the given page. + */ + virtual wxString GetPageText(size_t nPage) const = 0; + + /** + Sets the text for the given page. + */ + virtual bool SetPageText(size_t page, const wxString& text) = 0; + //@} + + + + /** + @name Selection functions + + The functions of this group manipulate the selection. + */ + //@{ + + /** + Returns the currently selected page, or @c wxNOT_FOUND if none was selected. + + Note that this method may return either the previously or newly + selected page when called from the @c EVT_BOOKCTRL_PAGE_CHANGED handler + depending on the platform and so wxBookCtrlEvent::GetSelection should be + used instead in this case. + */ + virtual int GetSelection() const = 0; + + /** + Returns the currently selected page or @NULL. + */ + wxWindow* GetCurrentPage() const; + + /** + Sets the selection for the given page, returning the previous selection. + + 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) = 0; + + /** + Cycles through the tabs. + The call to this function generates the page changing events. + */ + void AdvanceSelection(bool forward = true); + + /** + Changes the selection for the given page, returning the previous selection. + + 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; + + //@} + + + + /** + Sets the width and height of the pages. + + @note This method is currently not implemented for wxGTK. + */ + virtual void SetPageSize(const wxSize& size); + + /** + Returns the index of the tab at the specified position or @c wxNOT_FOUND + if none. If @a flags parameter is non-@NULL, the position of the point + inside the tab is returned as well. + + @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. |