3
=Ad]`	  ã               @   s`   d 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
 G dd	„ d	eƒZG d
d„ deƒZdS )z3 The *definition* of a menu in a menu bar or menu. é    )ÚInstanceÚListÚStré   )ÚGroup)ÚLocationé   )ÚSTRING_BASE_CLASSc                   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 t| ƒjf dti|—Ž dS )z Constructor. ÚklassN)Úsuperr
   Ú__init__r   )ÚselfÚkw)Ú	__class__© ús/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/envisage-4.7.2-py3.6.egg/envisage/ui/action/menu.pyr      s    zCGroup.__init__c                s(   t |tƒrt|d�}tt| ƒj|||ƒS )z Validate a value. )Úid)Ú
isinstancer	   r   r   r
   Úvalidate)r   ÚobjectÚnameÚvalue)r   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 )ÚMenuz3 The *definition* of a menu in a menu bar or menu. c             C   s
   d| j  S )z< Return the 'informal' string representation of the object. zMenu(%s))r   )r   r   r   r   Ú__str__A   s    zMenu.__str__c             C   s   | j jdƒS )z Trait initializer. ú&)r   Ústrip)r   r   r   r   Ú_id_defaultL   s    zMenu._id_defaultN)r   r   r   r   r   r   r   r   r
   ÚgroupsÚ
class_namer   Ú__repr__r"   r   r   r   r   r   ,   s   r   N)r   Z
traits.apir   r   r   Úgroupr   Úlocationr   Ú_compatr	   r
   r   r   r   r   r   Ú<module>   s    