3
<Ad]  ã               @   s,   d Z ddlZddlmZ G dd„ deƒZdS )z@ A pager contains a set of pages, but only shows one at a time. é    N)ÚScrolledPanelc               @   s@   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dS )ÚPagerz@ A pager contains a set of pages, but only shows one at a time. c             K   s2   t j| ||f|Ž | jƒ  i | _d| _| jƒ  dS )z Creates a new pager. N)ÚwxScrolledPanelÚ__init__ZSetupScrollingÚ_pagesÚ_current_pageÚ_create_widget)ÚselfÚparentZwxidÚkw© r   úi/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/pyface-6.1.2-py3.6.egg/pyface/wx/pager.pyr      s    zPager.__init__c             C   sJ   || j |< | jƒ \}}|jƒ \}}| jt||ƒt||ƒfƒ |jdƒ |S )z& Adds a page with the specified name. F)r   ÚGetSizeÚSetSizeÚmaxÚShow)r	   ÚnameÚpageÚswÚshÚpwÚphr   r   r   Úadd_page0   s    

zPager.add_pagec             C   s6   | j dk	r| j| j ƒ | j| j| ƒ}| jj| ƒ |S )z) Shows the page with the specified name. N)r   Ú
_hide_pageÚ
_show_pager   Ú_sizerZFit)r	   r   r   r   r   r   Ú	show_pageB   s
    
zPager.show_pagec             C   s*   t jt jƒ | _}| j|ƒ | jdƒ dS )z Creates the widget. TN)ÚwxZBoxSizerÚVERTICALr   ZSetSizerZSetAutoLayout)r	   Zsizerr   r   r   r   U   s    

zPager._create_widgetc             C   s   |j dƒ | jj|ƒ dS )z Hides the specified page. FN)r   r   ÚRemove)r	   r   r   r   r   r   ^   s    
zPager._hide_pagec             C   s&   |j dƒ | jj|dtjƒ || _|S )z Shows the specified page. Té   )r   r   ÚAddr   ZEXPANDr   )r	   r   r   r   r   r   f   s    
zPager._show_pageN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   r      s   	r   )r%   r   Zwx.lib.scrolledpanelr   r   r   r   r   r   r   Ú<module>   s   