File: enaml_panes.py

package info (click to toggle)
python-pyface 4.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 9,512 kB
  • ctags: 6,310
  • sloc: python: 30,944; makefile: 82; sh: 5
file content (43 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download | duplicates (2)
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
#------------------------------------------------------------------------------
# Copyright (c) 2013, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------

# Enthought library imports.
from pyface.tasks.api import EnamlDockPane, EnamlTaskPane
import traits_enaml


class DummyDockPane(EnamlDockPane):
    id = 'example.dummy_dock_pane'
    name = 'Dummy Dock'

    def create_component(self):
        with traits_enaml.imports():
            from empty_form import EmptyForm
        return EmptyForm()


class DummyTaskPane(EnamlTaskPane):

    #### TaskPane interface ###################################################

    id = 'example.dummy_task_pane'
    name = 'Dummy Task'

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

    def create_component(self):
        with traits_enaml.imports():
            from employee_view import EmployeeView
        from employee import Employer, Employee

        boss_john = Employer(first_name='John', last_name='Paw',
                             company_name="Packrat's Cats")
        employee_mary = Employee(first_name='Mary', last_name='Sue',
                                 boss=boss_john)

        view = EmployeeView(employee=employee_mary)
        return view