3
7ßL]}  ã               @   sL   d Z ddlmZmZmZmZ ddlmZ G dd„ deƒZG dd„ de	ƒZ
dS )	zI The interface for a dialog that allows the user to open/save files etc. é    )ÚAnyÚBoolÚIntÚStr)ÚIDialogc               @   sP   e Zd ZdZeZeZeZedƒZ	e
dƒZe
dƒZe
dƒZeZdd„ Zdd„ ZdS )	ÚIProgressDialogzG A simple progress dialog window which allows itself to be updated
    é   Fc             C   s   dS )a   Update the progress bar to the desired value

        If the value is >= the maximum and the progress bar is not contained
        in another panel the parent window will be closed.

        Parameters
        ----------
        value :
            The progress value to set.
        N© )ÚselfÚvaluer	   r	   ú</tmp/pip-install-5sebvq2j/pyface/pyface/i_progress_dialog.pyÚupdate9   s    zIProgressDialog.updatec             C   s   dS )z® Change the displayed message in the progress dialog

        Parameters
        ----------
        message : str or unicode
            The new message to display.

        Nr	   )r
   Úmessager	   r	   r   Úchange_messageE   s    zIProgressDialog.change_messageN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   ÚminÚmaxÚmarginr   Z
can_cancelZ	show_timeZshow_percentZcancel_button_labelr   r   r	   r	   r	   r   r      s   r   c                   s4   e Zd ZdZeZ‡ fdd„Zdd„ Zdd„ Z‡  Z	S )ÚMProgressDialogz” The mixin class that contains common code for toolkit specific
    implementations of the IProgressDialog interface.

    Implements: update()
    c                s6   | j | jk r$d}t|j| j| j ƒƒ‚tt| ƒjƒ  dS )z Open the dialog z0Dialog min ({}) is greater than dialog max ({}).N)r   r   ÚAttributeErrorÚformatÚsuperr   Úopen)r
   Úmsg)Ú	__class__r	   r   r   _   s    zMProgressDialog.openc             C   s,   | j dk	r| j j|ƒ || jkr(| jƒ  dS )a   Update the progress bar to the desired value

        If the value is >= the maximum and the progress bar is not contained
        in another panel the parent window will be closed.

        Parameters
        ----------
        value :
            The progress value to set.
        N)Úprogress_barr   r   Úclose)r
   r   r	   r	   r   r   k   s    

zMProgressDialog.updatec             C   s
   || _ dS )z® Change the displayed message in the progress dialog

        Parameters
        ----------
        message : str or unicode
            The new message to display.

        N)r   )r
   r   r	   r	   r   r   }   s    	zMProgressDialog.change_message)
r   r   r   r   r   r   r   r   r   Ú__classcell__r	   r	   )r   r   r   P   s
   r   N)r   Z
traits.apir   r   r   r   Zpyface.i_dialogr   r   Úobjectr   r	   r	   r	   r   Ú<module>   s   9