This class represents the events generated by a notebook control: currently,
there are two of them. The PAGE_CHANGING event is sent before the current
page is changed. It allows the program to examine the current page (which
This class represents the events generated by a notebook control: currently,
there are two of them. The PAGE_CHANGING event is sent before the current
page is changed. It allows the program to examine the current page (which
wxNotebookEvent::GetOldSelection) and to veto the page
change by calling wxNotifyEvent::Veto if, for example, the
current values in the controls of the old page are invalid.
wxNotebookEvent::GetOldSelection) and to veto the page
change by calling wxNotifyEvent::Veto if, for example, the
current values in the controls of the old page are invalid.
The second event - PAGE_CHANGED - is sent after the page has been changed and
the program cannot veto it any more, it just informs it about the page change.
The second event - PAGE_CHANGED - is sent after the page has been changed and
the program cannot veto it any more, it just informs it about the page change.
To summarize, if the program is interested in validating the page values
before allowing the user to change it, it should process the PAGE_CHANGING
event, otherwise PAGE_CHANGED is probably enough. In any case, it is probably
unnecessary to process both events at once.
To summarize, if the program is interested in validating the page values
before allowing the user to change it, it should process the PAGE_CHANGING
event, otherwise PAGE_CHANGED is probably enough. In any case, it is probably
unnecessary to process both events at once.
@b NB: under Windows, GetSelection() will return the same value as
GetOldSelection() when called from
@c EVT_NOTEBOOK_PAGE_CHANGING handler and not the page which is going to
be selected. Also note that the values of selection and old selection returned
@b NB: under Windows, GetSelection() will return the same value as
GetOldSelection() when called from
@c EVT_NOTEBOOK_PAGE_CHANGING handler and not the page which is going to
be selected. Also note that the values of selection and old selection returned
wxNotebook::SetSelection shouldn't be trusted
as they are currently inconsistent under different platforms (but in this case
you presumably don't need them anyhow as you already have the corresponding
information).
*/
wxNotebook::SetSelection shouldn't be trusted
as they are currently inconsistent under different platforms (but in this case
you presumably don't need them anyhow as you already have the corresponding
information).
*/
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.
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.
-
- @seealso
- wxBookCtrl, wxNotebookEvent, wxImageList, @ref overview_samplenotebook
+
+ @see wxBookCtrl(), wxNotebookEvent, wxImageList, @ref overview_samplenotebook
-
- @param parent
- The parent window. Must be non-@NULL.
-
- @param id
- The window identifier.
-
- @param pos
- The window position.
-
- @param size
- The window size.
-
- @param style
- The window style. See wxNotebook.
-
- @param name
- The name of the control (used only under Motif).
+
+ @param parent
+ The parent window. Must be non-@NULL.
+ @param id
+ The window identifier.
+ @param pos
+ The window position.
+ @param size
+ The window size.
+ @param style
+ The window style. See wxNotebook.
+ @param name
+ The name of the control (used only under Motif).
- wxNotebook(wxWindow* parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxNotebookNameStr);
+ wxNotebook(wxWindow* parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxNotebookNameStr);
-
- @param page
- Specifies the new page.
-
- @param text
- Specifies the text for the new page.
-
- @param select
- Specifies whether the page should be selected.
-
- @param imageId
- Specifies the optional image index for the new page.
-
+
+ @param page
+ Specifies the new page.
+ @param text
+ Specifies the text for the new page.
+ @param select
+ Specifies whether the page should be selected.
+ @param imageId
+ Specifies the optional image index for the new page.
+
*/
void AssignImageList(wxImageList* imageList);
/**
Changes the selection for the given page, returning the previous selection.
*/
void AssignImageList(wxImageList* imageList);
/**
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 @ref overview_progevent "this topic" for more info.
The call to this function does not generate the page changing events.
This is the only difference with SetSelection().
See @ref overview_progevent "this topic" for more info.
Note that this method may return either the previously or newly selected page
when called from the @c EVT_NOTEBOOK_PAGE_CHANGED handler depending on
the platform and so
wxNotebookEvent::GetSelection should be
used instead in this case.
*/
Note that this method may return either the previously or newly selected page
when called from the @c EVT_NOTEBOOK_PAGE_CHANGED handler depending on
the platform and so
wxNotebookEvent::GetSelection should be
used instead in this case.
*/
-
- @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.
-
+
+ @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.
+
-
- @param index
- Specifies the position for the new page.
-
- @param page
- Specifies the new page.
-
- @param text
- Specifies the text for the new page.
-
- @param select
- Specifies whether the page should be selected.
-
- @param imageId
- Specifies the optional image index for the new page.
-
+
+ @param index
+ Specifies the position for the new page.
+ @param page
+ Specifies the new page.
+ @param text
+ Specifies the text for the new page.
+ @param select
+ Specifies whether the page should be selected.
+ @param imageId
+ Specifies the optional image index for the new page.
+
/**
Sets the image list for the page control. It does not take
ownership of the image list, you must delete it yourself.
/**
Sets the image list for the page control. It does not take
ownership of the image list, you must delete it yourself.
*/
void SetImageList(wxImageList* imageList);
/**
Sets the amount of space around each page's icon and label, in pixels.
*/
void SetImageList(wxImageList* imageList);
/**
Sets the amount of space around each page's icon and label, in pixels.
the image list which was set with SetImageList().
*/
bool SetPageImage(size_t page, int image);
/**
Sets the width and height of the pages.
the image list which was set with SetImageList().
*/
bool SetPageImage(size_t page, int image);
/**
Sets the width and height of the pages.
This function is deprecated and should not be used in new code. Please use the
ChangeSelection() function instead.
This function is deprecated and should not be used in new code. Please use the
ChangeSelection() function instead.