a
    §ˆch  ã                   @   sL   d Z ddlmZmZ ddlmZ ddlmZmZ eeƒG dd„ deƒƒZ	dS )z! Mix-in class for split widgets. é    )ÚQtCoreÚQtGui)Úprovides)ÚISplitWidgetÚMSplitWidgetc                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚSplitWidgetzz The toolkit specific implementation of a SplitWidget.  See the
    ISPlitWidget interface for the API documentation.
    c                 C   sœ   t  |¡}| jdkr$| tjjj¡ | d¡ | 	|  
|¡¡ | 	|  |¡¡ | jdkrf| ¡  ¡ }n| ¡  ¡ }| t|| j ƒt|d| j  ƒg¡ |S )zA Create the toolkit-specific control that represents the widget. Z
horizontalFg      ð?)r   Z	QSplitterÚ	directionZsetOrientationr   ZQtZOrientationZVerticalZsetChildrenCollapsibleZ	addWidgetÚ_create_lhsÚ_create_rhsZsizeHintÚheightÚwidthZsetSizesÚintZratio)ÚselfÚparentZsplitterÚpos© r   ú]/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/ui/qt4/split_widget.pyÚ_create_splitter!   s    



ÿzSplitWidget._create_splitterc                 C   s6   | j dur(|   |¡}t|tjƒs2|j}n
t |¡}|S )z= Creates the left hand/top panel depending on the direction. N)ÚlhsÚ
isinstancer   ÚQWidgetÚcontrol)r   r   r   r   r   r   r	   ?   s    


zSplitWidget._create_lhsc                 C   s6   | j dur(|   |¡}t|tjƒs2|j}n
t |¡}|S )zA Creates the right hand/bottom panel depending on the direction. N)Úrhsr   r   r   r   )r   r   r   r   r   r   r
   M   s    


zSplitWidget._create_rhsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   r
   r   r   r   r   r      s   r   N)
r   Z	pyface.qtr   r   Z
traits.apir   Zpyface.i_split_widgetr   r   r   r   r   r   r   Ú<module>   s
   