Package gui :: Module wizard :: Class Wiz_window
[hide private]
[frames] | no frames]

Class Wiz_window

source code


The wizard.

Instance Methods [hide private]
 
__init__(self, parent=None, size_x=400, size_y=400, title='', border=10, style=wx.DEFAULT_DIALOG_STYLE)
Set up the window.
source code
 
_build_buttons(self)
Construct the buttons for all pages of the wizard.
source code
 
_cancel(self, event=None)
Cancel the operation.
source code
 
_display_page(self, i)
Display the given page.
source code
 
_go_back(self, event=None)
Return to the previous page.
source code
 
_go_next(self, event=None)
Move to the next page.
source code
 
_handler_close(self, event=None)
Event handler for the close window action.
source code
int
_next_fn(self)
Standard function for setting the next page to the one directly next in the sequence.
source code
 
_ok(self, event=None)
Accept the operation.
source code
 
_seq_loop(self)
Loop over the sequence in the forwards direction.
source code
 
_skip(self, event=None)
Skip the page.
source code
int
add_page(self, panel, apply_button=True, skip_button=False, exec_on_next=True, proceed_on_error=True, uf_flush=False)
Add a new page to the wizard.
source code
 
block_next(self, block=True)
Prevent moving forwards (or unblock).
source code
Wiz_page instance.
get_page(self, index)
Get a page from the wizard.
source code
 
reset(self)
Reset the wizard.
source code
bool or None
run(self, modal=False)
Execute the wizard.
source code
 
set_seq_next_fn(self, index, fn)
A user specified function for non-linear page changing.
source code
Class Variables [hide private]
  _size_button = 100, 33
  ICON_APPLY = paths.icon_22x22.dialog_ok_apply
  ICON_BACK = paths.icon_22x22.go_previous_view
  ICON_CANCEL = paths.icon_22x22.dialog_cancel
  ICON_FINISH = paths.icon_22x22.dialog_ok
  ICON_NEXT = paths.icon_22x22.go_next_view
  ICON_OK = paths.icon_22x22.dialog_ok
  ICON_SKIP = paths.icon_22x22.skip
  TEXT_APPLY = " Apply"
  TEXT_BACK = " Back"
  TEXT_CANCEL = " Cancel"
  TEXT_FINISH = " Finish"
  TEXT_NEXT = " Next"
  TEXT_OK = " OK"
  TEXT_SKIP = " Skip"
Method Details [hide private]

__init__(self, parent=None, size_x=400, size_y=400, title='', border=10, style=wx.DEFAULT_DIALOG_STYLE)
(Constructor)

source code 

Set up the window.

Parameters:
  • parent (wx.Window instance) - The parent window.
  • size_x (int) - The width of the wizard.
  • size_y (int) - The height of the wizard.
  • title (str) - The title of the wizard dialog.
  • border (int) - The size of the border inside the wizard.
  • style (wx style) - The dialog style.

_cancel(self, event=None)

source code 

Cancel the operation.

Parameters:
  • event (wx event) - The wx event.

_display_page(self, i)

source code 

Display the given page.

Parameters:
  • i (int) - The index of the page to display.

_go_back(self, event=None)

source code 

Return to the previous page.

Parameters:
  • event (wx event) - The wx event.

_go_next(self, event=None)

source code 

Move to the next page.

Parameters:
  • event (wx event) - The wx event.

_handler_close(self, event=None)

source code 

Event handler for the close window action.

Parameters:
  • event (wx event) - The wx event.

_next_fn(self)

source code 

Standard function for setting the next page to the one directly next in the sequence.

Returns: int
The index of the next page, which is the current page index plus one.

_ok(self, event=None)

source code 

Accept the operation.

Parameters:
  • event (wx event) - The wx event.

_skip(self, event=None)

source code 

Skip the page.

Parameters:
  • event (wx event) - The wx event.

add_page(self, panel, apply_button=True, skip_button=False, exec_on_next=True, proceed_on_error=True, uf_flush=False)

source code 

Add a new page to the wizard.

Parameters:
  • panel (wx.Panel instance) - The page to add to the wizard.
  • apply_button (bool) - A flag which if true will show the apply button for that page.
  • skip_button (bool) - A flag which if true will show the skip button for that page.
  • exec_on_next (bool) - A flag which if true will run the on_execute() method when clicking on the next button.
  • proceed_on_error (bool) - A flag which if True will proceed to the next page (or quit if there are no more pages) despite the occurrence of an error in execution. If False, the page will remain open (the GUI interpreter thread will be flushed first to synchronise).
  • uf_flush (bool) - A flag which if True will cause the GUI interpreter thread to be flushed to clear out all user function call prior to proceeding.
Returns: int
The index of the page in the wizard.

block_next(self, block=True)

source code 

Prevent moving forwards (or unblock).

Parameters:
  • block (bool) - A flag which if True will block forwards movement and if False will unblock.

get_page(self, index)

source code 

Get a page from the wizard.

Parameters:
  • index (int) - The index of the page.
Returns: Wiz_page instance.
The page object.

run(self, modal=False)

source code 

Execute the wizard.

Parameters:
  • modal (bool) - A flag which if True will cause the wizard to be run as a modal dialog.
Returns: bool or None
The status from the modal operation, i.e. True if the wizard is run, False if cancelled or other error occur. For modeless operation, this returns nothing.

set_seq_next_fn(self, index, fn)

source code 

A user specified function for non-linear page changing.

Parameters:
  • index (int) - The index of the page the function should be associated with.
  • fn (func or method.) - The function for determining the page after the current. This function should return the index of the next page.