3
8Ad]{  ã               @   sP   d Z ddlm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.
é    )Úabsolute_importN)Ú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 )ÚUIWindowz9 A base class for creating custom Traits UI windows.
    r   c                s:   t t| ƒjf |Ž tj|d| jtjd�| _t| j| ƒ dS )z- Creates and initializes the window.
        r   )ÚsizeÚstyleNéÿÿÿÿ)	Úsuperr	   Ú__init__ÚwxÚWindowr
   ZFULL_REPAINT_ON_RESIZEÚcontrolr   )ÚselfÚparentÚtraits)Ú	__class__© úq/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/traitsui-6.1.2-py3.6.egg/traitsui/wx/ui_window.pyr   9   s
    zUIWindow.__init__Nc             C   s4   | j dk	r0|dkr| j jƒ  n| j j||||ƒ dS )z/ Refreshes the contents of the window.
        N)r   ZRefresh)r   ÚxÚyÚdxÚdyr   r   r   ÚrefreshB   s    
zUIWindow.refreshc             C   s   | j jƒ  dS )z Capture the mouse.
        N)r   ZCaptureMouse)r   r   r   r   ÚcaptureK   s    zUIWindow.capturec             C   s   | j jƒ  dS )z Release the mouse.
        N)r   ZReleaseMouse)r   r   r   r   ÚreleaseP   s    zUIWindow.releasec             C   s   dS )z3 Never, ever, do anything in this handler.
        Nr   )r   Úeventr   r   r   Ú_erase_backgroundW   s    zUIWindow._erase_backgroundc             C   s    t | jƒ}| j|ƒ |jƒ  dS )z, Paints the contents of the window.
        N)r   r   Ú	_paint_dcÚcopy)r   r   Údcr   r   r   Ú_paint\   s    

zUIWindow._paintc             C   s   dS )zg This method should be overridden by sub-classes to do the actual
            window painting.
        Nr   )r   r#   r   r   r   r!   c   s    zUIWindow._paint_dcc             C   s   | j jƒ d S )Nr   )r   ÚGetClientSize)r   r   r   r   Ú
_get_widthk   s    zUIWindow._get_widthc             C   s   | j j|| jƒ d S )N)r   ÚSetSizeÚheight)r   Úwidthr   r   r   Ú
_set_widthn   s    zUIWindow._set_widthc             C   s   | j jƒ d S )Nr   )r   r%   )r   r   r   r   Ú_get_heightq   s    zUIWindow._get_heightc             C   s   | j j| j|ƒ d S )N)r   r'   r)   )r   r(   r   r   r   Ú_set_heightt   s    zUIWindow._set_heightr   r   )r   r   )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	   )r0   Ú
__future__r   r   Z
traits.apir   r   r   Úhelperr   r   r	   r   r   r   r   Ú<module>   s
   