a
    §ˆc   ã                   @   sh   d Z ddlmZmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ G dd„ deƒZG d	d
„ d
eƒZdS )ú' The interface for all pyface wizards. é    )ÚBoolÚ	HasTraitsÚInstanceÚListÚStr)ÚIDialogé   )ÚIWizardController)ÚIWizardPagec                   @   s@   e Zd ZdZeeƒZeeƒZ	e
dƒZedƒZdd„ Zdd„ ZdS )	ÚIWizardr   TZWizardc                 C   s   dS ©z) Advance to the next page in the wizard. N© ©Úselfr   r   úY/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/wizard/i_wizard.pyÚnext.   s    zIWizard.nextc                 C   s   dS ©z, Return to the previous page in the wizard. Nr   r   r   r   r   Úprevious1   s    zIWizard.previousN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Zpagesr   r
   Ú
controllerr   Zshow_cancelr   Útitler   r   r   r   r   r   r      s   r   c                       sX   e Zd ZdZdd„ Zdd„ Z‡ fdd„Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Z‡  ZS )ÚMWizardz¼ The mixin class that contains common code for toolkit specific
    implementations of the IWizard interface.

    Implements: next(), previous()
    Reimplements: _create_contents()

    c                 C   s   | j  | j j¡}|  |¡ dS r   )r   Zget_next_pageÚcurrent_pageÚ
_show_page©r   Úpager   r   r   r   B   s    zMWizard.nextc                 C   s   | j  | j j¡}|  |¡ dS r   )r   Zget_previous_pager   r   r   r   r   r   r   H   s    
zMWizard.previousc                    s,   t ƒ  |¡ |  | j¡ |  | j ¡ ¡ dS )z Creates the window contents. N)ÚsuperÚ_create_contentsÚ_initialize_controllerr   r   Zget_first_page)r   Úparent©Ú	__class__r   r   r!   T   s    zMWizard._create_contentsc                 C   s   || j _dS )z Show the specified page. N)r   r   r   r   r   r   r   f   s    zMWizard._show_pagec                 C   s   dS )z@ Enables/disables buttons depending on the state of the wizard. Nr   ©r   Úeventr   r   r   Ú_updatep   s    zMWizard._updatec                 C   s    |  | jd¡ |  | jd¡ dS )z$ Initializes the wizard controller. Úcompleter   N)Úobserver(   Ú_on_current_page_changed)r   r   r   r   r   r"   y   s    zMWizard._initialize_controllerc                 C   sH   |j dur|j j| jddd� |jdur8|j | jd¡ | jdd� dS )z* Called when the current page is changed. Nr)   T)Úremove)r'   )Úoldr*   r(   Únewr&   r   r   r   r+   „   s
    

z MWizard._on_current_page_changedc                 C   s   | j  ¡  dS )z# Called when the wizard is closed. N)r   Zdispose_pagesr   r   r   r   Ú_on_closed_changed�   s    
zMWizard._on_closed_changed)r   r   r   r   r   r   r!   r   r(   r"   r+   r/   Ú__classcell__r   r   r$   r   r   5   s   
	r   N)r   Z
traits.apir   r   r   r   r   Zpyface.i_dialogr   Zi_wizard_controllerr
   Zi_wizard_pager   r   r   r   r   r   r   Ú<module>   s   