aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py4
-rw-r--r--lib/python/Screens/ChoiceBox.py49
-rw-r--r--lib/python/Screens/Makefile.am2
-rw-r--r--lib/python/Screens/__init__.py2
4 files changed, 53 insertions, 4 deletions
diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
index 856c2f3b..d4d24f32 100644
--- a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
+++ b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
@@ -7,7 +7,7 @@ from Components.Input import Input
from Components.GUIComponent import *
from Components.Pixmap import Pixmap
from Components.FileList import FileEntryComponent, FileList
-from Screens.InputBox import InputBox
+from Screens.ChoiceBox import ChoiceBox
from Plugins.Plugin import PluginDescriptor
import os
@@ -69,7 +69,7 @@ class Test(Screen):
self["text"].number(number)
def main(session):
- session.openWithCallback(test, InputBox, title="Hallo", text="1234", maxSize=True, type=Input.NUMBER)
+ session.openWithCallback(test, ChoiceBox, title="Hallo", list=[(_("yes"), "yes"), (_("no"), "no")])
def test(returnValue):
print "You entered", returnValue
diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py
new file mode 100644
index 00000000..533e78d0
--- /dev/null
+++ b/lib/python/Screens/ChoiceBox.py
@@ -0,0 +1,49 @@
+from enigma import *
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Components.ActionMap import NumberActionMap
+from Components.Label import Label
+from Components.MenuList import MenuList
+from Components.GUIComponent import *
+
+import os
+
+class ChoiceBox(Screen):
+ def __init__(self, session, title = "", **kwargs):
+ Screen.__init__(self, session)
+
+ self["text"] = Label(title)
+ self["list"] = MenuList(**kwargs)
+
+ self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
+ {
+ "ok": self.go,
+ "back": self.close,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal
+ }, -1)
+
+ def keyLeft(self):
+ pass
+
+ def keyRight(self):
+ pass
+
+ def keyNumberGlobal(self, number):
+ print "pressed", number
+ #self["input"].number(number)
+
+ def go(self):
+ self.close(self["list"].l.getCurrentSelection())
+ #self.close(self["input"].getText())
+
+ def cancel(self):
+ self.close(None) \ No newline at end of file
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index 63eecb18..47586fe0 100644
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -9,5 +9,5 @@ install_PYTHON = \
AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
- Console.py InputBox.py
+ Console.py InputBox.py ChoiceBox.py
diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py
index d5323bb8..82e4d833 100644
--- a/lib/python/Screens/__init__.py
+++ b/lib/python/Screens/__init__.py
@@ -5,4 +5,4 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu",
"Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py",
"EpgSelection", "EventView", "Standby", "ServiceInfo",
"AudioSelection", "SubserviceSelection", "InfoBarGenerics", "HelpMenu", "Wizard",
- "PVRState", "Console", "InputBox" ]
+ "PVRState", "Console", "InputBox", "ChoiceBox" ]