a
    ©ˆcG
  ã                   @   sT   d Z ddlmZmZmZ ddlmZ ddlmZ G dd„ deƒZ	G dd	„ d	eƒZ
d
S )ú3 The *definition* of a menu in a menu bar or menu. é    )ÚInstanceÚListÚStré   )ÚGroup)ÚLocationc                       s,   e Zd ZdZ‡ fdd„Z‡ fdd„Z‡  ZS )ÚCGroupz² A trait type for a 'Group' or anything that can be cast to a 'Group'.

    Currently, the only cast allowed is from string -> Group using the
    string as the group's ID.

    c                    s   t ƒ jf dti|¤Ž dS )z Constructor. ÚklassN)ÚsuperÚ__init__r   )ÚselfÚkw©Ú	__class__© úZ/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/envisage/ui/action/menu.pyr       s    zCGroup.__init__c                    s$   t |tƒrt|d�}tƒ  |||¡S )z Validate a value. )Úid)Ú
isinstanceÚstrr   r   Úvalidate)r   ÚobjectÚnameÚvaluer   r   r   r   )   s    

zCGroup.validate)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__r   r   r   r   r	      s   	r	   c                   @   s8   e Zd ZdZeZeZeeƒZ	eZ
dd„ ZeZdd„ ZdS )ÚMenur   c                 C   s
   d| j  S )z< Return the 'informal' string representation of the object. zMenu(%s))r   ©r   r   r   r   Ú__str__G   s    zMenu.__str__c                 C   s   | j  d¡S )z Trait initializer. ú&)r   Ústripr    r   r   r   Ú_id_defaultR   s    zMenu._id_defaultN)r   r   r   r   r   r   r   r   r	   ÚgroupsÚ
class_namer!   Ú__repr__r$   r   r   r   r   r   2   s   r   N)r   Z
traits.apir   r   r   Úgroupr   Úlocationr   r	   r   r   r   r   r   Ú<module>
   s
   