a
    §ˆcà
  ã                   @   s(   d Z ddlmZmZ G dd„ deƒZdS )úD Base class defining common code for EnamlTaskPane and EnamlEditor. é    )Ú	HasTraitsÚInstancec                   @   s0   e Zd ZdZedƒZdd„ Zdd„ Zdd„ Zd	S )
Ú	EnamlPaner   z*enaml.widgets.toolkit_object.ToolkitObjectc                 C   s
   t ƒ ‚dS )z‰ Return an Enaml component defining the contents of the pane.

        Returns
        -------
        component : ToolkitObject
        N)ÚNotImplementedError)Úself© r   úZ/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/tasks/enaml_pane.pyÚcreate_component   s    zEnamlPane.create_componentc                 C   s†   ddl m} |  ¡ | _| jj}d| j_| j ¡  | jjsB| j ¡  | jjj	| _
|durb| j
 |¡ || j_t| j|ƒr‚| jj ¡  dS )zA Create the toolkit-specific control that represents the editor. r   )ÚProxyConstraintsWidgetFN)Z enaml.widgets.constraints_widgetr   r
   Ú	componentÚvisibleZ
initializeZproxy_is_activeZactivate_proxyÚproxyZwidgetÚcontrolÚ	setParentÚ
isinstanceZrequest_relayout)r   Úparentr   r   r   r   r	   Úcreate'   s    


zEnamlPane.createc                 C   s8   | j }|dur(| ¡  | j ¡  | ¡  d| _ d| _dS )zJ Destroy the toolkit-specific control that represents the editor.
        N)r   Úhider   ÚdestroyZdeleteLater)r   r   r   r   r	   r   F   s    
zEnamlPane.destroyN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r
   r   r   r   r   r   r	   r      s
   r   N)r   Z
traits.apir   r   r   r   r   r   r	   Ú<module>
   s   