a
    §ˆc…  ã                   @   s¤   d Z ddlmZmZmZ ddlmZ ddlmZ ddl	m
Z
mZ ddlmZ G dd	„ d	eƒZd
d	dgdfdd„Zd
d	ddgdfdd„ZG dd„ deƒZddd„ZdS )z3 Displays a message to the user as a modal window.
é    )ÚHasPrivateTraitsÚStrÚFloaté   )ÚView)ÚHGroup)ÚItemÚspring)Údo_afterc                   @   s   e Zd Zeƒ ZdS )ÚMessageN)Ú__name__Ú
__module__Ú__qualname__r   Úmessage© r   r   úS/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traitsui/message.pyr      s   r   Ú ÚOKNc                 C   s.   t | d�}|j|tddg||dd�d�}|jS )a  Displays a message to the user as a model window with the specified
    title and buttons.

    If *buttons* is not specified, a single **OK** button is used, which is
    appropriate for notifications, where no further action or decision on the
    user's part is required.
    ©r   úmessage~ú|<>Úmodal©ÚtitleÚbuttonsÚkind©ÚparentÚview©r   Úedit_traitsr   Úresult©r   r   r   r   ÚmsgZuir   r   r   r   ,   s    
ÿþr   ZCancelc                 C   s.   t | d�}|j|tddg||dd�d�}|jS )al  Displays a message to the user as a modal window with the specified
    title and buttons.

    If *buttons* is not specified, **OK** and **Cancel** buttons are used,
    which is appropriate for confirmations, where the user must decide whether
    to proceed. Be sure to word the message so that it is clear that clicking
    **OK** continues the operation.
    r   r   r   r   r   r   r   r"   r   r   r   Úerror>   s    	
ÿþr$   c                   @   s&   e Zd ZedƒZedƒZddd„ZdS )ÚAutoCloseMessageúPlease waitç       @Nr   c                 C   sB   t tttdddd�tƒ|d�}ttd| j ƒ| j||d�jƒ dS )	z0Display the wait message for a limited duration.r   FÚreadonly)Z
show_labelÚstyle)r   g     @�@r   N)	r   r   r	   r   r
   ÚintÚtimer    Zdispose)Úselfr   r   r   r   r   r   Úshow^   s    ýú	þzAutoCloseMessage.show)Nr   )r   r   r   r   r   r   r+   r-   r   r   r   r   r%   V   s   r%   r&   r'   c                 C   s   t | |d�}|j||d� dS )z¦Displays a message to the user as a modal window with no buttons. The
    window closes automatically after a specified time interval (specified
    in seconds).
    )r   r+   )r   r   N)r%   r-   )r   r+   r   r   r#   r   r   r   Úauto_close_messageu   s    r.   )r&   r'   r&   N)Ú__doc__Z
traits.apir   r   r   r   r   Úgroupr   Úitemr   r	   Zpyface.timer.apir
   r   r   r$   r%   r.   r   r   r   r   Ú<module>   s     ÿ