2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wizard.h
|
2008-09-27 06:27:44 -04:00
|
|
|
// Purpose: interface of wxWizardPage, wxWizardEvent,
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-06-08 01:11:21 -04:00
|
|
|
|
|
|
|
// Extended style to specify a help button
|
|
|
|
#define wxWIZARD_EX_HELPBUTTON 0x00000010
|
|
|
|
|
|
|
|
// Bitmap placement flags
|
|
|
|
#define wxWIZARD_VALIGN_TOP 0x01
|
|
|
|
#define wxWIZARD_VALIGN_CENTRE 0x02
|
|
|
|
#define wxWIZARD_VALIGN_BOTTOM 0x04
|
|
|
|
#define wxWIZARD_HALIGN_LEFT 0x08
|
|
|
|
#define wxWIZARD_HALIGN_CENTRE 0x10
|
|
|
|
#define wxWIZARD_HALIGN_RIGHT 0x20
|
|
|
|
#define wxWIZARD_TILE 0x40
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxWizardPage
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
wxWizardPage is one of the screens in wxWizard: it must know what are the
|
|
|
|
following and preceding pages (which may be @NULL for the first/last page).
|
|
|
|
Except for this extra knowledge, wxWizardPage is just a
|
2008-03-08 08:52:38 -05:00
|
|
|
panel, so the controls may be placed directly on it in the usual way.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This class allows the programmer to decide the order of pages in the wizard
|
2008-09-27 06:27:44 -04:00
|
|
|
dynamically (during run-time) and so provides maximal flexibility.
|
|
|
|
Usually, however, the order of pages is known in advance in which case
|
|
|
|
wxWizardPageSimple class is enough and it is simpler to use.
|
|
|
|
|
|
|
|
|
|
|
|
@section wizardpage_virtuals Virtual functions to override
|
|
|
|
|
|
|
|
To use this class, you must override wxWizardPage::GetPrev() and
|
|
|
|
wxWizardPage::GetNext() pure virtual functions (or you may use
|
|
|
|
wxWizardPageSimple instead).
|
|
|
|
wxWizardPage::GetBitmap() can also be overridden, but this should be very
|
|
|
|
rarely needed.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
@see wxWizard, @ref page_samples_wizard
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxWizardPage : public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
2012-06-08 01:11:21 -04:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxWizardPage();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor accepts an optional bitmap which will be used for this page
|
|
|
|
instead of the default one for this wizard (note that all bitmaps used should
|
|
|
|
be of the same size). Notice that no other parameters are needed because the
|
|
|
|
wizard will resize and reposition the page anyhow.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
The parent wizard
|
2008-03-08 09:43:31 -05:00
|
|
|
@param bitmap
|
2008-03-09 08:33:59 -04:00
|
|
|
The page-specific bitmap if different from the global one
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxWizardPage(wxWizard* parent,
|
|
|
|
const wxBitmap& bitmap = wxNullBitmap);
|
|
|
|
|
2012-06-08 01:11:21 -04:00
|
|
|
/**
|
|
|
|
Creates the wizard page.
|
|
|
|
Must be called if the default constructor had been used to create the object.
|
|
|
|
|
|
|
|
@param parent
|
|
|
|
The parent wizard
|
|
|
|
@param bitmap
|
|
|
|
The page-specific bitmap if different from the global one
|
|
|
|
*/
|
|
|
|
bool Create(wxWizard *parent,
|
|
|
|
const wxBitmap& bitmap = wxNullBitmap);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
This method is called by wxWizard to get the bitmap to display alongside the page.
|
|
|
|
By default, @c m_bitmap member variable which was set in the
|
|
|
|
@ref wxWizardPage() constructor.
|
|
|
|
|
|
|
|
If the bitmap was not explicitly set (i.e. if ::wxNullBitmap is returned),
|
2008-03-08 08:52:38 -05:00
|
|
|
the default bitmap for the wizard should be used.
|
2008-09-27 06:27:44 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The only cases when you would want to override this function is if the page
|
|
|
|
bitmap depends dynamically on the user choices, i.e. almost never.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxBitmap GetBitmap() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the page which should be shown when the user chooses the @c "Next"
|
2008-09-27 06:27:44 -04:00
|
|
|
button: if @NULL is returned, this button will be disabled.
|
|
|
|
The last page of the wizard will usually return @NULL from here, but
|
|
|
|
the others will not.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetPrev()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 16:26:28 -04:00
|
|
|
virtual wxWizardPage* GetNext() const = 0;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the page which should be shown when the user chooses the @c "Back"
|
2008-09-27 06:27:44 -04:00
|
|
|
button: if @NULL is returned, this button will be disabled.
|
|
|
|
The first page of the wizard will usually return @NULL from here, but
|
|
|
|
the others will not.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetNext()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 16:26:28 -04:00
|
|
|
virtual wxWizardPage* GetPrev() const = 0;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxWizardEvent
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
wxWizardEvent class represents an event generated by the wxWizard: this event
|
|
|
|
is first sent to the page itself and, if not processed there, goes up the
|
|
|
|
window hierarchy as usual.
|
|
|
|
|
|
|
|
@beginEventTable{wxWizardEvent}
|
|
|
|
@event{EVT_WIZARD_PAGE_CHANGED(id, func)}
|
2011-03-22 10:17:38 -04:00
|
|
|
The page has been just changed (this event cannot be vetoed).
|
2008-09-27 06:27:44 -04:00
|
|
|
@event{EVT_WIZARD_PAGE_CHANGING(id, func)}
|
|
|
|
The page is being changed (this event can be vetoed).
|
2012-02-20 06:38:52 -05:00
|
|
|
@event{EVT_WIZARD_BEFORE_PAGE_CHANGED(id, func)}
|
|
|
|
Called after Next is clicked but before GetNext is called. Unlike EVT_WIZARD_CHANGING,
|
|
|
|
the handler for this function can change state that might affect the return value of
|
|
|
|
GetNext. This event can be vetoed.
|
2010-01-25 13:48:21 -05:00
|
|
|
@event{EVT_WIZARD_PAGE_SHOWN(id, func)}
|
|
|
|
The page was shown and laid out (this event cannot be vetoed).
|
2008-09-27 06:27:44 -04:00
|
|
|
@event{EVT_WIZARD_CANCEL(id, func)}
|
|
|
|
The user attempted to cancel the wizard (this event may also be vetoed).
|
|
|
|
@event{EVT_WIZARD_HELP(id, func)}
|
|
|
|
The wizard help button was pressed.
|
|
|
|
@event{EVT_WIZARD_FINISHED(id, func)}
|
|
|
|
The wizard finished button was pressed.
|
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{events}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
@see wxWizard, @ref page_samples_wizard
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxWizardEvent : public wxNotifyEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Constructor.
|
|
|
|
|
|
|
|
It is not normally used by the user code as the objects of this
|
2008-03-08 08:52:38 -05:00
|
|
|
type are constructed by wxWizard.
|
|
|
|
*/
|
2008-09-27 16:26:28 -04:00
|
|
|
wxWizardEvent(wxEventType type = wxEVT_NULL, int id = wxID_ANY,
|
|
|
|
bool direction = true, wxWizardPage* page = 0);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Return the direction in which the page is changing: for
|
|
|
|
@c EVT_WIZARD_PAGE_CHANGING, return @true if we're going forward or
|
|
|
|
@false otherwise and for @c EVT_WIZARD_PAGE_CHANGED return @true if we
|
|
|
|
came from the previous page and @false if we returned from the next one.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool GetDirection() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Returns the wxWizardPage which was active when this event was generated.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWizardPage* GetPage() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-06-08 01:11:21 -04:00
|
|
|
wxEventType wxEVT_WIZARD_PAGE_CHANGED;
|
|
|
|
wxEventType wxEVT_WIZARD_PAGE_CHANGING;
|
|
|
|
wxEventType wxEVT_WIZARD_CANCEL;
|
|
|
|
wxEventType wxEVT_WIZARD_HELP;
|
|
|
|
wxEventType wxEVT_WIZARD_FINISHED;
|
|
|
|
wxEventType wxEVT_WIZARD_PAGE_SHOWN;
|
|
|
|
wxEventType wxEVT_WIZARD_BEFORE_PAGE_CHANGED;
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxWizardPageSimple
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
wxWizardPageSimple is the simplest possible wxWizardPage implementation:
|
|
|
|
it just returns the pointers given to its constructor from wxWizardPage::GetNext()
|
|
|
|
and wxWizardPage::GetPrev() functions.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This makes it very easy to use the objects of this class in the wizards where
|
|
|
|
the pages order is known statically - on the other hand, if this is not the
|
2008-09-27 06:27:44 -04:00
|
|
|
case you must derive your own class from wxWizardPage instead.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
@see wxWizard, @ref page_samples_wizard
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxWizardPageSimple : public wxWizardPage
|
|
|
|
{
|
|
|
|
public:
|
2012-06-08 01:11:21 -04:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxWizardPageSimple();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Constructor takes the previous and next pages.
|
|
|
|
They may be modified later by SetPrev() or SetNext().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 16:26:28 -04:00
|
|
|
wxWizardPageSimple(wxWizard* parent,
|
2008-03-09 08:33:59 -04:00
|
|
|
wxWizardPage* prev = NULL,
|
|
|
|
wxWizardPage* next = NULL,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxBitmap& bitmap = wxNullBitmap);
|
|
|
|
|
2012-06-08 01:11:21 -04:00
|
|
|
/**
|
|
|
|
Creates the wizard page.
|
|
|
|
Must be called if the default constructor had been used to create the object.
|
|
|
|
*/
|
|
|
|
bool Create(wxWizard *parent = NULL,
|
|
|
|
wxWizardPage *prev = NULL,
|
|
|
|
wxWizardPage *next = NULL,
|
|
|
|
const wxBitmap& bitmap = wxNullBitmap);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
A convenience function to make the pages follow each other.
|
|
|
|
Example:
|
2008-09-27 06:27:44 -04:00
|
|
|
|
|
|
|
@code
|
|
|
|
wxRadioboxPage *page3 = new wxRadioboxPage(wizard);
|
|
|
|
wxValidationPage *page4 = new wxValidationPage(wizard);
|
|
|
|
|
|
|
|
wxWizardPageSimple::Chain(page3, page4);
|
|
|
|
@endcode
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void Chain(wxWizardPageSimple* first,
|
|
|
|
wxWizardPageSimple* second);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the next page.
|
|
|
|
*/
|
|
|
|
void SetNext(wxWizardPage* next);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the previous page.
|
|
|
|
*/
|
|
|
|
void SetPrev(wxWizardPage* prev);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxWizard
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
wxWizard is the central class for implementing 'wizard-like' dialogs.
|
|
|
|
These 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.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05: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.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
To show a wizard dialog, you must first create an instance of the wxWizard class
|
2008-09-27 06:27:44 -04:00
|
|
|
using either the non-default constructor or a default one followed by call to the
|
|
|
|
wxWizard::Create function. Then you should add all pages you want the wizard to
|
|
|
|
show and call wxWizard::RunWizard().
|
|
|
|
Finally, don't forget to call @c "wizard->Destroy()", otherwise your application
|
2008-03-08 08:52:38 -05:00
|
|
|
will hang on exit due to an undestroyed window.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
You can supply a bitmap to display on the left of the wizard, either for all pages
|
2008-03-08 08:52:38 -05:00
|
|
|
or for individual pages. If you need to have the bitmap resize to the height of
|
2008-09-27 06:27:44 -04:00
|
|
|
the wizard, call wxWizard::SetBitmapPlacement() and if necessary,
|
|
|
|
wxWizard::SetBitmapBackgroundColour() and wxWizard::SetMinimumBitmapWidth().
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
To make wizard pages scroll when the display is too small to fit the whole
|
2008-09-27 06:27:44 -04:00
|
|
|
dialog, you can switch layout adaptation on globally with
|
|
|
|
wxDialog::EnableLayoutAdaptation() or per dialog with wxDialog::SetLayoutAdaptationMode().
|
|
|
|
For more about layout adaptation, see @ref overview_dialog_autoscrolling.
|
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxWizardEvent}
|
2008-09-27 06:27:44 -04:00
|
|
|
For some events, Veto() can be called to prevent the event from happening.
|
|
|
|
@event{EVT_WIZARD_PAGE_CHANGED(id, func)}
|
|
|
|
The page has just been changed (this event cannot be vetoed).
|
|
|
|
@event{EVT_WIZARD_PAGE_CHANGING(id, func)}
|
|
|
|
The page is being changed (this event can be vetoed).
|
2012-02-20 06:38:52 -05:00
|
|
|
@event{EVT_WIZARD_BEFORE_PAGE_CHANGED(id, func)}
|
|
|
|
Called after Next is clicked but before GetNext is called. Unlike EVT_WIZARD_CHANGING,
|
|
|
|
the handler for this function can change state that might affect the return value of
|
|
|
|
GetNext. This event can be vetoed.
|
2010-01-25 13:48:21 -05:00
|
|
|
@event{EVT_WIZARD_PAGE_SHOWN(id, func)}
|
|
|
|
The page was shown and laid out (this event cannot be vetoed).
|
2008-09-27 06:27:44 -04:00
|
|
|
@event{EVT_WIZARD_CANCEL(id, func)}
|
|
|
|
The user attempted to cancel the wizard (this event may also be vetoed).
|
|
|
|
@event{EVT_WIZARD_HELP(id, func)}
|
|
|
|
The wizard help button was pressed.
|
|
|
|
@event{EVT_WIZARD_FINISHED(id, func)}
|
|
|
|
The wizard finished button was pressed.
|
|
|
|
@endEventTable
|
|
|
|
|
|
|
|
|
|
|
|
@section wizard_extstyles Extended styles
|
|
|
|
|
|
|
|
Use the wxWindow::SetExtraStyle() function to set the following style.
|
|
|
|
You will need to use two-step construction (use the default constructor,
|
|
|
|
call SetExtraStyle(), then call Create).
|
|
|
|
|
|
|
|
@beginExtraStyleTable
|
|
|
|
@style{wxWIZARD_EX_HELPBUTTON}
|
|
|
|
Shows a Help button using wxID_HELP.
|
|
|
|
@endExtraStyleTable
|
|
|
|
|
|
|
|
See also wxDialog for other extended styles.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{cmndlg}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
@see wxWizardEvent, wxWizardPage, @ref page_samples_wizard
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxWizard : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2008-09-27 06:27:44 -04:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
|
|
|
|
Use this if you wish to derive from wxWizard and then call Create(),
|
|
|
|
for example if you wish to set an extra style with wxWindow::SetExtraStyle()
|
|
|
|
between the two calls.
|
|
|
|
*/
|
|
|
|
wxWizard();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor which really creates the wizard -- if you use this constructor, you
|
|
|
|
shouldn't call Create().
|
2008-09-27 06:27:44 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
Notice that unlike almost all other wxWidgets classes, there is no @e size
|
2008-03-08 08:52:38 -05:00
|
|
|
parameter in the wxWizard constructor because the wizard will have a predefined
|
2008-09-27 06:27:44 -04:00
|
|
|
default size by default.
|
|
|
|
If you want to change this, you should use the GetPageAreaSizer() function.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
The parent window, may be @NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-09-27 16:26:28 -04:00
|
|
|
The id of the dialog, will usually be just wxID_ANY.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param title
|
2008-03-09 08:33:59 -04:00
|
|
|
The title of the dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param bitmap
|
2008-09-27 06:27:44 -04:00
|
|
|
The default bitmap used in the left side of the wizard. See also GetBitmap().
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-09-27 06:27:44 -04:00
|
|
|
The position of the dialog, it will be centered on the screen by default.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style is passed to wxDialog.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 16:26:28 -04:00
|
|
|
wxWizard(wxWindow* parent, int id = wxID_ANY,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxString& title = wxEmptyString,
|
|
|
|
const wxBitmap& bitmap = wxNullBitmap,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
long style = wxDEFAULT_DIALOG_STYLE);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Creates the wizard dialog.
|
|
|
|
Must be called if the default constructor had been used to create the object.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
Notice that unlike almost all other wxWidgets classes, there is no @e size
|
2008-03-08 08:52:38 -05:00
|
|
|
parameter in the wxWizard constructor because the wizard will have a predefined
|
2008-09-27 06:27:44 -04:00
|
|
|
default size by default.
|
|
|
|
If you want to change this, you should use the GetPageAreaSizer() function.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
The parent window, may be @NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
The id of the dialog, will usually be just -1.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param title
|
2008-03-09 08:33:59 -04:00
|
|
|
The title of the dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param bitmap
|
2008-09-27 06:27:44 -04:00
|
|
|
The default bitmap used in the left side of the wizard. See also GetBitmap().
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-09-27 06:27:44 -04:00
|
|
|
The position of the dialog, it will be centered on the screen by default.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style is passed to wxDialog.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 16:26:28 -04:00
|
|
|
bool Create(wxWindow* parent, int id = wxID_ANY,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxString& title = wxEmptyString,
|
|
|
|
const wxBitmap& bitmap = wxNullBitmap,
|
2008-09-27 16:26:28 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition, long style = 536877056);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
This method is obsolete, use GetPageAreaSizer() instead.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Sets the page size to be big enough for all the pages accessible via the
|
|
|
|
given @e firstPage, i.e. this page, its next page and so on.
|
2008-09-27 06:27:44 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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.
|
|
|
|
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
|
|
|
|
from a single one and you should call @e Fit separately for the others.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void FitToPage(const wxWizardPage* firstPage);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the bitmap used for the wizard.
|
|
|
|
*/
|
2008-09-27 06:27:44 -04:00
|
|
|
const wxBitmap& GetBitmap() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the colour that should be used to fill the area not taken up by the
|
2008-09-27 06:27:44 -04:00
|
|
|
wizard or page bitmap, if a non-zero bitmap placement flag has been set.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also SetBitmapPlacement().
|
|
|
|
*/
|
2008-09-27 06:27:44 -04:00
|
|
|
const wxColour& GetBitmapBackgroundColour() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the flags indicating how the wizard or page bitmap should be expanded
|
2008-09-27 06:27:44 -04:00
|
|
|
and positioned to fit the page height. By default, placement is 0 (no expansion is done).
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also SetBitmapPlacement() for the possible values.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
int GetBitmapPlacement() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Get the current page while the wizard is running.
|
|
|
|
@NULL is returned if RunWizard() is not being executed now.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxWizardPage* GetCurrentPage() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the minimum width for the bitmap that will be constructed to contain
|
2008-09-27 06:27:44 -04:00
|
|
|
the actual wizard or page bitmap if a non-zero bitmap placement flag has been set.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also SetBitmapPlacement().
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetMinimumBitmapWidth() const;
|
2008-03-08 08:52:38 -05: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
|
2008-09-27 06:27:44 -04:00
|
|
|
before being shown to match the wizard page area.
|
|
|
|
|
|
|
|
Page area sizer has a minimal size that is the maximum of several values.
|
|
|
|
First, all pages (or other objects) added to the sizer. Second, all pages reachable
|
|
|
|
by repeatedly applying wxWizardPage::GetNext() to any page inserted into the sizer.
|
|
|
|
|
|
|
|
Third, the minimal size specified using SetPageSize() and FitToPage().
|
|
|
|
Fourth, the total wizard height may be increased to accommodate the bitmap height.
|
|
|
|
Fifth and finally, wizards are never smaller than some built-in minimal size to
|
|
|
|
avoid wizards that are too small.
|
|
|
|
|
|
|
|
The caller can use wxSizer::SetMinSize to enlarge it beyond the minimal size.
|
|
|
|
If @c wxRESIZE_BORDER was passed to constructor, user can resize wizard and
|
|
|
|
consequently the page area (but not make it smaller than the minimal size).
|
|
|
|
|
|
|
|
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 can be accomplished using wxSizer::SetMinSize().
|
2008-03-08 08:52:38 -05:00
|
|
|
Adding pages to the page area sizer affects the default border width around page
|
|
|
|
area that can be altered with SetBorder().
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
virtual wxSizer* GetPageAreaSizer() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the size available for the pages.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxSize GetPageSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Return @true if this page is not the last one in the wizard.
|
|
|
|
The base class version implements this by calling
|
|
|
|
@ref wxWizardPage::GetNext "page->GetNext" but this could be
|
|
|
|
undesirable if, for example, the pages are created on demand only.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see HasPrevPage()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual bool HasNextPage(wxWizardPage* page);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Returns @true if this page is not the last one in the wizard.
|
|
|
|
The base class version implements this by calling
|
|
|
|
@ref wxWizardPage::GetPrev "page->GetPrev" but this could be
|
|
|
|
undesirable if, for example, the pages are created on demand only.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see HasNextPage()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual bool HasPrevPage(wxWizardPage* page);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Executes the wizard starting from the given page, returning @true if it was
|
2008-09-27 06:27:44 -04:00
|
|
|
successfully finished or @false if user cancelled it.
|
2011-03-22 10:17:38 -04:00
|
|
|
The @a firstPage cannot be @NULL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool RunWizard(wxWizardPage* firstPage);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the bitmap used for the wizard.
|
|
|
|
*/
|
|
|
|
void SetBitmap(const wxBitmap& bitmap);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the colour that should be used to fill the area not taken up by the wizard
|
2008-09-27 06:27:44 -04:00
|
|
|
or page bitmap, if a non-zero bitmap placement flag has been set.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also SetBitmapPlacement().
|
|
|
|
*/
|
|
|
|
void SetBitmapBackgroundColour(const wxColour& colour);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the flags indicating how the wizard or page bitmap should be expanded and
|
2008-09-27 06:27:44 -04:00
|
|
|
positioned to fit the page height.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
By default, placement is 0 (no expansion is done). @a placement is a bitlist with the
|
|
|
|
following possible values:
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-09-27 06:27:44 -04:00
|
|
|
- @b wxWIZARD_VALIGN_TOP: Aligns the bitmap at the top.
|
|
|
|
- @b wxWIZARD_VALIGN_CENTRE: Centres the bitmap vertically.
|
|
|
|
- @b wxWIZARD_VALIGN_BOTTOM: Aligns the bitmap at the bottom.
|
|
|
|
- @b wxWIZARD_HALIGN_LEFT: Left-aligns the bitmap.
|
|
|
|
- @b wxWIZARD_HALIGN_CENTRE: Centres the bitmap horizontally.
|
|
|
|
- @b wxWIZARD_HALIGN_RIGHT: Right-aligns the bitmap.
|
|
|
|
- @b wxWIZARD_TILE: @todo describe this
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also SetMinimumBitmapWidth().
|
|
|
|
*/
|
|
|
|
void SetBitmapPlacement(int placement);
|
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -04:00
|
|
|
Sets width of border around page area. Default is zero.
|
|
|
|
For backward compatibility, if there are no pages in GetPageAreaSizer(),
|
|
|
|
the default is 5 pixels.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
If there is a five point border around all controls in a page and the border
|
2008-09-27 06:27:44 -04:00
|
|
|
around page area is left as zero, a five point white space along all dialog borders
|
2008-03-08 08:52:38 -05:00
|
|
|
will be added to the control border in order to space page controls ten points
|
2008-09-27 06:27:44 -04:00
|
|
|
from the dialog border and non-page controls.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetBorder(int border);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the minimum width for the bitmap that will be constructed to contain the
|
2008-09-27 06:27:44 -04:00
|
|
|
actual wizard or page bitmap if a non-zero bitmap placement flag has been set.
|
|
|
|
If this is not set when using bitmap placement, the initial layout may be incorrect.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also SetBitmapPlacement().
|
|
|
|
*/
|
|
|
|
void SetMinimumBitmapWidth(int width);
|
|
|
|
|
|
|
|
/**
|
2008-09-27 06:27:44 -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.
|
|
|
|
|
|
|
|
The recommended way to use this function is to lay out all wizard pages
|
2011-04-03 16:31:32 -04:00
|
|
|
using the sizers (even though the wizard is not resizable) and then use
|
2008-09-27 06:27:44 -04:00
|
|
|
wxSizer::CalcMin() in a loop to calculate the maximum of minimal sizes of
|
|
|
|
the pages and pass it to SetPageSize().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetPageSize(const wxSize& sizePage);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|