wxWidgets/docs/latex/wx/wizard.tex
Bryan Petty f6bcfd974e merged 2.2 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-07-15 19:51:35 +00:00

125 lines
4.7 KiB
TeX

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: wizard.tex
%% Purpose: wxWizard class documentation
%% Author: Vadim Zeitlin
%% Modified by:
%% Created: 02.04.00
%% RCS-ID: $Id$
%% Copyright: (c) Vadim Zeitlin
%% License: wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxWizard}}\label{wxwizard}
wxWizard is the central class for implementing `wizard-like' dialogs. These
dialogs are mostly familiar to Windows users and are nothing else but a
sequence of `pages' each of them displayed inside a dialog which has the
buttons to pas to the next (and previous) pages.
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.
To show a wizard dialog, you must first create an object of wxWizard class
using \helpref{Create}{wxwizardcreate} function. Then you should add all pages
you want the wizard to show and call \helpref{RunWizard}{wxwizardrunwizard}.
Finally, don't forget to call {\tt wizard->Destroy()}.
\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
\twocolitem{{\bf EVT\_WIZARD\_PAGE\_CHANGED(id, func)}}{The page has been just
changed (this event can not be vetoed).}
\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).}
\end{twocollist}%
\wxheading{See also}
\helpref{wxWizardEvent}{wxwizardevent}, \helpref{wxWizardPage}{wxwizardpage}, \helpref{wxWizard sample}{samplewizard}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxWizard::Create}\label{wxwizardcreate}
\func{static wxWizard*}{Create}{\param{wxWindow* }{parent}, \param{int }{id = -1}, \param{const wxString\& }{title = wxEmptyString}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}, \param{const wxPoint\& }{pos = wxDefaultPosition}}
Creates the wizard dialog. The returned pointer should not be deleted
directly, you should rather call {\tt Destroy()} on it and wxWindows will
delete it itself.
Notice that unlike almost all other wxWindows classes, there is no {\it size}
parameter in wxWizard constructor because the wizard will have a predefined
default size by default. If you want to change this, you should use the
\helpref{SetPageSize}{wxwizardsetpagesize} function.
\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.}
\membersection{wxWizard::RunWizard}\label{wxwizardrunwizard}
\func{bool}{RunWizard}{\param{wxWizardPage* }{firstPage}}
Executes the wizard starting from the given page, returns {\tt TRUE} if it was
successfully finished or {\tt FALSE} if user cancelled it. The {\it firstPage}
can not be {\tt NULL}.
\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.
\membersection{wxWizard::GetPageSize}\label{wxwizardgetpagesize}
\constfunc{wxSize}{GetPageSize}{\void}
Returns the size available for the pages.
\membersection{wxWizard::SetPageSize}\label{wxwizardsetpagesize}
\func{void}{SetPageSize}{\param{const wxSize\& }{sizePage}}
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.
The recommended way to use this function is to layout all wizard pages using
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().