Inheritance diagram for wx.wizard.Wizard:
wx.wizard.Wizard 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.
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 instance of the wx.wizard.Wizard class using either the non-default constructor or a default one followed by call to the Create function. Then you should add all pages you want the wizard to show and call RunWizard. Finally, don’t forget to call wizard.Destroy(), otherwise your application will hang on exit due to an undestroyed window.
See also
To process input from a wizard dialog, use these event handler macros to direct input to member functions that take a wx.wizard.WizardEvent argument. For some events, Veto() can be called to prevent the event from happening.
Event Name | Description |
---|---|
wx.wizard.EVT_WIZARD_PAGE_CHANGED(id, func) | The page has just been changed (this event cannot be vetoed). |
wx.wizard.EVT_WIZARD_PAGE_CHANGING(id, func) | The page is being changed (this event can be vetoed). |
wx.wizard.EVT_WIZARD_CANCEL(id, func) | The user attempted to cancel the wizard (this event may also be vetoed). |
wx.wizard.EVT_WIZARD_HELP(id, func) | The wizard help button was pressed. |
wx.wizard.EVT_WIZARD_FINISHED(id, func) | The wizard finished button was pressed. |
Use the wx.Window.SetExtraStyle function to set the following style. You will need to use two-step construction (use the default constructor, call SetExtraStyle, then call Create).
Window Extra Style | Description |
---|---|
wx.wizard.WIZARD_EX_HELPBUTTON | Shows a Help button using wx.ID_HELP. |
See also
wx.Dialog for other extended styles.
Constructor which really creates the wizard – if you use this constructor, you shouldn’t call Create.
Notice that unlike almost all other wxPython classes, there is no size parameter in the wx.wizard.Wizard constructor because the wizard will have a predefined default size by default.
If you want to change this, you should use the GetPageAreaSizer method.
Parameters:
Returns:
Creates the wizard dialog.
Notice that unlike almost all other wxPython classes, there is no size parameter in the wx.wizard.Wizard constructor because the wizard will have a predefined default size by default.
If you want to change this, you should use the GetPageAreaSizer method.
Parameters:
Returns:
bool
Sets the page size to be big enough for all the pages accessible via the given 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. 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 Fit separately for the others.
Parameters:
Warning
This method is obsolete, use GetPageAreaSizer instead.
Get the current page while the wizard is running.
None is returned if RunWizard is not being executed now.
Returns:
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 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 wx.wizard.WizardPage.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 wx.Sizer.SetMinSize to enlarge it beyond the minimal size. If wx.RESIZE_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 wx.Sizer.SetMinSize.
Adding pages to the page area sizer affects the default border width around page area that can be altered with SetBorder.
Returns:
Return True if this page is not the last one in the wizard.
The base class version implements this by calling page.GetNext() but this could be undesirable if, for example, the pages are created on demand only.
Parameters:
Returns:
bool
See also
Returns True if this page is not the last one in the wizard.
The base class version implements this by calling page.GetPrev() but this could be undesirable if, for example, the pages are created on demand only.
Parameters:
Returns:
bool
See also
Executes the wizard starting from the given page, returning True if it was successfully finished or False if user cancelled it.
The firstPage parameter can not be None.
Parameters:
Returns:
bool
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.
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 border and non-page controls.
Parameters:
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 using the sizers (even though the wizard is not resizeable) and then use wx.Sizer.CalcMin in a loop to calculate the maximum of minimal sizes of the pages and pass it to SetPageSize.
Parameters:
Warning
This method is obsolete, use GetPageAreaSizer instead.
Shows a particular wizard page.
Parameters:
Returns:
bool