a
    §ˆc�  ã                   @   s,   d Z ddlZddlmZ G dd„ deƒZdS )ú@ 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 )ÚPagerr   c                 K   s6   t j| ||fi |¤Ž |  ¡  i | _d| _|  ¡  dS )z Creates a new pager. N)ÚwxScrolledPanelÚ__init__ZSetupScrollingÚ_pagesÚ_current_pageÚ_create_widget)ÚselfÚparentZwxidÚkw© r   úR/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/wx/pager.pyr      s    zPager.__init__c                 C   sJ   || j |< |  ¡ \}}| ¡ \}}|  t||ƒt||ƒf¡ | d¡ |S )z& Adds a page with the specified name. F)r   ZGetSizeZSetSizeÚmaxÚShow)r
   ÚnameÚpageÚswÚshÚpwÚphr   r   r   Úadd_page+   s    

zPager.add_pagec                 C   s6   | j dur|  | 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_page=   s
    
zPager.show_pagec                 C   s*   t  t j¡ | _}|  |¡ |  d¡ dS )z Creates the widget. TN)ÚwxZBoxSizerZVERTICALr   ZSetSizerZSetAutoLayout)r
   Zsizerr   r   r   r	   P   s    
zPager._create_widgetc                 C   s   |  d¡ | j |¡ dS )z Hides the specified page. FN)r   r   ZRemove©r
   r   r   r   r   r   W   s    
zPager._hide_pagec                 C   s&   |  d¡ | j |dtj¡ || _|S )z Shows the specified page. Té   )r   r   ÚAddr   ZEXPANDr   r   r   r   r   r   ]   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   