diff options
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Clock.py | 6 | ||||
| -rw-r--r-- | lib/python/Components/GUIComponent.py | 6 | ||||
| -rw-r--r-- | lib/python/Components/GUISkin.py | 18 | ||||
| -rw-r--r-- | lib/python/Components/MenuList.py | 6 |
4 files changed, 33 insertions, 3 deletions
diff --git a/lib/python/Components/Clock.py b/lib/python/Components/Clock.py index e2d9d5f5..982d1c4a 100644 --- a/lib/python/Components/Clock.py +++ b/lib/python/Components/Clock.py @@ -20,7 +20,12 @@ class Clock(HTMLComponent, GUIComponent, VariableText): self.clockTimer = eTimer() self.clockTimer.timeout.get().append(self.doClock) + + def onShow(self): self.clockTimer.start(1000) + + def onHide(self): + self.clockTimer.stop() # "funktionalitaet" def doClock(self): @@ -39,4 +44,3 @@ class Clock(HTMLComponent, GUIComponent, VariableText): # ...und als HTML: def produceHTML(self): return self.getText() - diff --git a/lib/python/Components/GUIComponent.py b/lib/python/Components/GUIComponent.py index 1476ba83..493df681 100644 --- a/lib/python/Components/GUIComponent.py +++ b/lib/python/Components/GUIComponent.py @@ -18,6 +18,12 @@ class GUIComponent: def execEnd(self): pass + def onShow(self): + pass + + def onHide(self): + pass + # this works only with normal widgets - if you don't have self.instance, override this. def applySkin(self, desktop): if self.state == self.HIDDEN: diff --git a/lib/python/Components/GUISkin.py b/lib/python/Components/GUISkin.py index f97dd8bd..3aa9c851 100644 --- a/lib/python/Components/GUISkin.py +++ b/lib/python/Components/GUISkin.py @@ -6,7 +6,7 @@ class GUISkin: def __init__(self): self.onLayoutFinish = [ ] - pass + self.summaries = [ ] def createGUIScreen(self, parent, desktop): for (name, val) in self.items(): @@ -32,3 +32,19 @@ class GUISkin: def close(self): self.deleteGUIScreen() + + def createSummary(self): + return None + + def addSummary(self, summary): + self.summaries.append(summary) + + def removeSummary(self, summary): + self.summaries.remove(summary) + + def setTitle(self, title): + self.instance.setTitle(title) + self.title = title + + for x in self.summaries: + x.setTitle(title) diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py index 03e6be6d..40898095 100644 --- a/lib/python/Components/MenuList.py +++ b/lib/python/Components/MenuList.py @@ -9,6 +9,7 @@ class MenuList(HTMLComponent, GUIComponent): self.list = list self.l = eListboxPythonStringContent() self.l.setList(self.list) + self.onSelectionChanged = [ ] def getCurrent(self): return self.l.getCurrentSelection() @@ -16,9 +17,12 @@ class MenuList(HTMLComponent, GUIComponent): def GUIcreate(self, parent): self.instance = eListbox(parent) self.instance.setContent(self.l) + self.instance.selectionChanged.get().append(self.selectionChanged) def GUIdelete(self): self.instance.setContent(None) self.instance = None - + def selectionChanged(self): + for f in self.onSelectionChanged: + f() |
