File: i_task_pane.py

package info (click to toggle)
python-pyface 6.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,756 kB
  • sloc: python: 39,728; makefile: 79
file content (56 lines) | stat: -rw-r--r-- 1,486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Enthought library imports.
from traits.api import Any, Bool, HasTraits, Interface, Instance, \
     Str, Unicode

# Local imports.
from pyface.tasks.task import Task


class ITaskPane(Interface):
    """ The base interface for all panes (central and dock) in a Task.
    """

    #: The pane's identifier, unique within a Task.
    id = Str

    #: The pane's user-visible name.
    name = Unicode

    #: The toolkit-specific control that represents the pane.
    control = Any

    #: Does the pane currently have focus?
    has_focus = Bool

    #: The task with which the pane is associated. Set by the framework.
    task = Instance(Task)

    ###########################################################################
    # 'ITaskPane' interface.
    ###########################################################################

    def create(self, parent):
        """ Create and set the toolkit-specific control that represents the
            pane.
        """

    def destroy(self):
        """ Destroy the toolkit-specific control that represents the pane.
        """

    def set_focus(self):
        """ Gives focus to the control that represents the pane.
        """


class MTaskPane(HasTraits):
    """ Mixin containing common code for toolkit-specific implementations.
    """

    #### 'ITaskPane' interface ################################################

    id = Str
    name = Unicode
    control = Any
    has_focus = Bool(False)
    task = Instance(Task)