a
    §ˆcX  ã                   @   sD   d Z ddlZddlmZmZmZ ddlmZmZ G dd„ deƒZ	dS )z5 A base class for creating custom Traits UI windows.
é    N)ÚHasPrivateTraitsÚInstanceÚPropertyé   )Úinit_wx_handlersÚBufferDCc                       s”   e Zd ZdZeejƒZeejdƒZ	e
ƒ Ze
ƒ Z‡ fdd„Zddd„Zdd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚUIWindowz3A base class for creating custom Traits UI windows.)éÿÿÿÿr	   c                    s:   t ƒ jf i |¤Ž tj|d| jtjd�| _t| j| ƒ dS )z#Creates and initializes the window.r	   )ÚsizeÚstyleN)ÚsuperÚ__init__ÚwxÚWindowr
   ZFULL_REPAINT_ON_RESIZEÚcontrolr   )ÚselfÚparentZtraits©Ú	__class__© úX/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traitsui/wx/ui_window.pyr   +   s
    ÿzUIWindow.__init__Nc                 C   s4   | j dur0|du r| j  ¡  n| j  ||||¡ dS )z%Refreshes the contents of the window.N)r   ZRefresh)r   ÚxÚyZdxZdyr   r   r   Úrefresh3   s    
zUIWindow.refreshc                 C   s   | j  ¡  dS )zCapture the mouse.N)r   ZCaptureMouse©r   r   r   r   Úcapture;   s    zUIWindow.capturec                 C   s   | j  ¡  dS )zRelease the mouse.N)r   ZReleaseMouser   r   r   r   Úrelease?   s    zUIWindow.releasec                 C   s   dS )z)Never, ever, do anything in this handler.Nr   )r   Úeventr   r   r   Ú_erase_backgroundE   s    zUIWindow._erase_backgroundc                 C   s    t | jƒ}|  |¡ | ¡  dS )z"Paints the contents of the window.N)r   r   Ú	_paint_dcÚcopy)r   r   Údcr   r   r   Ú_paintI   s    

zUIWindow._paintc                 C   s   dS )zbThis method should be overridden by sub-classes to do the actual
        window painting.
        Nr   )r   r!   r   r   r   r   O   s    zUIWindow._paint_dcc                 C   s   | j  ¡ d S )Nr   ©r   ZGetClientSizer   r   r   r   Ú
_get_widthW   s    zUIWindow._get_widthc                 C   s   | j  || j¡ d S ©N)r   ÚSetSizeÚheight)r   Úwidthr   r   r   Ú
_set_widthZ   s    zUIWindow._set_widthc                 C   s   | j  ¡ d S )Nr   r#   r   r   r   r   Ú_get_height]   s    zUIWindow._get_heightc                 C   s   | j  | j|¡ d S r%   )r   r&   r(   )r   r'   r   r   r   Ú_set_height`   s    zUIWindow._set_height)NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   ÚSizer
   r   r(   r'   r   r   r   r   r   r"   r   r$   r)   r*   r+   Ú__classcell__r   r   r   r   r      s    

r   )
r/   r   Z
traits.apir   r   r   Úhelperr   r   r   r   r   r   r   Ú<module>   s   