3
7ßL]ƒ
  ã               @   sz   d Z ddlmZmZmZmZ ddlmZmZm	Z	m
Z
 ddlmZ ddlmZmZ ddlmZ e
eƒG dd„ deeƒƒZd	S )
z8 The Qt-specific implementation of the text field class é    )Úabsolute_importÚdivisionÚprint_functionÚunicode_literals)ÚAnyÚInstanceÚUnicodeÚprovides)ÚQt)ÚIFieldÚMField)ÚWidgetc               @   sB   e Zd ZdZeZeZedƒZ	dd„ Z
dd„ Zddd	„Zd
d„ ZdS )ÚFieldz} The Qt-specific implementation of the field class

    This is an abstract class which is not meant to be instantiated.
    z&pyface.action.menu_manager.MenuManagerc             C   s
   | j jƒ S )z7 Toolkit specific method to get the control's tooltip. )ÚcontrolZtoolTip)Úself© r   ú>/tmp/pip-install-5sebvq2j/pyface/pyface/ui/qt4/fields/field.pyÚ_get_control_tooltip/   s    zField._get_control_tooltipc             C   s   | j j|ƒ dS )z7 Toolkit specific method to set the control's tooltip. N)r   Z
setToolTip)r   Útooltipr   r   r   Ú_set_control_tooltip3   s    zField._set_control_tooltipFc             C   sF   |r$| j jtjƒ | j jj| jƒ n| j jj| jƒ | j jtjƒ dS )z> Toolkit specific method to change the control menu observer. N)	r   ZsetContextMenuPolicyr
   ZDefaultContextMenuZcustomContextMenuRequestedZ
disconnectÚ_handle_control_context_menuÚconnectZCustomContextMenu)r   Úremover   r   r   Ú_observe_control_context_menu7   s    
z#Field._observe_control_context_menuc             C   s:   | j dk	r6| jdk	r6| jj| j ƒ}|j|jƒ |jƒ ƒ dS )z- Signal handler for displaying context menu. N)r   Úcontext_menuZcreate_menuÚshowÚxÚy)r   ÚposÚmenur   r   r   r   B   s    z"Field._handle_control_context_menuN)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úvaluer   r   r   r   r   r   r   r   r   r   r   r   r      s   
r   N)r#   Ú
__future__r   r   r   r   Z
traits.apir   r   r   r	   Zpyface.qt.QtCorer
   Zpyface.fields.i_fieldr   r   Zpyface.ui.qt4.widgetr   r   r   r   r   r   Ú<module>   s   