a
    §ˆcŸ  ã                   @   sZ   d Z ddlmZmZ ddlmZ ddlmZmZ ddl	m
Z
 eeƒG dd„ dee
ƒƒZd	S )
z A Layered panel. é    )ÚIntÚprovides©ÚQStackedWidget)ÚILayeredPanelÚMLayeredPanelé   )ÚLayoutWidgetc                   @   s8   e Zd ZdZedƒZedƒZdd„ Zdd„ Zdd„ Z	d	S )
ÚLayeredPanelzÚ A Layered panel.

    A layered panel contains one or more named layers, with only one layer
    visible at any one time (think of a 'tab' control minus the tabs!).  Each
    layer is a toolkit-specific control.

    r   c                 C   s   | j  |¡ || j|< |S )z– Adds a layer with the specified name.

        All layers are hidden when they are added.  Use 'show_layer' to make a
        layer visible.
        )ÚcontrolZ	addWidgetÚ_layers)ÚselfÚnameÚlayer© r   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/ui/qt4/layered_panel.pyÚ	add_layer&   s    
zLayeredPanel.add_layerc                 C   s2   | j | }| j |¡}| j |¡ || _|| _|S )z* Shows the layer with the specified name. )r   r   ÚindexOfZsetCurrentIndexZcurrent_layerZcurrent_layer_name)r   r   r   Zlayer_indexr   r   r   Ú
show_layer0   s    
zLayeredPanel.show_layerc                 C   s   t |ƒ}|S )zA Create the toolkit-specific control that represents the widget. r   )r   Úparentr   r   r   r   Ú_create_control=   s    zLayeredPanel._create_controlN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Z	min_widthZ
min_heightr   r   r   r   r   r   r   r
      s   	
r
   N)r   Z
traits.apir   r   Zpyface.qt.QtGuir   Zpyface.i_layered_panelr   r   Zlayout_widgetr	   r
   r   r   r   r   Ú<module>   s   