#include <wx/notebook.h>
To use the class, create a wxNotebook object and call wxNotebook::AddPage or wxNotebook::InsertPage, passing a window to be used as the page. Do not explicitly delete the window for a page that is currently managed by wxNotebook.
wxNotebookPage is a typedef for wxWindow.
Styles:
Public Member Functions | |
| wxNotebook () | |
| wxNotebook (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxNotebookNameStr) | |
| virtual | ~wxNotebook () |
| bool | AddPage (wxNotebookPage *page, const wxString &text, bool select=false, int imageId=-1) |
| void | AdvanceSelection (bool forward=true) |
| void | AssignImageList (wxImageList *imageList) |
| virtual int | ChangeSelection (size_t page) |
| bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxNotebookNameStr) |
| virtual bool | DeleteAllPages () |
| bool | DeletePage (size_t page) |
| wxWindow * | GetCurrentPage () const |
| wxImageList * | GetImageList () const |
| wxNotebookPage * | GetPage (size_t page) |
| size_t | GetPageCount () const |
| virtual int | GetPageImage (size_t nPage) const |
| virtual wxString | GetPageText (size_t nPage) const |
| virtual int | GetRowCount () const |
| virtual int | GetSelection () const |
| virtual wxColour | GetThemeBackgroundColour () const |
| virtual int | HitTest (const wxPoint &pt, long *flags=NULL) const |
| virtual bool | InsertPage (size_t index, wxNotebookPage *page, const wxString &text, bool select=false, int imageId=-1) |
| void | OnSelChange (wxBookCtrlEvent &event) |
| bool | RemovePage (size_t page) |
| void | SetImageList (wxImageList *imageList) |
| virtual void | SetPadding (const wxSize &padding) |
| virtual bool | SetPageImage (size_t page, int image) |
| virtual void | SetPageSize (const wxSize &size) |
| virtual bool | SetPageText (size_t page, const wxString &text) |
| virtual int | SetSelection (size_t page) |
| wxNotebook::wxNotebook | ( | ) |
Constructs a notebook control.
| wxNotebook::wxNotebook | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| long | style = 0, |
|||
| const wxString & | name = wxNotebookNameStr | |||
| ) |
Constructs a notebook control. Note that sometimes you can reduce flicker by passing the wxCLIP_CHILDREN window style.
| parent | The parent window. Must be non-NULL. | |
| id | The window identifier. | |
| pos | The window position. | |
| size | The window size. | |
| style | The window style. See wxNotebook. | |
| name | The name of the control (used only under Motif). |
| virtual wxNotebook::~wxNotebook | ( | ) | [virtual] |
Destroys the wxNotebook object.
| bool wxNotebook::AddPage | ( | wxNotebookPage * | page, | |
| const wxString & | text, | |||
| bool | select = false, |
|||
| int | imageId = -1 | |||
| ) |
Adds a new page. The call to this function may generate the page changing events.
| page | Specifies the new page. | |
| text | Specifies the text for the new page. | |
| select | Specifies whether the page should be selected. | |
| imageId | Specifies the optional image index for the new page. |
| void wxNotebook::AdvanceSelection | ( | bool | forward = true |
) |
Cycles through the tabs. The call to this function generates the page changing events.
| void wxNotebook::AssignImageList | ( | wxImageList * | imageList | ) |
Sets the image list for the page control and takes ownership of the list.
| virtual int wxNotebook::ChangeSelection | ( | size_t | page | ) | [virtual] |
Changes the selection for 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 User Generated Events for more infomation.
| bool wxNotebook::Create | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| long | style = 0, |
|||
| const wxString & | name = wxNotebookNameStr | |||
| ) |
Creates a notebook control. See wxNotebook() for a description of the parameters.
| virtual bool wxNotebook::DeleteAllPages | ( | ) | [virtual] |
Deletes all pages.
| bool wxNotebook::DeletePage | ( | size_t | page | ) |
Deletes the specified page, and the associated window. The call to this function generates the page changing events.
| wxWindow* wxNotebook::GetCurrentPage | ( | ) | const |
Returns the currently selected notebook page or NULL.
| wxImageList* wxNotebook::GetImageList | ( | ) | const |
| wxNotebookPage* wxNotebook::GetPage | ( | size_t | page | ) |
Returns the window at the given page position.
| size_t wxNotebook::GetPageCount | ( | ) | const |
Returns the number of pages in the notebook control.
| virtual int wxNotebook::GetPageImage | ( | size_t | nPage | ) | const [virtual] |
Returns the image index for the given page.
| virtual wxString wxNotebook::GetPageText | ( | size_t | nPage | ) | const [virtual] |
Returns the string for the given page.
| virtual int wxNotebook::GetRowCount | ( | ) | const [virtual] |
Returns the number of rows in the notebook control.
| virtual int wxNotebook::GetSelection | ( | ) | const [virtual] |
Returns the currently selected page, or -1 if none was selected. Note that this method may return either the previously or newly selected page when called from the EVT_NOTEBOOK_PAGE_CHANGED handler depending on the platform and so wxBookCtrlEvent::GetSelection should be used instead in this case.
| virtual wxColour wxNotebook::GetThemeBackgroundColour | ( | ) | const [virtual] |
If running under Windows and themes are enabled for the application, this function returns a suitable colour for painting the background of a notebook page, and can be passed to SetBackgroundColour. Otherwise, an uninitialised colour will be returned.
| virtual int wxNotebook::HitTest | ( | const wxPoint & | pt, | |
| long * | flags = NULL | |||
| ) | const [virtual] |
Returns the index of the tab at the specified position or wxNOT_FOUND if none. If flags parameter is non-NULL, the position of the point inside the tab is returned as well.
| pt | Specifies the point for the hit test. | |||||||||||
| flags | Return value for detailed information. One of the following values:
|
| virtual bool wxNotebook::InsertPage | ( | size_t | index, | |
| wxNotebookPage * | page, | |||
| const wxString & | text, | |||
| bool | select = false, |
|||
| int | imageId = -1 | |||
| ) | [virtual] |
Inserts a new page at the specified position.
| index | Specifies the position for the new page. | |
| page | Specifies the new page. | |
| text | Specifies the text for the new page. | |
| select | Specifies whether the page should be selected. | |
| imageId | Specifies the optional image index for the new page. |
| void wxNotebook::OnSelChange | ( | wxBookCtrlEvent & | event | ) |
| bool wxNotebook::RemovePage | ( | size_t | page | ) |
Deletes the specified page, without deleting the associated window.
| void wxNotebook::SetImageList | ( | wxImageList * | imageList | ) |
Sets the image list for the page control. It does not take ownership of the image list, you must delete it yourself.
| virtual void wxNotebook::SetPadding | ( | const wxSize & | padding | ) | [virtual] |
Sets the amount of space around each page's icon and label, in pixels.
| virtual bool wxNotebook::SetPageImage | ( | size_t | page, | |
| int | image | |||
| ) | [virtual] |
Sets the image index for the given page. image is an index into the image list which was set with SetImageList().
| virtual void wxNotebook::SetPageSize | ( | const wxSize & | size | ) | [virtual] |
Sets the width and height of the pages.
| virtual bool wxNotebook::SetPageText | ( | size_t | page, | |
| const wxString & | text | |||
| ) | [virtual] |
Sets the text for the given page.
| virtual int wxNotebook::SetSelection | ( | size_t | page | ) | [virtual] |
Sets the selection for the given page, returning the previous selection. The call to this function generates the page changing events. This function is deprecated and should not be used in new code. Please use the ChangeSelection() function instead.
|
[ top ] |