2000-07-15 15:51:35 -04:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
%% Name: wizard.tex
|
|
|
|
%% Purpose: wxWizard class documentation
|
|
|
|
%% Author: Vadim Zeitlin
|
2003-07-20 16:48:52 -04:00
|
|
|
%% Modified by: Robert Vazan (sizers)
|
2000-07-15 15:51:35 -04:00
|
|
|
%% Created: 02.04.00
|
|
|
|
%% RCS-ID: $Id$
|
|
|
|
%% Copyright: (c) Vadim Zeitlin
|
2005-02-22 10:09:56 -05:00
|
|
|
%% License: wxWindows license
|
2000-07-15 15:51:35 -04:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\section{\class{wxWizard}}\label{wxwizard}
|
|
|
|
|
|
|
|
wxWizard is the central class for implementing `wizard-like' dialogs. These
|
2004-10-14 06:29:58 -04:00
|
|
|
dialogs are mostly familiar to Windows users and are nothing other than a
|
|
|
|
sequence of `pages', each displayed inside a dialog which has the
|
|
|
|
buttons to navigate to the next (and previous) pages.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
The wizards are typically used to decompose a complex dialog into several
|
|
|
|
simple steps and are mainly useful to the novice users, hence it is important
|
|
|
|
to keep them as simple as possible.
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
To show a wizard dialog, you must first create an instance of the wxWizard class
|
|
|
|
using either the non-default constructor or a default one followed by call to the
|
2002-08-27 05:17:36 -04:00
|
|
|
\helpref{Create}{wxwizardcreate} function. Then you should add all pages you
|
|
|
|
want the wizard to show and call \helpref{RunWizard}{wxwizardrunwizard}.
|
2006-02-09 10:35:48 -05:00
|
|
|
Finally, don't forget to call {\tt wizard->Destroy()}, otherwise your application will hang on exit due to an undestroyed window.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxDialog}{wxdialog}\\
|
|
|
|
\helpref{wxPanel}{wxpanel}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/wizard.h>
|
|
|
|
|
|
|
|
\wxheading{Event table macros}
|
|
|
|
|
|
|
|
To process input from a wizard dialog, use these event handler macros to
|
|
|
|
direct input to member functions that take a
|
|
|
|
\helpref{wxWizardEvent}{wxwizardevent} argument. For some events,
|
|
|
|
\helpref{Veto()}{wxnotifyeventveto} can be called to prevent the event from
|
|
|
|
happening.
|
|
|
|
|
|
|
|
\twocolwidtha{7cm}
|
|
|
|
\begin{twocollist}\itemsep=2pt
|
2004-10-14 06:29:58 -04:00
|
|
|
\twocolitem{{\bf EVT\_WIZARD\_PAGE\_CHANGED(id, func)}}{The page has just been
|
|
|
|
changed (this event cannot be vetoed).}
|
2000-07-15 15:51:35 -04:00
|
|
|
\twocolitem{{\bf EVT\_WIZARD\_PAGE\_CHANGING(id, func)}}{The page is being
|
|
|
|
changed (this event can be vetoed).}
|
|
|
|
\twocolitem{{\bf EVT\_WIZARD\_CANCEL(id, func)}}{The user attempted to cancel
|
|
|
|
the wizard (this event may also be vetoed).}
|
2001-11-02 12:29:38 -05:00
|
|
|
\twocolitem{{\bf EVT\_WIZARD\_HELP(id, func)}}{The wizard help button was pressed.}
|
2002-12-09 04:46:16 -05:00
|
|
|
\twocolitem{{\bf EVT\_WIZARD\_FINISHED(id, func)}}{The wizard finished button was pressed.}
|
2004-02-21 20:16:32 -05:00
|
|
|
\end{twocollist}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2001-08-17 05:38:53 -04:00
|
|
|
\wxheading{Extended styles}
|
|
|
|
|
|
|
|
Use the \helpref{wxWindow::SetExtraStyle}{wxwindowsetextrastyle} function to set the following
|
|
|
|
style. You will need to use two-step construction (use the default constructor, call {\bf SetExtraStyle}, then call {\bf Create}).
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}%
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{\windowstyle{wxWIZARD\_EX\_HELPBUTTON}}{Shows a Help button using wxID\_HELP.}
|
|
|
|
\end{twocollist}
|
|
|
|
|
|
|
|
See also \helpref{wxDialog}{wxdialog} for other extended styles.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxWizardEvent}{wxwizardevent}, \helpref{wxWizardPage}{wxwizardpage}, \helpref{wxWizard sample}{samplewizard}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2001-08-17 05:38:53 -04:00
|
|
|
\membersection{wxWizard::wxWizard}\label{wxwizardctor}
|
|
|
|
|
|
|
|
\func{}{wxWizard}{\void}
|
|
|
|
|
2002-08-27 05:17:36 -04:00
|
|
|
Default constructor. Use this if you wish to derive from wxWizard and then call
|
|
|
|
\helpref{Create}{wxwizardcreate}, for example if you wish to set an extra style
|
|
|
|
with \helpref{wxWindow::SetExtraStyle}{wxwindowsetextrastyle} between the two
|
|
|
|
calls.
|
2001-08-17 05:38:53 -04:00
|
|
|
|
2004-01-26 05:40:53 -05:00
|
|
|
\func{}{wxWizard}{\param{wxWindow* }{parent}, \param{int }{id = -1}, \param{const wxString\& }{title = wxEmptyString}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{long }{style = wxDEFAULT\_DIALOG\_STYLE}}
|
2001-08-17 05:38:53 -04:00
|
|
|
|
2002-08-27 05:17:36 -04:00
|
|
|
Constructor which really creates the wizard -- if you use this constructor, you
|
|
|
|
shouldn't call \helpref{Create}{wxwizardcreate}.
|
2001-08-17 05:38:53 -04:00
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
Notice that unlike almost all other wxWidgets classes, there is no {\it size}
|
2004-10-14 06:29:58 -04:00
|
|
|
parameter in the wxWizard constructor because the wizard will have a predefined
|
2001-08-17 05:38:53 -04:00
|
|
|
default size by default. If you want to change this, you should use the
|
2003-07-20 16:48:52 -04:00
|
|
|
\helpref{GetPageAreaSizer}{wxwizardgetpageareasizer} function.
|
2001-08-17 05:38:53 -04:00
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{The parent window, may be NULL.}
|
|
|
|
|
|
|
|
\docparam{id}{The id of the dialog, will usually be just $-1$.}
|
|
|
|
|
|
|
|
\docparam{title}{The title of the dialog.}
|
|
|
|
|
|
|
|
\docparam{bitmap}{The default bitmap used in the left side of the wizard. See
|
|
|
|
also \helpref{GetBitmap}{wxwizardpagegetbitmap}.}
|
|
|
|
|
|
|
|
\docparam{pos}{The position of the dialog, it will be centered on the screen
|
|
|
|
by default.}
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
\docparam{style}{Window style is passed to wxDialog.}
|
|
|
|
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\membersection{wxWizard::Create}\label{wxwizardcreate}
|
|
|
|
|
2004-01-26 05:40:53 -05:00
|
|
|
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{int }{id = -1}, \param{const wxString\& }{title = wxEmptyString}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{long }{style = wxDEFAULT\_DIALOG\_STYLE}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2002-08-27 05:17:36 -04:00
|
|
|
Creates the wizard dialog. Must be called if the default constructor had been
|
|
|
|
used to create the object.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
Notice that unlike almost all other wxWidgets classes, there is no {\it size}
|
2004-10-14 06:29:58 -04:00
|
|
|
parameter in the wxWizard constructor because the wizard will have a predefined
|
2000-07-15 15:51:35 -04:00
|
|
|
default size by default. If you want to change this, you should use the
|
2003-07-20 16:48:52 -04:00
|
|
|
\helpref{GetPageAreaSizer}{wxwizardgetpageareasizer} function.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{The parent window, may be NULL.}
|
|
|
|
|
|
|
|
\docparam{id}{The id of the dialog, will usually be just $-1$.}
|
|
|
|
|
|
|
|
\docparam{title}{The title of the dialog.}
|
|
|
|
|
|
|
|
\docparam{bitmap}{The default bitmap used in the left side of the wizard. See
|
|
|
|
also \helpref{GetBitmap}{wxwizardpagegetbitmap}.}
|
|
|
|
|
|
|
|
\docparam{pos}{The position of the dialog, it will be centered on the screen
|
|
|
|
by default.}
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
\docparam{style}{Window style is passed to wxDialog.}
|
|
|
|
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\membersection{wxWizard::FitToPage}\label{wxwizardfittopage}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-05-03 09:45:00 -04:00
|
|
|
\func{void}{FitToPage}{\param{const wxWizardPage* }{firstPage}}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
This method is obsolete, use
|
|
|
|
\helpref{GetPageAreaSizer}{wxwizardgetpageareasizer} instead.
|
|
|
|
|
2002-05-26 18:41:35 -04:00
|
|
|
Sets the page size to be big enough for all the pages accessible via the
|
|
|
|
given {\it firstPage}, i.e. this page, its next page and so on.
|
|
|
|
|
|
|
|
This method may be called more than once and it will only change the page size
|
|
|
|
if the size required by the new page is bigger than the previously set one.
|
2004-10-14 06:29:58 -04:00
|
|
|
This is useful if the decision about which pages to show is taken during
|
|
|
|
run-time, as in this case, the wizard won't be able to get to all pages starting
|
2002-05-26 18:41:35 -04:00
|
|
|
from a single one and you should call {\it Fit} separately for the others.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\membersection{wxWizard::GetCurrentPage}\label{wxwizardgetcurrentpage}
|
|
|
|
|
|
|
|
\constfunc{wxWizardPage*}{GetCurrentPage}{\void}
|
|
|
|
|
|
|
|
Get the current page while the wizard is running. {\tt NULL} is returned if
|
|
|
|
\helpref{RunWizard()}{wxwizardrunwizard} is not being executed now.
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
|
|
|
\membersection{wxWizard::GetPageAreaSizer}\label{wxwizardgetpageareasizer}
|
|
|
|
|
|
|
|
\constfunc{virtual wxSizer*}{GetPageAreaSizer}{\void}
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
Returns pointer to page area sizer. The wizard is laid out using sizers and
|
|
|
|
the page area sizer is the place-holder for the pages. All pages are resized before
|
2003-07-20 16:48:52 -04:00
|
|
|
being shown to match the wizard page area.
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
Page area sizer has a minimal size that is the maximum of several values. First,
|
2003-07-20 16:48:52 -04:00
|
|
|
all pages (or other objects) added to the sizer. Second, all pages reachable
|
|
|
|
by repeatedly applying
|
|
|
|
\helpref{wxWizardPage::GetNext}{wxwizardpagegetnext} to
|
|
|
|
any page inserted into the sizer. Third,
|
2004-10-14 06:29:58 -04:00
|
|
|
the minimal size specified using \helpref{SetPageSize}{wxwizardsetpagesize} and
|
2003-07-20 16:48:52 -04:00
|
|
|
\helpref{FitToPage}{wxwizardfittopage}. Fourth, the total wizard height may
|
2004-10-22 15:15:35 -04:00
|
|
|
be increased to accommodate the bitmap height. Fifth and finally, wizards are
|
2004-10-14 06:29:58 -04:00
|
|
|
never smaller than some built-in minimal size to avoid wizards that are too small.
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
The caller can use \helpref{wxSizer::SetMinSize}{wxsizersetminsize} to enlarge it
|
|
|
|
beyond the minimal size. If {\tt wxRESIZE\_BORDER} was passed to constructor, user
|
|
|
|
can resize wizard and consequently the page area (but not make it smaller than the
|
2003-07-20 16:48:52 -04:00
|
|
|
minimal size).
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
It is recommended to add the first page to the page area sizer. For simple wizards,
|
|
|
|
this will enlarge the wizard to fit the biggest page. For non-linear wizards,
|
|
|
|
the first page of every separate chain should be added. Caller-specified size
|
2003-07-20 16:48:52 -04:00
|
|
|
can be accomplished using \helpref{wxSizer::SetMinSize}{wxsizersetminsize}.
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
Adding pages to the page area sizer affects the default border width around page
|
2003-07-20 16:48:52 -04:00
|
|
|
area that can be altered with \helpref{SetBorder}{wxwizardsetborder}.
|
|
|
|
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\membersection{wxWizard::GetPageSize}\label{wxwizardgetpagesize}
|
|
|
|
|
|
|
|
\constfunc{wxSize}{GetPageSize}{\void}
|
|
|
|
|
|
|
|
Returns the size available for the pages.
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\membersection{wxWizard::HasNextPage}\label{wxwizardhasnextpage}
|
|
|
|
|
|
|
|
\func{virtual bool}{HasNextPage}{\param{wxWizardPage *}{page}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Return {\tt true} if this page is not the last one in the wizard. The base
|
2002-12-04 09:11:26 -05:00
|
|
|
class version implements this by calling
|
|
|
|
\helpref{page->GetNext}{wxwizardpagegetnext} but this could be undesirable if,
|
|
|
|
for example, the pages are created on demand only.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{HasPrevPage}{wxwizardhasprevpage}
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\membersection{wxWizard::HasPrevPage}\label{wxwizardhasprevpage}
|
|
|
|
|
|
|
|
\func{virtual bool}{HasPrevPage}{\param{wxWizardPage *}{page}}
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
Returns {\tt true} if this page is not the last one in the wizard. The base
|
2002-12-04 09:11:26 -05:00
|
|
|
class version implements this by calling
|
|
|
|
\helpref{page->GetPrev}{wxwizardpagegetprev} but this could be undesirable if,
|
|
|
|
for example, the pages are created on demand only.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{HasNextPage}{wxwizardhasnextpage}
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2002-05-26 18:41:35 -04:00
|
|
|
\membersection{wxWizard::RunWizard}\label{wxwizardrunwizard}
|
|
|
|
|
|
|
|
\func{bool}{RunWizard}{\param{wxWizardPage* }{firstPage}}
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
Executes the wizard starting from the given page, returning {\tt true} if it was
|
2003-01-17 19:16:34 -05:00
|
|
|
successfully finished or {\tt false} if user cancelled it. The {\it firstPage}
|
2002-05-26 18:41:35 -04:00
|
|
|
can not be {\tt NULL}.
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\membersection{wxWizard::SetPageSize}\label{wxwizardsetpagesize}
|
|
|
|
|
|
|
|
\func{void}{SetPageSize}{\param{const wxSize\& }{sizePage}}
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
This method is obsolete, use
|
|
|
|
\helpref{GetPageAreaSizer}{wxwizardgetpageareasizer} instead.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Sets the minimal size to be made available for the wizard pages. The wizard
|
|
|
|
will take into account the size of the bitmap (if any) itself. Also, the
|
|
|
|
wizard will never be smaller than the default size.
|
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
The recommended way to use this function is to lay out all wizard pages using
|
2000-07-15 15:51:35 -04:00
|
|
|
the sizers (even though the wizard is not resizeable) and then use
|
|
|
|
\helpref{wxSizer::CalcMin}{wxsizercalcmin} in a loop to calculate the maximum
|
|
|
|
of minimal sizes of the pages and pass it to SetPageSize().
|
|
|
|
|
2003-07-20 16:48:52 -04:00
|
|
|
|
|
|
|
\membersection{wxWizard::SetBorder}\label{wxwizardsetborder}
|
|
|
|
|
|
|
|
\func{void}{SetBorder}{\param{int }{border}}
|
|
|
|
|
|
|
|
Sets width of border around page area. Default is zero. For backward
|
|
|
|
compatibility, if there are no pages in
|
2004-10-14 06:29:58 -04:00
|
|
|
\helpref{GetPageAreaSizer}{wxwizardgetpageareasizer}, the default is $5$ pixels.
|
2003-07-20 16:48:52 -04:00
|
|
|
|
2004-10-14 06:29:58 -04:00
|
|
|
If there is a five point border around all controls in a page and the border around
|
|
|
|
page area is left as zero, a five point white space along all dialog borders
|
|
|
|
will be added to the control border in order to space page controls ten points from the dialog
|
2003-07-20 16:48:52 -04:00
|
|
|
border and non-page controls.
|
|
|
|
|