tuikit/scrollwindow.py
author Radek Brich <radek.brich@devl.cz>
Sat, 21 Feb 2015 12:01:57 +0100
changeset 118 8c7970520632
parent 75 2430c643838a
permissions -rw-r--r--
Add mouse events, event demo.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
74
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
from tuikit.window import Window
75
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
     2
from tuikit.scrollview import Scrolling
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
     3
from tuikit.layout import OffsetLayout
74
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
75
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
     6
class ScrollWindow(Window, Scrolling):
74
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
    def __init__(self):
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
        Window.__init__(self, inner_layout=OffsetLayout)
75
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
     9
        Scrolling.__init__(self)
74
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
75
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
    11
        self.vscroll.update_hint('margin', t=1, b=1)
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
    12
        self.hscroll.update_hint('margin', l=1, r=2)
74
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
    def add(self, widget, **kwargs):
23767a33a781 Add ScrollWindow. Rewrite EditBox to work with OffsetLayout. Add propery "exposed" to DrawEvent. Add Widget._view_size. Add config file (driver, log_level).
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
        Window.add(self, widget, **kwargs)
75
2430c643838a Clean up hints - add methods update_hint, hint_value to Widget. Split ScrollView into OffsetView and Scrolling components. Reimplement ScrollWindow using Scrolling component.
Radek Brich <radek.brich@devl.cz>
parents: 74
diff changeset
    16
        self._connect_child(widget)