a
    §ˆc¶
  ã                   @   s<   d Z ddlmZ ddlmZ ddlmZ G dd„ deƒZdS )	z‚ Defines the BasicUIEditor class, which allows creating editors that define
    their function by creating an embedded Traits UI.
é    )ÚInstanceé   )ÚUI)ÚEditorc                       sX   e Zd ZdZeeƒZdd„ Zdd„ Zdd„ Z	‡ fdd	„Z
d
d„ Zdd„ Zdd„ Z‡  ZS )ÚUIEditorz-An editor that creates an embedded Traits UI.c                 C   s$   |   |¡j| jd�| _| jj| _dS )z\Finishes initializing the editor by creating the underlying toolkit
        widget.
        )ÚparentN)Úinit_uiZ	trait_setÚuiÚ	editor_uiÚcontrol©Úselfr   © r   úU/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traitsui/ui_editor.pyÚinit%   s    zUIEditor.initc                 C   s   | j j|  ¡ | j | dœ|d�S )z%Creates the traits UI for the editor.)ÚobjectÚeditor)ÚviewÚcontextr   )ÚvalueZedit_traitsZ
trait_viewr   r   r   r   r   ,   s
    
ýzUIEditor.init_uic                 C   s   dS )zYUpdates the editor when the object trait changes external to the
        editor.
        Nr   ©r   r   r   r   Úupdate_editor4   s    zUIEditor.update_editorc                    s"   | j dur| j  ¡  tƒ  ¡  dS )z&Disposes of the contents of an editor.N)r
   ÚdisposeÚsuperr   ©Ú	__class__r   r   r   <   s    

zUIEditor.disposec                 C   s
   | j  ¡ S )z9Returns the editor's control for indicating error status.)r
   Zget_error_controlsr   r   r   r   Úget_error_controlD   s    zUIEditor.get_error_controlc                 C   s   | j  |¡ dS )z[Restores any saved user preference information associated with the
        editor.
        N)r
   Z	set_prefs)r   Zprefsr   r   r   Úrestore_prefsJ   s    zUIEditor.restore_prefsc                 C   s
   | j  ¡ S )zCReturns any user preference information associated with the editor.)r
   Z	get_prefsr   r   r   r   Ú
save_prefsP   s    zUIEditor.save_prefs)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r
   r   r   r   r   r   r   r   Ú__classcell__r   r   r   r   r      s   r   N)r"   Z
traits.apir   r	   r   r   r   r   r   r   r   r   Ú<module>   s   