Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

# Copyright 2009-2014 Luc Saffre 

# License: BSD (see file COPYING for details) 

""" 

Defines classes :class:`Frame` and :class:`FrameHandle` 

""" 

from builtins import object 

 

import logging 

logger = logging.getLogger(__name__) 

 

# from lino.core.utils import Handle 

from lino.core import actors 

 

 

class FrameHandle(object): 

 

    def __init__(self, frame): 

        #~ assert issubclass(frame,Frame) 

        self.actor = frame 

        # Handle.__init__(self) 

 

    def get_actions(self, *args, **kw): 

        return self.actor.get_actions(*args, **kw) 

 

    def __str__(self): 

        return "%s on %s" % (self.__class__.__name__, self.actor) 

 

 

class Frame(actors.Actor): 

    """Base clase for actors which open a window but, but this window is 

    neither a database table nor a detail form. 

 

    Example subclass is :class:`lino_xl.lib.extensible.CalendarPanel`. 

 

    """ 

    _handle_class = FrameHandle 

    editable = False 

 

    @classmethod 

    def get_actor_label(self): 

        return self._label or self.default_action.action.label