3
7ßL]¹  ã               @   sd   d Z ddlmZm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 )z2 The interface of a top-level application window. é    )ÚInstanceÚList)ÚMenuBarManagerÚStatusBarManagerÚToolBarManager)ÚIImageResource)ÚIWindowc               @   sh   e Zd ZdZeeƒZeeƒZee	ƒZ
eeƒZeeƒZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ ZdS )ÚIApplicationWindowa   The interface for a top-level application window.

    The application window has support for a menu bar, tool bar and a status
    bar (all of which are optional).

    Usage
    -----

    Create a sub-class of this class and override the
    :py:meth:`._create_contents` method.
    c             C   s   dS )ae   Create and return the window's contents.

        Parameters
        ----------
        parent : toolkit control
            The window's toolkit control to be used as the parent for
            widgets in the contents.

        Returns
        -------
        control : toolkit control
            A control to be used for contents of the window.
        N© )ÚselfÚparentr
   r
   ú?/tmp/pip-install-5sebvq2j/pyface/pyface/i_application_window.pyÚ_create_contents<   s    z#IApplicationWindow._create_contentsc             C   s   dS )zŸ Creates the menu bar (if required).

        Parameters
        ----------
        parent : toolkit control
            The window's toolkit control.
        Nr
   )r   r   r
   r
   r   Ú_create_menu_barK   s    z#IApplicationWindow._create_menu_barc             C   s   dS )z¡ Creates the status bar (if required).

        Parameters
        ----------
        parent : toolkit control
            The window's toolkit control.
        Nr
   )r   r   r
   r
   r   Ú_create_status_barT   s    z%IApplicationWindow._create_status_barc             C   s   dS )zŸ Creates the tool bar (if required).

        Parameters
        ----------
        parent : toolkit control
            The window's toolkit control.
        Nr
   )r   r   r
   r
   r   Ú_create_tool_bar]   s    z#IApplicationWindow._create_tool_barc             C   s   dS )z· Creates the 'trim' widgets (the widgets around the window).

        Parameters
        ----------
        parent : toolkit control
            The window's toolkit control.
        Nr
   )r   r   r
   r
   r   Ú_create_trim_widgetsf   s    z'IApplicationWindow._create_trim_widgetsc             C   s   dS )z% Sets the window icon (if required). Nr
   )r   r
   r
   r   Ú_set_window_icono   s    z#IApplicationWindow._set_window_iconN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ziconr   Úmenu_bar_managerr   Zstatus_bar_managerr   Útool_bar_managerr   Útool_bar_managersr   r   r   r   r   r   r
   r
   r
   r   r	      s   				r	   c                   s(   e Zd ZdZ‡ fdd„Zdd„ Z‡  ZS )ÚMApplicationWindowz¼ The mixin class that contains common code for toolkit specific
    implementations of the :py:class:`IApplicationWindow` interface.

    Implements: destroy(), _create_trim_widgets()
    c                sR   | j dk	r| j jƒ  | jdk	r(| jjƒ  x| jD ]}|jƒ  q0W tt| ƒjƒ  dS )z# Destroy the control if it exists. N)r   Údestroyr   r   Úsuperr   )r   r   )Ú	__class__r
   r   r   ~   s    



zMApplicationWindow.destroyc             C   s*   | j ƒ  | j|ƒ | j|ƒ | j|ƒ dS )z· Creates the 'trim' widgets (the widgets around the window).

        Parameters
        ----------
        parent : toolkit control
            The window's toolkit control.
        N)r   r   r   r   )r   r   r
   r
   r   r   �   s    


z'MApplicationWindow._create_trim_widgets)r   r   r   r   r   r   Ú__classcell__r
   r
   )r   r   r   s   s   r   N)r   Z
traits.apir   r   Zpyface.action.apir   r   r   Zpyface.i_image_resourcer   Zpyface.i_windowr   r	   Úobjectr   r
   r
   r
   r   Ú<module>   s   Z