3
7ßL][  ã               @   s^   d Z ddlmZmZ ddlmZmZmZmZm	Z	 ddl
mZmZ e	eƒG dd„ deeƒƒZdS )z! Mix-in class for split widgets. é    )ÚQtCoreÚQtGui)ÚCallableÚEnumÚFloatÚ	HasTraitsÚprovides)ÚISplitWidgetÚMSplitWidgetc               @   sD   e Zd ZdZedddƒZedƒZeZ	e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.
    ZverticalÚ
horizontalg      à?c             C   sš   t j|ƒ}| jdkr"|jtjjƒ |jdƒ |j| j	|ƒƒ |j| j
|ƒƒ | jdkrd|jƒ jƒ }n|jƒ jƒ }|jt|| j ƒt|d| j  ƒgƒ |S )zA Create the toolkit-specific control that represents the widget. r   Fg      ð?)r   Z	QSplitterÚ	directionZsetOrientationr   ZQtZVerticalZsetChildrenCollapsibleZ	addWidgetÚ_create_lhsÚ_create_rhsZsizeHintÚheightÚwidthZsetSizesÚintÚratio)ÚselfÚparentZsplitterÚpos© r   ú>/tmp/pip-install-5sebvq2j/pyface/pyface/ui/qt4/split_widget.pyÚ_create_splitter.   s    



&zSplitWidget._create_splitterc             C   s6   | j dk	r(| j |ƒ}t|tjƒs2|j}n
tj|ƒ}|S )z= Creates the left hand/top panel depending on the direction. N)ÚlhsÚ
isinstancer   ÚQWidgetÚcontrol)r   r   r   r   r   r   r   J   s    


zSplitWidget._create_lhsc             C   s6   | j dk	r(| j |ƒ}t|tjƒs2|j}n
tj|ƒ}|S )zA Creates the right hand/bottom panel depending on the direction. N)Úrhsr   r   r   r   )r   r   r   r   r   r   r   X   s    


zSplitWidget._create_rhsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   r   N)r"   Z	pyface.qtr   r   Z
traits.apir   r   r   r   r   Zpyface.i_split_widgetr	   r
   r   r   r   r   r   Ú<module>   s
   