tuikit/core/widget.py
changeset 112 ce2e67e7bbb8
parent 111 b055add74b18
child 113 6796adfdc7eb
equal deleted inserted replaced
111:b055add74b18 112:ce2e67e7bbb8
    38         #: Maximum size of widget. Widget will never be sized bigger than this.
    38         #: Maximum size of widget. Widget will never be sized bigger than this.
    39         #: None means no maximum size (infinite).
    39         #: None means no maximum size (infinite).
    40         self.sizemax = Size(None, None)
    40         self.sizemax = Size(None, None)
    41 
    41 
    42         #: Cursor is position where text input will occur.
    42         #: Cursor is position where text input will occur.
    43         #: It is displayed on screen if widget is active.
    43         self._cursor = Point()
    44         #: None means no cursor (hidden).
    44         #: Cursor is displayed on screen only if the widget is focused.
    45         self._cursor = None
    45         self._cursor_visible = False
    46 
    46 
    47         #: Hidden widget does not affect layout.
    47         #: Hidden widget does not affect layout.
    48         self.hidden = False
    48         self.hidden = False
    49         #: Allow keyboard focus for this widget.
    49         #: Allow keyboard focus for this widget.
    50         self.allow_focus = False
    50         self.allow_focus = False
    98         """
    98         """
    99         return buffer.clip_rect.moved(-buffer.origin.x, -buffer.origin.y)
    99         return buffer.clip_rect.moved(-buffer.origin.x, -buffer.origin.y)
   100 
   100 
   101     @property
   101     @property
   102     def cursor(self):
   102     def cursor(self):
   103         if self._cursor is not None:
   103         return self._cursor
   104             return Point(self._cursor)
   104 
       
   105     @property
       
   106     def cursor_visible(self):
       
   107         return self._cursor_visible
   105 
   108 
   106     ## events ##
   109     ## events ##
   107 
   110 
   108     def resize_event(self, ev):
   111     def resize_event(self, ev):
   109         self.resize(ev.w, ev.h)
   112         self.resize(ev.w, ev.h)