3
8ßL]O3 ã            
   @   sn  d Z ddlmZ ddlZddlZddlZddlZyddlmZm	Z	 W n   d ZZ	Y nX ddl
mZ ddlmZmZmZmZmZ ddlmZmZmZmZ ddlmZmZmZmZmZmZmZ dd	lm Z  dd
l!m"Z" ddl#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6m7Z7 dZ8G dd„ de4ƒZ9G dd„ deƒZ:dS )zB Defines the tree editor for the wxPython user interface toolkit.
é    )Úabsolute_importN)ÚPythonDropSourceÚPythonDropTarget)Ú	ImageList)ÚHasStrictTraitsÚAnyÚStrÚEventÚ
TraitError)ÚViewÚTreeNodeÚObjectTreeNodeÚMultiTreeNode)Ú
CopyActionÚ	CutActionÚDeleteActionÚ	NewActionÚPasteActionÚRenameActionÚToolkitEditorFactory)ÚListUndoItem)ÚITreeNodeAdapterBridge)ÚMenuÚActionÚ	Separator)ÚImageResource)Úconvert_image)Ú
DockWindowÚ	DockSizerÚDockSectionÚ
DockRegionÚDockControlé   )ÚOKColor)ÚEditor)ÚTraitsUIPanelÚTraitsUIScrolledPanelc                   s   e Zd ZdZdZeZeZeZ	eZ
eZeZdd„ Z‡ fdd„Zdd„ Zd	d
„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdºdd„Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ Z d+d,„ Z!d-d.„ Z"d»d/d0„Z#d¼d2d3„Z$d4d5„ Z%d6d7„ Z&d½d9d:„Z'd¾d;d<„Z(d=d>„ Z)d?d@„ Z*dAdB„ Z+dCdD„ Z,dEdF„ Z-dGdH„ Z.dIdJ„ Z/dKdL„ Z0dMdN„ Z1dOdP„ Z2d¿dQdR„Z3dÀdSdT„Z4dUdV„ Z5dÁdWdX„Z6dYdZ„ Z7d[d\„ Z8d]d^„ Z9d_d`„ Z:dÂdadb„Z;dÃdcdd„Z<dedf„ Z=dgdh„ Z>didj„ Z?dkdl„ Z@dÄdndo„ZAdpdq„ ZBdrds„ ZCdtdu„ ZDdvdw„ ZEdxdy„ ZFdzd{„ ZGd|d}„ ZHd~d„ ZId€d�„ ZJd‚dƒ„ ZKd„d…„ ZLd†d‡„ ZMdˆd‰„ ZNdŠd‹„ ZOdŒd�„ ZPdŽd�„ ZQd�d‘„ ZRd’d“„ ZSd”d•„ ZTd–d—„ ZUd˜d™„ ZVdšd›„ ZWdœd�„ ZXdÅdždŸ„ZYd d¡„ ZZd¢d£„ Z[d¤d¥„ Z\d¦d§„ Z]d¨d©„ Z^dªd«„ Z_d¬d­„ Z`dÆd®d¯„ZadÇd°d±„Zbd²d³„ Zcd´dµ„ Zdd¶d·„ Zed¸d¹„ Zf‡  ZgS )ÈÚSimpleEditorz" Simple style of tree editor.
    Tc             C   s–  | j }| jƒ }|j�r|jrî|j}|dkrˆ| |_t|dƒ| _d | j_| j_	|j
}|dk	r„x"|j
D ]}|j| jkrb| j|_qbW d|_
dS |j}|dks¢|j| jk	rÆ|j
}|dkrºg  |_
}|j| ƒ n|j| _tj|d|d� | _ | _}�q d| _|j�p| jjj}	t||	d�j | _}
tj|
d|d� | _}t|
ƒ | _}|jtjtjƒƒ |jddƒ |jtjddƒƒ d | j_| j_	| j}d }}d	}|j}|dk�r¶|d
 }|d }|j}|
jttt t!|d||d�gd�t t!|d| j|d�gd�g|j"dkd�d�ƒ ntj|d|d� | _ | _}|j#�r@t$|j%Ž | _&|j'| j&ƒ i | _(g | _)|j*ƒ }tj+|| j,ƒ tj-|| j.ƒ tj/|| j0ƒ tj1||| j2ƒ tj3||| j4ƒ tj5||| j6ƒ tj7||| j8ƒ tj9||| j:ƒ tj;||| j<ƒ tj=||| j>ƒ tj?||| j@ƒ tjA||| jBƒ tjC||| jDƒ tjE|| jFƒ | jG|jHdƒ | jG|jIddƒ | jG|jJddƒ | jG|jKddƒ | jG|jLddƒ tMdk	�r’|jNtM| ƒƒ dS )za Finishes initializing the editor by creating the underlying toolkit
            widget.
        Nr"   )ÚstyleT)Úthemeé   éd   Ú Zfixedz
 Hierarchyz EditorÚtree)ÚnameÚidÚcontrolr(   )ÚcontentsÚeditorZ
horizontal)r1   Zis_rowÚselectedÚ	activatedZtoÚclickÚdclickÚvetoÚfroméÿÿÿÿr9   r9   r9   )OÚfactoryÚ
_get_styleÚeditableZshared_editorr2   Ú_editorr%   r0   Ú_node_uiÚ_editor_nidZ_shared_editorsÚuiÚappendÚwxZTreeCtrlÚ_treeÚ_is_dock_windowZ
dock_themeÚitemÚ	containerr   r&   ÚSetSizerÚBoxSizerÚVERTICALZSetScrollRateZ
SetMinSizeÚSizeÚlabelZdockr   r   r    r!   ZorientationZ
show_iconsr   Z	icon_sizeÚ_image_listZAssignImageListÚ_mapÚ	_undoableÚGetIdÚEVT_LEFT_DOWNÚ_on_left_downÚEVT_RIGHT_DOWNÚ_on_right_downZEVT_LEFT_DCLICKÚ_on_left_dclickÚEVT_TREE_ITEM_EXPANDINGÚ_on_tree_item_expandingÚEVT_TREE_ITEM_EXPANDEDÚ_on_tree_item_expandedÚEVT_TREE_ITEM_COLLAPSINGÚ_on_tree_item_collapsingÚEVT_TREE_ITEM_COLLAPSEDÚ_on_tree_item_collapsedÚEVT_TREE_ITEM_ACTIVATEDÚ_on_tree_item_activatedÚEVT_TREE_SEL_CHANGEDÚ_on_tree_sel_changedÚEVT_TREE_BEGIN_DRAGÚ_on_tree_begin_dragÚEVT_TREE_BEGIN_LABEL_EDITÚ_on_tree_begin_label_editÚEVT_TREE_END_LABEL_EDITÚ_on_tree_end_label_editÚEVT_TREE_ITEM_GETTOOLTIPÚ_on_tree_item_gettooltipZ
EVT_MOTIONÚ	_on_hoverZ
sync_valuer3   r4   r5   r6   r7   r   ZSetDropTarget)ÚselfÚparentr:   r(   Zfactory_editorZeditorsr2   Zshared_editorsr-   r)   ZsplitterrE   Zhierarchy_nameZeditor_namer.   Útid© rm   ú=/tmp/pip-install-5sebvq2j/traitsui/traitsui/wx/tree_editor.pyÚinitm   sª    


zSimpleEditor.initc                sè   | j }|dk	rÖ|jƒ }tj|dƒ tj|dƒ tj||dƒ tj||dƒ tj||dƒ tj||dƒ tj	||dƒ tj
||dƒ tj||dƒ tj||dƒ tj||dƒ tj||dƒ | j jƒ }|jƒ rÖ| j|ƒ tt| ƒjƒ  dS )z0 Disposes of the contents of an editor.
        N)rC   rO   rB   rP   rR   rU   rW   rY   r[   r]   r_   ra   rc   re   rg   ÚGetRootItemÚIsOkÚ_delete_nodeÚsuperr'   Údispose)rj   r-   r/   Únid)Ú	__class__rm   rn   rt      s&    

zSimpleEditor.disposec          	   C   s,   y| j j| j|ƒd ƒ W n   Y nX dS )z* Handles the **selection** event.
        é   N)rC   Ú
SelectItemÚ_object_info)rj   Ú	selectionrm   rm   rn   Ú_selection_changed  s    zSimpleEditor._selection_changedc             C   s   | j s| j|ƒ dS )z7 Handles the **selected** trait being changed.
        N)Ú_no_update_selectedr{   )rj   r3   rm   rm   rn   Ú_selected_changed)  s    zSimpleEditor._selected_changedc             C   s
   d| _ dS )z/ Handles the 'veto' event being fired.
        TN)Ú_veto)rj   rm   rm   rn   Ú_veto_changed3  s    zSimpleEditor._veto_changedc             C   st   | j }tjtjB tjB }|jdks6|jdkr@tjdkr@|tjO }|j	rV|tj
tjB O }|jdkrp|tjtjB O }|S )zE Returns the style settings used for displaying the wx tree.
        ÚoffZ
appearanceÚposixÚsingle)r:   rB   ZTR_EDIT_LABELSZTR_HAS_BUTTONSZCLIP_CHILDRENZ
lines_modeÚosr.   ZTR_NO_LINESÚ	hide_rootZTR_HIDE_ROOTZTR_LINES_AT_ROOTÚselection_modeZTR_MULTIPLEZTR_EXTENDED)rj   r:   r(   rm   rm   rn   r;   <  s    


zSimpleEditor._get_stylec             C   s>   y$| j ƒ | _| jjtƒ | jjƒ  W n tk
r8   Y nX dS )zC Handles the user entering input data in the edit control.
        N)Ú
_get_valueÚvaluer0   ZSetBackgroundColourr#   ÚRefreshr
   )rj   Úeventrm   rm   rn   Úupdate_objectS  s    
zSimpleEditor.update_objectc       	      C   s–   | j }|jƒ }i }|jƒ r’|g}xp|r�|jƒ }| j|ƒ}y|j|ƒ}W n   d}Y nX |d |f|t|d ƒ< x| j|ƒD ]}|j|ƒ q|W q"W |S )NTr   r"   r9   )	rC   rp   rq   ÚpopÚ_get_node_dataZ
IsExpandedÚhashÚ_nodesrA   )	rj   r-   ru   ÚstateÚnodes_to_doÚnodeÚdataÚis_expandedÚcnidrm   rm   rn   Ú_save_statea  s     

zSimpleEditor._save_statec             C   sž   |sd S | j }|jƒ }|jƒ rš|g}xt|r˜|jƒ }xb| j|ƒD ]T}| j|ƒ}t|d ƒ}||kr>|| \}	}
|	r>| j|ƒ |
rˆ|j|ƒ |j	|ƒ q>W q&W d S )Nr"   r9   )
rC   rp   rq   r‹   rŽ   rŒ   r�   Ú_expand_nodeÚExpandrA   )rj   r�   r-   ru   r�   r‘   r”   r’   ÚkeyZwas_expandedZcurrent_staterm   rm   rn   Ú_restore_statew  s$    


zSimpleEditor._restore_statec                sn   ˆ j ‰‡ ‡fdd„}ˆjƒ }|jƒ rj|g}x>|rh|jƒ }||ƒ x$ˆ j|ƒD ]}||ƒ |j|ƒ qLW q,W dS )z= Expands all nodes, starting from the selected node.
        c                s@   ˆ j | ƒ\}}}ˆ j||ƒr<ˆj| dƒ ˆ j| ƒ ˆj| ƒ d S )NT)rŒ   Ú_has_childrenÚSetItemHasChildrenr–   r—   )ru   Úexpandedr‘   Úobject)rj   r-   rm   rn   Ú
_do_expand”  s
    
z+SimpleEditor.expand_all.<locals>._do_expandN)rC   ZGetSelectionrq   r‹   rŽ   rA   )rj   rž   ru   r�   r‘   Únrm   )rj   r-   rn   Ú
expand_all�  s    zSimpleEditor.expand_allc             C   st   |dkrp| j |ƒ\}}}| j||ƒrp| jj|dƒ | j|ƒ |rL| jj|ƒ x"| j|ƒD ]}| j||d ƒ qXW dS )zM Expands from the specified node the specified number of sub-levels.
        r   Tr"   N)rŒ   rš   rC   r›   r–   r—   rŽ   Úexpand_levels)rj   ru   ZlevelsÚexpandrœ   r‘   r�   r”   rm   rm   rn   r¡   ©  s    
zSimpleEditor.expand_levelsc             C   s  | j }i }|dk	�r|jƒ }|jƒ r.| j|ƒ | j| jƒ\}}|dk	�r| j||ƒ}|j|j|ƒ||ƒ | _	}|j
|ƒ|fg| jt|ƒ< | j||ƒ | j|d||fƒ | jjsº| j||ƒrô|j|dƒ | j|ƒ | jjsô|j|ƒ |j|ƒ | jƒ  | j|| jjdƒ |jƒ  dS )z` Updates the editor when the object trait changes externally to the
            editor.
        NFT)rC   rp   rq   rr   Ú	_node_forr‡   Ú	_get_iconZAddRootÚ	get_labelÚ	_root_nidÚget_children_idrM   r/   Ú_add_listenersÚ_set_node_datar:   r„   rš   r›   r–   r—   rx   r`   r¡   Ú	auto_openrˆ   )rj   r-   Úsaved_stateru   r�   r‘   Úiconrm   rm   rn   Úupdate_editorº  s0    





zSimpleEditor.update_editorc             C   s   | j S )zC Returns the editor's control for indicating error status.
        )rC   )rj   rm   rm   rn   Úget_error_controlá  s    zSimpleEditor.get_error_controlc             C   s   | j |d||ƒS )z3 Appends a new node to the specified node.
        N)Ú_insert_node)rj   ru   r‘   r�   rm   rm   rn   Ú_append_nodeê  s    zSimpleEditor._append_nodec       
      C   s¼   | j }| j||ƒ}|j|ƒ}|dkr6|j||||ƒ}n|j|||||ƒ}| j||ƒ}	|j||	ƒ | j|d||fƒ | jj	t
|ƒg ƒj|j|ƒ|fƒ | j||ƒ |	r¸|j|ƒr¸|j|ƒ |S )zj Inserts a new node before a specified index into the children of the
            specified node.
        NF)rC   r¤   r¥   Z
AppendItemZInsertItemBeforerš   r›   r©   rM   Ú
setdefaultr/   rA   r§   r¨   Úcan_auto_openr—   )
rj   ru   Úindexr‘   r�   r-   r¬   rK   r”   Úhas_childrenrm   rm   rn   r¯   ô  s    

zSimpleEditor._insert_nodec       
      C   sÄ   x| j |ƒD ]}| j|ƒ qW | j|ƒ\}}}t|ƒ}| j| }x(t|ƒD ]\}}	||	d krJ||= P qJW t|ƒdkrŠ| j||ƒ | j|= d| _| j	j
|ƒ d| _| jdk	rÀ|| jjkrÀ| jƒ  dS )z@ Deletes a specified tree node and all of its children.
        r"   r   TFN)Ú
_nodes_forrr   rŒ   r/   rM   Ú	enumerateÚlenÚ_remove_listenersÚ_lockedrC   ÚDeleter=   r?   Ú_clear_editor)
rj   ru   r”   rœ   r‘   r�   Z	id_objectZobject_infoÚiÚinform   rm   rn   rr     s"    
zSimpleEditor._delete_nodec             C   sb   | j |ƒ\}}}|s^x6|j|ƒD ](}| j|ƒ\}}|dk	r | j|||ƒ q W | j|d||fƒ dS )zA Expands the contents of a specified node (if required).
        NT)rŒ   Úget_childrenr£   r°   r©   )rj   ru   rœ   r‘   r�   ÚchildÚ
child_noderm   rm   rn   r–   3  s    zSimpleEditor._expand_nodec             c   s<   | j }|j|ƒ\}}x"|jƒ r6|V  |j||ƒ\}}qW dS )z> Returns each of the child nodes of a specified node.
        N)rC   ZGetFirstChildrq   ZGetNextChild)rj   ru   r-   r”   Úcookierm   rm   rn   rŽ   F  s
    
zSimpleEditor._nodesc             C   s   dd„ | j |ƒD ƒS )z< Returns all child node ids of a specified node id.
        c             S   s   g | ]}|‘qS rm   rm   )Ú.0r”   rm   rm   rn   ú
<listcomp>R  s    z+SimpleEditor._nodes_for.<locals>.<listcomp>)rŽ   )rj   ru   rm   rm   rn   rµ   O  s    zSimpleEditor._nodes_forc             C   sZ   | j j|ƒ}|jƒ sdS x<t| j|ƒƒD ]*\}}||kr(| j|ƒ\}}}|||fS q(W d S )N)NNN)rC   ÚGetItemParentrq   r¶   rŽ   rŒ   )rj   ru   Úpnidr¼   r”   ÚignoreZpnodeZpobjectrm   rm   rn   Ú_node_indexX  s    zSimpleEditor._node_indexc             C   s   |j |ƒo|j|ƒS )z> Returns whether a specified object has any children.
        )Úallows_childrenr´   )rj   r‘   r�   rm   rm   rn   rš   g  s    zSimpleEditor._has_childrenc             C   s    |r|j |ƒ rdS |j||ƒS )zB Returns whether a given object is droppable on the node.
        F)Z
can_insertÚcan_add)rj   r‘   r�   Ú
add_objectZ
for_insertrm   rm   rn   Ú_is_droppablep  s    zSimpleEditor._is_droppablec             C   s(   |j ||ƒ}||k	s| r|S tj|ƒS )z< Returns a droppable version of a specified object.
        )Zdrop_objectÚcopyÚdeepcopy)rj   r‘   r�   Zdropped_objectÚ	make_copyÚ
new_objectrm   rm   rn   Ú_drop_object|  s    zSimpleEditor._drop_objectFc             C   sÒ   | j dkrdS |j||ƒ}t|tjƒr¢|jdƒrHt|dƒ}|dkr d	S qÆ|dd… dkrj|dd
… }| }n*|j|ƒ}t|tjƒrŠ||g}n
|j|ƒ t	||ƒj
}n$t|t	ƒr´|j
}ntddj|ƒ ƒ‚| j j|ƒS )z9 Returns the index of the specified object icon.
        Nr"   ú@é   ú<z8Icon value must be a string or IImageResource instance: z
given {!r}r9   r9   r9   )rL   Zget_iconÚ
isinstanceÚsixÚstring_typesÚ
startswithr   Zget_icon_pathrA   r   Zabsolute_pathÚ
ValueErrorÚformatZGetIndex)rj   r‘   r�   r“   Z	icon_nameÚimageÚpathrm   rm   rn   r¤   ‰  s,    






zSimpleEditor._get_iconc             C   s>   |j |ƒr*|j|| jdƒ |j|| jdƒ |j|| jdƒ dS )z: Adds the event listeners for a specified object.
        FN)rÈ   Úwhen_children_replacedÚ_children_replacedÚwhen_children_changedÚ_children_updatedÚwhen_label_changedÚ_label_updated)rj   r‘   r�   rm   rm   rn   r¨   ®  s    
zSimpleEditor._add_listenersc             C   s>   |j |ƒr*|j|| jdƒ |j|| jdƒ |j|| jdƒ dS )z> Removes any event listeners from a specified object.
        TN)rÈ   rÜ   rÝ   rÞ   rß   rà   rá   )rj   r‘   r�   rm   rm   rn   r¸   »  s    
zSimpleEditor._remove_listenersr,   c       	      C   sP   | j t|ƒ }x&|D ]\}}||krP qW |d d }| j|ƒ\}}}|||fS )zl Returns the tree node data for a specified object in the form
            ( expanded, node, nid ).
        r   r"   )rM   r/   rŒ   )	rj   r�   r.   r½   Úname2ru   rœ   r‘   rÆ   rm   rm   rn   ry   É  s    zSimpleEditor._object_infoc       	      C   sL   g }xB| j t|ƒ D ]0\}}||kr| j|ƒ\}}}|j|||fƒ qW |S )z€ Returns the tree node data for a specified object as a list of the
            form: [ ( expanded, node, nid ), ... ].
        )rM   r/   rŒ   rA   )	rj   r�   r.   Úresultrâ   ru   rœ   r‘   rÆ   rm   rm   rn   Ú_object_info_forØ  s    zSimpleEditor._object_info_forc       	         s*  t ˆtƒr(tˆƒdkr(t ˆd tƒr(ˆS | j}‡fdd„|jD ƒ}t|ƒdkrZˆ|d fS t|ƒdkrtˆtˆd�fS |d j‰ ‡ fdd„|D ƒ}t|ƒdkr¨ˆ|d fS d}x6t|ƒD ]"\}}|j	ˆƒd	kr¶|}||= P q¶W |d }|ft|ƒ }||j
k�rˆ|j
| fS t||d
� |j
|< }ˆ|fS )zB Returns the TreeNode associated with a specified object.
        rw   r"   c                s"   g | ]}ˆ d k	r|j ˆ ƒr|‘qS )N)Zis_node_for)rÂ   r‘   )r�   rm   rn   rÃ   ñ  s    z*SimpleEditor._node_for.<locals>.<listcomp>r   )Úadapterc                s   g | ]}ˆ |j kr|‘qS rm   )Únode_for)rÂ   r‘   )Úbaserm   rn   rÃ   ÿ  s    Nr,   )Ú	root_nodeÚnodes)rÔ   Útupler·   r   r:   ré   r   ræ   r¶   r§   Zmulti_nodesr   )	rj   r�   r:   ré   rè   r¼   r‘   r˜   Z
multi_noderm   )rç   r�   rn   r£   è  s6    
zSimpleEditor._node_forc             C   s*   x$| j jD ]}t|t|jƒƒr
|S q
W dS )zA Returns the TreeNode associated with a specified class.
        N)r:   ré   Ú
issubclassrê   ræ   )rj   Úklassr‘   rm   rm   rn   Ú_node_for_class"  s    zSimpleEditor._node_for_classc             C   s8   x2| j jD ]&}x |jD ]}||jkr||fS qW q
W dS )zL Returns the node and class associated with a specified class name.
        N)NN)r:   ré   ræ   Ú__name__)rj   Ú
class_namer‘   rì   rm   rm   rn   Ú_node_for_class_name.  s
    
z!SimpleEditor._node_for_class_namec             C   s   | j |jƒ ƒ dS )z0 Updates the icon for a specified node.
        N)Ú_update_icon_for_nidÚGetItem)rj   r‰   r“   rm   rm   rn   Ú_update_icon;  s    zSimpleEditor._update_iconc             C   sP   | j dk	rL| j|ƒ\}}}| j|||ƒ}| jj||tjƒ | jj||tjƒ dS )z3 Updates the icon for a specified node ID.
        N)rL   rŒ   r¤   rC   ZSetItemImagerB   ZTreeItemIcon_NormalZTreeItemIcon_Selected)rj   ru   rœ   r‘   r�   r¬   rm   rm   rn   rñ   D  s
    
z!SimpleEditor._update_icon_for_nidc             C   s‚   y|j ƒ }W n   |jƒ }Y nX d}t|dƒr8|jƒ }|dksJ|jƒ  rZ| jj|ƒ\}}|jƒ rt| j|ƒ||f S ddd||fS )zC Unpacks an event to see whether a tree item was involved.
        Nrò   )ÚGetPositionZGetPointÚhasattrrò   rq   rC   ÚHitTestrŒ   )rj   r‰   Úpointru   Úflagsrm   rm   rn   Ú_unpack_eventQ  s    
zSimpleEditor._unpack_eventc             C   s8   | j j|ƒ\}}|jƒ r*| j|ƒ||f S ddd||fS )zB Returns information about the node at a specified point.
        N)rC   rö   rq   rŒ   )rj   r÷   ru   rø   rm   rm   rn   Ú	_hit_testi  s    zSimpleEditor._hit_testc             C   s6   | j }| jj|jƒ |jdkr2|jdk	r2|jj|_dS )z+ Begins an "undoable" transaction.
        r"   Nr9   )r@   rN   rA   ÚhistoryÚnow)rj   r@   rm   rm   rn   Ú_begin_undou  s    zSimpleEditor._begin_undoc             C   s   | j jƒ dkrd| j_ d S )Nr"   r9   r9   )rN   r‹   r@   )rj   rm   rm   rn   Ú	_end_undo�  s    zSimpleEditor._end_undoc             C   s   t |||j|j|jd�S )N)r�   r.   r³   ÚaddedÚremoved)r   r³   rÿ   r   )rj   r�   r.   r‰   rm   rm   rn   Ú_get_undo_item‰  s
    zSimpleEditor._get_undo_itemc          
   C   s6   z&| j ƒ  |rtj|ƒ}|j||ƒ W d| jƒ  X dS )z0 Performs an undoable append operation.
        N)rý   rÌ   rÍ   Zappend_childrþ   )rj   r‘   r�   r’   rÎ   rm   rm   rn   Ú_undoable_append”  s    
zSimpleEditor._undoable_appendc          
   C   s8   z(| j ƒ  |rtj|ƒ}|j|||ƒ W d| jƒ  X dS )z0 Performs an undoable insert operation.
        N)rý   rÌ   rÍ   Zinsert_childrþ   )rj   r‘   r�   r³   r’   rÎ   rm   rm   rn   Ú_undoable_insert£  s    
zSimpleEditor._undoable_insertc          
   C   s(   z| j ƒ  |j||ƒ W d| jƒ  X dS )z0 Performs an undoable delete operation.
        N)rý   Zdelete_childrþ   )rj   r‘   r�   r³   rm   rm   rn   Ú_undoable_delete²  s    zSimpleEditor._undoable_deletec             C   sJ   | j jt|ƒƒ}|dkrdS x(|D ]\}}||kr"|S q"W |d d S dS )zB Gets the ID associated with a specified object (if any).
        Nr   r"   )rM   Úgetr/   )rj   r�   r.   r½   râ   ru   rm   rm   rn   Ú_get_object_nid¿  s    zSimpleEditor._get_object_nidc             C   s4   | j }|jdk	r0|jdƒ |jjƒ  d |_|_dS )z2 Clears the current editor pane (if any).
        N)r=   r>   rG   rt   r?   )rj   r2   rm   rm   rn   r»   Ð  s
    


zSimpleEditor._clear_editorc             C   s   || j kr| jS | jj|ƒS )z& Gets the node specific data.
        )r¦   Ú_root_nid_datarC   Z	GetPyData)rj   ru   rm   rm   rn   rŒ   Ý  s    
zSimpleEditor._get_node_datac             C   s$   || j kr|| _n| jj||ƒ dS )z& Sets the node specific data.
        N)r¦   r  rC   Z	SetPyData)rj   ru   r’   rm   rm   rn   r©   å  s    
zSimpleEditor._set_node_datac             C   s   | j |ƒd S )z; Gets the object associated with a specified node.
        rw   )rŒ   )rj   ru   rm   rm   rn   Ú
get_objectó  s    zSimpleEditor.get_objectc             C   s6   | j ||ƒ}|dk	r2| jj|ƒ}|jƒ r2| j|ƒS dS )zi Returns the object that is the immmediate parent of a specified
            object in the tree.
        N)r  rC   rÄ   rq   r  )rj   r�   r.   ru   rÅ   rm   rm   rn   Ú
get_parentý  s    
zSimpleEditor.get_parentc             C   s&   | j ||ƒ}|dk	r"| j|ƒd S dS )z> Returns the node associated with a specified object.
        Nr"   )r  rŒ   )rj   r�   r.   ru   rm   rm   rn   Úget_node  s    zSimpleEditor.get_nodec             C   sž   | j rd| _ |jƒ  dS |jƒ }| j}| j|ƒ\}}}|j|ƒr�|}x"|j|ƒ}|jƒ sZP |j|ƒ qFW |}x"|j	|ƒ}|jƒ s‚P |j|ƒ qnW | j
|ƒ dS )z( Handles a tree node expanding.
        FN)r~   ÚVetorò   rC   rŒ   Zcan_auto_closeZGetPrevSiblingrq   ZCollapseZGetNextSiblingr–   )rj   r‰   ru   r-   rœ   r‘   r�   Úsnidrm   rm   rn   rV     s*    


z$SimpleEditor._on_tree_item_expandingc             C   s   | j |dƒ dS )z- Handles a tree node being expanded.
        TN)ró   )rj   r‰   rm   rm   rn   rX   @  s    z#SimpleEditor._on_tree_item_expandedc             C   s   | j rd| _ |jƒ  dS )z) Handles a tree node collapsing.
        FN)r~   r  )rj   r‰   rm   rm   rn   rZ   I  s    z%SimpleEditor._on_tree_item_collapsingc             C   s   | j |dƒ dS )z. Handles a tree node being collapsed.
        FN)ró   )rj   r‰   rm   rm   rn   r\   T  s    z$SimpleEditor._on_tree_item_collapsedNc             C   sÊ  | j r
dS d}d}| jjƒ }g }xJ|D ]B}|jƒ s4q&| j|ƒ\}}}	|j|	ƒ ||d kr&|	}|j|ƒ}q&W | jjdkrŒd| _	|| _
d| _	nd| _	|| _
d| _	|dkr¸| jj| jj|ƒ | j}
|
dk	�rÆ|
jƒ  | jƒ  |dk	�rŠ|j|ƒ}|dkpüt|tƒ�r
|j|ƒ}| jjdk	�s$|jdk�r6|j|
|dd�}n|j|
|dd�}| j|_||
_||
_tjtjƒ}|j|jd	tj ƒ |
j!|ƒ |
j"ƒ  |
j#ƒ \}}|
j$tj%||d	 ƒƒ |
j$tj%||ƒƒ |
j&ƒ  dS )
z- Handles a tree node being selected.
        NTr   r‚   FZsubpanel)rk   ÚviewÚkindZpanelr"   )'r¹   rC   ZGetSelectionsrq   rŒ   rA   Úselectr:   r…   r|   r3   r@   ÚevaluateZ	on_selectr=   ZFreezer»   Zget_viewrÔ   ÚstrZ
trait_viewrû   r  Úedit_traitsrk   r>   r?   rB   rH   rI   ÚAddr0   ZEXPANDrG   ZLayoutZGetSizeZSetSizerJ   ZThaw)rj   r‰   r�   Znot_handledÚnidsr3   ru   rœ   r‘   Z
sel_objectr2   r  r@   ZsizerZdxZdyrm   rm   rn   r`   ]  sb    








z!SimpleEditor._on_tree_sel_changedc             C   s†   | j j|jƒ ƒ\}}|tj@ rT| j|ƒ\}}}| jjdk	rx| jj	| jj|ƒ d| _
n$| jrx| jjdk	rx| jj	| jjdƒ |jdƒ dS )z3 Handles the mouse moving over a tree node
        NT)rC   rö   rô   rB   ZTREE_HITTEST_ONITEMLABELrŒ   r:   Zon_hoverr@   r  r~   ÚSkip)rj   r‰   r/   rø   rœ   r‘   r�   rm   rm   rn   ri   ·  s    
zSimpleEditor._on_hoverc             C   s^   | j |jƒ ƒ\}}}|j|ƒdkrH| jjdk	rN| jj| jj|ƒ d| _nd| _|| _|| _dS )z. Handles a tree item being activated.
        TN)	rŒ   rò   r4   r:   Zon_activatedr@   r  r~   r6   )rj   r‰   rœ   r‘   r�   rm   rm   rn   r^   Ê  s    z$SimpleEditor._on_tree_item_activatedc             C   sh   |j ƒ }| jj|ƒ}d}|jƒ r:| j|ƒ\}}}|j|ƒ}|r\| j|ƒ\}}}|j|ƒr\dS |jƒ  dS )z> Handles the user starting to edit a tree node label.
        TN)rò   rC   rÄ   rq   rŒ   Ú
can_renameÚcan_rename_mer  )rj   r‰   rE   rk   r  rœ   r‘   r�   rm   rm   rn   rd   á  s    

z&SimpleEditor._on_tree_begin_label_editc          	   C   sR   |j ƒ }t|ƒdkrF| j|jƒ ƒ\}}}y|j||ƒ dS    Y nX |jƒ  dS )z> Handles the user completing tree node label editing.
        r   N)ZGetLabelr·   rŒ   rò   Ú	set_labelr  )rj   r‰   rK   rœ   r‘   r�   rm   rm   rn   rf   ö  s    z$SimpleEditor._on_tree_end_label_editc             C   sN   t dk	rJ| j|ƒ\}}}}}|dk	rJz|| _t | j|j|ƒƒ W dd| _X dS )z; Handles a drag operation starting on a tree node.
        N)r   rù   Ú	_draggingrC   Zget_drag_object)rj   r‰   rœ   r‘   r�   ru   r÷   rm   rm   rn   rb   
  s    z SimpleEditor._on_tree_begin_dragc             C   sT   |j ƒ }|jƒ rH| j|ƒ}|dk	rH|\}}}|j|ƒ}|dkrH|j|ƒ |jƒ  dS )z3 Handles a tooltip request on a tree node.
        Nr,   )rò   rq   rŒ   Zget_tooltipZ
SetToolTipr  )rj   r‰   ru   Z	node_datarœ   r‘   r�   Ztooltiprm   rm   rn   rh     s    



z%SimpleEditor._on_tree_item_gettooltipc             C   sb   | j |ƒ\}}}}}|dk	rV|j|ƒdkrP| jjdk	rV| jj| jj|ƒ d| _nd| _|jƒ  dS )zL Handle left mouse dclick to emit dclick event for associated node.
        NT)rù   r6   r:   Z	on_dclickr@   r  r~   r  )rj   r‰   rœ   r‘   r�   ru   r÷   rm   rm   rn   rT   -  s    zSimpleEditor._on_left_dclickc             C   sZ   | j |ƒ\}}}}}|dk	rN|j|ƒdkrH| jjdk	rH| jj| jj|ƒ || _|jƒ  dS )z9 Handles the user right clicking on a tree node.
        NT)rù   r5   r:   Zon_clickr@   r  r  )rj   r‰   rœ   r‘   r�   ru   r÷   rm   rm   rn   rQ   H  s    zSimpleEditor._on_left_downc             C   s\  | j |ƒ\}}}}}|dk	�rX|||f| _|| || jj| jjdœ| _| jj|ƒ}|jƒ rj| j	|ƒ\}}	}
nd }	}
|| _
|	| _|
| _|j|ƒ}|dkr¤| j||ƒ}nVt|tƒrö|jtƒ}|dk	rúd|_| j||ƒ}t|ƒdkrú|jdt|ddiŽƒ nd}|dk	�r:|j| j| ƒ}| jj||d d |d d ƒ |jƒ  d | _ | _ | _
 | _| _dS )	z9 Handles the user right clicking on a tree node.
        N)r�   r2   r‘   r½   Úhandlerr,   r   r.   ÚNewé
   r"   )rù   Ú_datar@   r½   r  Ú_contextrC   rÄ   rq   rŒ   Ú
_menu_nodeÚ_menu_parent_nodeÚ_menu_parent_objectZget_menuÚ_standard_menurÔ   r   Z
find_groupr   r/   Ú_new_actionsr·   ÚinsertZcreate_menuZPopupMenuXYZDestroy)rj   r‰   rœ   r‘   r�   ru   r÷   rÅ   rÆ   Zparent_nodeZparent_objectÚmenuÚgroupÚactionsZwxmenurm   rm   rn   rS   ^  s@    




zSimpleEditor._on_right_downc             C   sR   t tttƒ ttƒ tg}| j||ƒ}t|ƒdkrJt|ddiŽtƒ g|dd…< t|Ž S )z6 Returns the standard contextual pop-up menu.
        r   r.   r  )	r   r   r   r   r   r   r#  r·   r   )rj   r‘   r�   r'  Úitemsrm   rm   rn   r"  ™  s    
zSimpleEditor._standard_menuc       
      C   s”   | j d }g }|j|ƒ}t|ƒdkr�xj|D ]b}d}t|tƒrD|\}}| j|ƒ}|dk	r*|j}|j|ƒ}	|	dkrr|}	|jt	|	d||f d�ƒ q*W |S )zA Returns a list of Actions that will create new objects.
        r"   r   FNr,   zeditor._menu_new_node('%s',%s))r.   Úaction)
r  Zget_addr·   rÔ   rê   rí   rî   Úget_namerA   r   )
rj   r‘   r�   r(  Úaddrì   ÚpromptÚadd_noderï   r.   rm   rm   rn   r#  ª  s&    





zSimpleEditor._new_actionsc             C   s.   | j }t|tƒr|j| jƒS |d k	o,|j|ƒS )N)r   rÔ   r   Úcan_copyr!  )rj   r�   rk   rm   rm   rn   Ú_is_copyableÅ  s    
zSimpleEditor._is_copyablec             C   sV   | j }t|tƒr*|j| jƒo&|j| jƒ}n|d k	oD|j|ƒoD|j|ƒ}|oT| jj|ƒS )N)r   rÔ   r   r.  r!  Ú
can_deleter  Úcan_delete_me)rj   r�   rk   Zcan_cutrm   rm   rn   Ú_is_cutableË  s    


zSimpleEditor._is_cutablec             C   s   ddl m} | jj||jƒS )Nr   )Ú	clipboard)Úpyface.wx.clipboardr3  r  rÉ   Zobject_type)rj   r�   r3  rm   rm   rn   Ú_is_pasteableÖ  s    zSimpleEditor._is_pasteablec             C   s@   | j }t|tƒr|j| jƒ}n|d k	o.|j|ƒ}|o>| jj|ƒS )N)r   rÔ   r   r0  r!  r  r1  )rj   r�   rk   r0  rm   rm   rn   Ú_is_deletableÛ  s
    
zSimpleEditor._is_deletablec             C   sF   | j }t|tƒr|j| jƒ}n|d k	r2|j|ƒ}nd}|oD| jj|ƒS )NT)r   rÔ   r   r  r!  r  r  )rj   r�   rk   r  rm   rm   rn   Ú_is_renameableã  s    
zSimpleEditor._is_renameablec             C   sà  t |tƒr2tj}x|D ]}| j||||ƒ}qW |S | jtj||ƒƒ\}}}	}
}|dk	�rÚ|tjk�r| j||	|dƒsztjS | j	dk	rØ| j
||	|dƒ}|dk	rÖz.| jƒ  | j| j| j	ƒŽ  | j||	|dƒ W d| jƒ  X n(| j
||	|ƒ}|dk	�r | j||	|dƒ |S | j|
ƒ\}}}|dk	�rÚ| j	dk	�r¬| j
|||dƒ}|dk	�rÖ| j| j	ƒ\}}}||k�rr||k�rr|d8 }z,| jƒ  | j|||ƒ | j||||dƒ W d| jƒ  X n*| j
|||ƒ}|dk	�rÖ| j||||dƒ |S tjS )z< Handles a Python object being dropped on the tree.
        NFr"   )rÔ   ÚlistrB   ÚDragNoneÚwx_dropped_onrú   ÚPointZDragMoverË   r  rÐ   rý   r  rÇ   r  rþ   r  )rj   ÚxÚyr’   Údrag_resultÚrcrE   rœ   r‘   r�   ru   r÷   Zto_nodeZ	to_objectZto_indexZ	from_nodeZfrom_objectZ
from_indexrm   rm   rn   r:  ó  sZ    











zSimpleEditor.wx_dropped_onc             C   sŠ   | j tj||ƒƒ\}}}}}	d}
|dk	rF|tjkrF| j|ƒ\}}}d}
| jdk	rh| j| j||ƒ rhtjS |dk	r„| j||||
ƒr„|S tjS )z> Handles a Python object being dragged over the tree.
        FNT)	rú   rB   r;  ZDragCopyrÇ   r  Ú_is_drag_okr9  rË   )rj   r<  r=  r’   r>  rœ   r‘   r�   ru   r÷   r$  r³   rm   rm   rn   Úwx_drag_over3  s    
zSimpleEditor.wx_drag_overc             C   sH   |d ks||krdS x.| j |ƒD ] }| j|| j|ƒd |ƒs dS q W dS )NFrw   T)rŽ   r@  rŒ   )rj   r  ÚsourceÚtargetr”   rm   rm   rn   r@  L  s    zSimpleEditor._is_drag_okc             C   s,   |j j}| j|j|dƒ | j|j|dƒ dS )z= Adds a menu item to the menu bar being constructed.
        ZenabledÚcheckedN)rE   r)  Ú	eval_whenZenabled_whenZchecked_when)rj   Z	menu_itemr)  rm   rm   rn   Úadd_to_menu]  s    zSimpleEditor.add_to_menuc             C   s   | j |ƒ dS )z? Adds a toolbar item to the toolbar being constructed.
        N)rF  )rj   Ztoolbar_itemrm   rm   rn   Úadd_to_toolbarh  s    zSimpleEditor.add_to_toolbarc             C   sD   |j dkr t|j tƒ | jƒs dS |jdkr@t|jtƒ | jƒs@dS dS )zM Returns whether the action should be defined in the user interface.
        r,   FT)Zdefined_whenÚevalÚglobalsr  Zvisible_when)rj   r)  rm   rm   rn   Úcan_add_to_menuq  s    

zSimpleEditor.can_add_to_menuc             C   s
   | j |ƒS )za Returns whether the toolbar action should be defined in the user
            interface.
        )rJ  )rj   r)  rm   rm   rn   Úcan_add_to_toolbarƒ  s    zSimpleEditor.can_add_to_toolbarc             C   s   | j j| j|ƒ dS )zE Performs the action described by a specified Action object.
        N)r@   Zdo_undoableÚ_perform)rj   r)  Zaction_eventrm   rm   rn   Úperform�  s    zSimpleEditor.performc       
      C   sÂ   | j \}}}|j}| jj}| jj}|jdƒdkrˆ|jdƒdk rF|d7 }yt|tƒ || |||dœƒ W n   ddlm	} |ƒ  Y nX d S t
||d ƒ}	|	d k	rª|	||ƒ d S |jd k	r¾|j|ƒ d S )NÚ.r   ú(z())r�   r2   r‘   r½   r  )Úraise_to_debug)r  r)  r@   r½   r  ÚfindrH  rI  Útraitsui.apirP  ÚgetattrZ
on_perform)
rj   r)  r‘   r�   ru   Úmethod_namer½   r  rP  Úmethodrm   rm   rn   rL  ’  s0    

zSimpleEditor._performc             C   s0   |dkr,d}t |tƒ | jƒs d}t|||ƒ dS )z¢ Evaluates a condition within a defined context, and sets a
        specified object trait based on the result, which is assumed to be a
        Boolean.
        r,   TFN)rH  rI  r  Úsetattr)rj   Ú	conditionr�   Ztraitr‡   rm   rm   rn   rE  ·  s
    zSimpleEditor.eval_whenc             C   s"   ddl m} | jd |_d| _dS )zB Copies the current tree node object to the paste buffer.
        r   )r3  r"   N)r4  r3  r  r’   )rj   r3  rm   rm   rn   Ú_menu_copy_nodeÈ  s    zSimpleEditor._menu_copy_nodec             C   s8   ddl m} | j\}}}||_d| _| j| j|ƒŽ  dS )zC  Cuts the current tree node object into the paste buffer.
        r   )r3  N)r4  r3  r  r’   r  rÇ   )rj   r3  r‘   r�   ru   rm   rm   rn   Ú_menu_cut_nodeÔ  s
    zSimpleEditor._menu_cut_nodec             C   s4   ddl m} | j\}}}d| _| j|||jdƒ dS )z\ Pastes the current contents of the paste buffer into the current
            node.
        r   )r3  NF)r4  r3  r  r  Zobject_data)rj   r3  r‘   r�   ru   rm   rm   rn   Ú_menu_paste_nodeâ  s    zSimpleEditor._menu_paste_nodec             C   sŠ   | j \}}}d| _ |j|ƒ}|dk	r†|dk	rv| jjdkrvtj| jd|j|ƒ dtjtj	B tj
B d�}|jƒ tjkrvdS | j| j|ƒŽ  dS )z1 Deletes the current node from the tree.
        NFTz#Are you sure you want to delete %s?zConfirm Deletion)r(   )r  Zconfirm_deleter@   rû   rB   ZMessageDialogrC   r¥   ÚOKZCANCELZICON_EXCLAMATIONZ	ShowModalZID_OKr  rÇ   )rj   r‘   r�   ru   r?  Zdlgrm   rm   rn   Ú_menu_delete_nodeð  s    

zSimpleEditor._menu_delete_nodec             C   sN   | j \}}}d| _ t|j|ƒd�}|jƒ jrJ|jjƒ }|dkrJ|j||ƒ dS )z( Renames the current tree node.
        N)rK   r,   )r  ÚObjectLabelr¥   r  rã   rK   Ústripr  )rj   r‘   r�   ru   Zobject_labelrK   rm   rm   rn   Ú_menu_rename_node	  s    

zSimpleEditor._menu_rename_nodec       	      C   sn   | j \}}}d| _ | j|ƒ\}}|ƒ }| s>|j| jdd�jrj| j|||dƒ | jjrj| jj	| jj
|ƒƒ dS )z0 Adds a new object to the current node.
        NZ	livemodal)rk   r  F)r  rð   r  r0   rã   r  r:   r<   rC   rx   ZGetLastChild)	rj   rï   r,  r‘   r�   ru   Únew_nodeÚ	new_classrÏ   rm   rm   rn   Ú_menu_new_node  s    
zSimpleEditor._menu_new_nodec             C   s¬   | j }x | j||ƒD ]�\}}}|j|ƒ}|r|x| j|ƒD ]}	| j|	ƒ q8W x0|D ](}
| j|
ƒ\}
}|dk	rP| j|||
ƒ qPW |j|t|ƒdkƒ |j	|ƒr|j
|ƒ qW dS )zC Handles the children of a node being completely replaced.
        Nr   )rC   rä   r¾   rµ   rr   r£   r°   r›   r·   r²   r—   )rj   r�   r.   Únewr-   rœ   r‘   ru   Úchildrenr”   r¿   rÀ   rm   rm   rn   rÝ   .  s    


zSimpleEditor._children_replacedc             C   s4  |dd… }| j | j|||ƒ |j}|t|jƒ }| j}xö| j||ƒD ]æ\}}}	t|j|ƒƒ}
|rìx$| j|	ƒ||… D ]}| j	|ƒ qvW |
t|jƒ }d}xP|j
D ]F}| j|ƒ\}}|dk	r¢||k rÌ|| nd}| j|	|||ƒ |d7 }q¢W |j|	|
dkƒ |jƒ }|j|ƒrF|	|k�s"| jj rF|j|	ƒ qFW dS )z7 Handles the children of a node being changed.
        Né   r   r"   iúÿÿÿ)Z
log_changer  r³   r·   r   rC   rä   r¾   rµ   rr   rÿ   r£   r¯   r›   rp   r²   r:   r„   r—   )rj   r�   r.   r‰   ÚstartÚendr-   rœ   r‘   ru   rŸ   r”   Ú	remainingZchild_indexr¿   rÀ   Zinsert_indexÚrootrm   rm   rn   rß   M  s0    

zSimpleEditor._children_updatedc             C   s`   i }xV| j t|ƒ D ]D\}}||krd||< | j|ƒd }| jj||j|ƒƒ | j|ƒ qW dS )z8  Handles the label of an object being changed.
        Nr"   )rM   r/   rŒ   rC   ZSetItemTextr¥   rñ   )rj   r�   r.   rK   r  râ   ru   r‘   rm   rm   rn   rá   |  s    zSimpleEditor._label_updatedc             C   s8   | j r4t|tƒr|jdƒ}n|}| jjƒ j| j|ƒ dS )z` Restores any saved user preference information associated with the
            editor.
        Ú	structureN)rD   rÔ   Údictr  r0   ÚGetSizerZSetStructure)rj   Zprefsrj  rm   rm   rn   Úrestore_prefsŽ  s
    
zSimpleEditor.restore_prefsc             C   s   | j rd| jjƒ jƒ iS dS )zM Returns any user preference information associated with the editor.
        rj  N)rD   r0   rl  ZGetStructure)rj   rm   rm   rn   Ú
save_prefs�  s    zSimpleEditor.save_prefs)T)T)F)r,   )r,   )T)T)r,   )r,   )r,   )N)N)F)r,   N)hrî   Ú
__module__Ú__qualname__Ú__doc__Z
scrollabler	   rz   r   r3   r4   r5   r6   r7   ro   rt   r{   r}   r   r;   rŠ   r•   r™   r    r¡   r­   r®   r°   r¯   rr   r–   rŽ   rµ   rÇ   rš   rË   rÐ   r¤   r¨   r¸   ry   rä   r£   rí   rð   ró   rñ   rù   rú   rý   rþ   r  r  r  r  r  r»   rŒ   r©   r  r	  r
  rV   rX   rZ   r\   r`   ri   r^   rd   rf   rb   rh   rT   rQ   rS   r"  r#  r/  r2  r5  r6  r7  r:  rA  r@  rF  rG  rJ  rK  rM  rL  rE  rX  rY  rZ  r\  r_  rb  rÝ   rß   rá   rm  rn  Ú__classcell__rm   rm   )rv   rn   r'   J   sÆ    
	
'	
"			

%

:	





$		
Z;@	

%

/r'   c               @   s(   e Zd ZdZeZedddddgd�ZdS )	r]  z& An editable label for an object.
    rK   z
Edit LabelÚmodalr[  ZCancel)Útitler  ZbuttonsN)rî   ro  rp  rq  r   rK   r   Ztraits_viewrm   rm   rm   rn   r]  ¬  s   r]  );rq  Ú
__future__r   rƒ   rB   rÌ   rÕ   Zpyface.wx.drag_and_dropr   r   Zpyface.ui.wx.image_listr   Z
traits.apir   r   r   r	   r
   rR  r   r   r   r   Ztraitsui.editors.tree_editorr   r   r   r   r   r   r   Ztraitsui.undor   Ztraitsui.tree_noder   Ztraitsui.menur   r   r   Z
pyface.apir   Zpyface.ui_traitsr   Zpyface.dock.apir   r   r   r    r!   Ú	constantsr#   r2   r$   Úhelperr%   r&   Zpaste_bufferr'   r]  rm   rm   rm   rn   Ú<module>   sN   $              p