- add missing TextInput component
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 20 May 2005 20:15:14 +0000 (20:15 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 20 May 2005 20:15:14 +0000 (20:15 +0000)
lib/python/Components/TextInput.py [new file with mode: 0644]

diff --git a/lib/python/Components/TextInput.py b/lib/python/Components/TextInput.py
new file mode 100644 (file)
index 0000000..98b440c
--- /dev/null
@@ -0,0 +1,31 @@
+from HTMLComponent import *
+from GUIComponent import *
+
+from tools import CONNECT, DISCONNECT
+
+from enigma import eInput, eInputContentString
+
+class TextInput(HTMLComponent, GUIComponent):
+       def __init__(self):
+               GUIComponent.__init__(self)
+               self.content = eInputContentString()
+
+       def contentChanged(self):
+               print "content changed to %s!" % (self.getText())
+       
+       def getText(self):
+               return self.content.getText()
+       
+       def setText(self, text):
+               # TODO :  support unicode!
+               self.content.setText(str(text))
+       
+       def GUIcreate(self, parent, skindata):
+               self.instance = eInput(parent)
+               CONNECT(self.instance.changed, self.contentChanged)
+               self.instance.setContent(self.content)
+       
+       def GUIdelete(self):
+               DISCONNECT(self.instance.changed, self.contentChanged)
+               self.instance.setContent(None)
+               self.instance = None