aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-01-19 03:19:41 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-01-19 03:19:41 +0000
commitb4448ddb042e5f5015125597633e368f17acbcec (patch)
tree95d49a485f3328a5591b127d3cb82bf036128c25 /lib/python
parent85f5c84f1e3e4d22fb1939751d39de03877b93d8 (diff)
downloadenigma2-b4448ddb042e5f5015125597633e368f17acbcec.tar.gz
enigma2-b4448ddb042e5f5015125597633e368f17acbcec.zip
better marking of current cursor in Components.Input
change eLabel to being able to mark a character
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Input.py7
-rw-r--r--lib/python/Components/VariableText.py4
-rw-r--r--lib/python/Plugins/test/plugin.py2
3 files changed, 10 insertions, 3 deletions
diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py
index d3b06612..7ffc5c77 100644
--- a/lib/python/Components/Input.py
+++ b/lib/python/Components/Input.py
@@ -16,10 +16,13 @@ class Input(HTMLComponent, GUIComponent, VariableText):
self.update()
def update(self):
- self.setText(self.text[0:self.currPos] + "_" + self.text[self.currPos] + "_" + self.text[self.currPos + 1:])
+ self.setMarkedPos(self.currPos)
+ self.setText(self.text)
+ #self.setText(self.text[0:self.currPos] + "_" + self.text[self.currPos] + "_" + self.text[self.currPos + 1:])
+
def createWidget(self, parent):
- return eLabel(parent)
+ return eLabel(parent, self.currPos)
def getSize(self):
s = self.instance.calculateSize()
diff --git a/lib/python/Components/VariableText.py b/lib/python/Components/VariableText.py
index 76dc201a..e2a755c5 100644
--- a/lib/python/Components/VariableText.py
+++ b/lib/python/Components/VariableText.py
@@ -12,6 +12,10 @@ class VariableText:
if self.instance:
self.instance.setText(self.message)
+ def setMarkedPos(self, pos):
+ if self.instance:
+ self.instance.setMarkedPos(int(pos))
+
def getText(self):
return self.message
diff --git a/lib/python/Plugins/test/plugin.py b/lib/python/Plugins/test/plugin.py
index c08a986f..d85a80c9 100644
--- a/lib/python/Plugins/test/plugin.py
+++ b/lib/python/Plugins/test/plugin.py
@@ -11,7 +11,7 @@ import os
class Test(Screen):
skin = """
<screen position="100,100" size="550,400" title="Test" >
- <widget name="text" position="0,0" size="550,400" font="Regular;20" />
+ <widget name="text" position="0,0" size="550,25" font="Regular;20" />
</screen>"""
def __init__(self, session, args = None):