diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-02-25 04:05:35 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-02-25 04:05:35 +0000 |
| commit | 714488394a5c552b175f69682ac2001f8f1b6345 (patch) | |
| tree | 0189089b5a013566aa1778876528dcf0df4c5308 /lib/python/Screens | |
| parent | 842dabf727814691bfd949ac4d910ce04c32b887 (diff) | |
| download | enigma2-714488394a5c552b175f69682ac2001f8f1b6345.tar.gz enigma2-714488394a5c552b175f69682ac2001f8f1b6345.zip | |
add InputBox screen for textual input
Diffstat (limited to 'lib/python/Screens')
| -rw-r--r-- | lib/python/Screens/InputBox.py | 50 | ||||
| -rw-r--r-- | lib/python/Screens/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Screens/__init__.py | 2 |
3 files changed, 52 insertions, 2 deletions
diff --git a/lib/python/Screens/InputBox.py b/lib/python/Screens/InputBox.py new file mode 100644 index 00000000..6771a517 --- /dev/null +++ b/lib/python/Screens/InputBox.py @@ -0,0 +1,50 @@ +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.Input import Input +from Components.GUIComponent import * + +import os + +class InputBox(Screen): + def __init__(self, session, title = "", **kwargs): + Screen.__init__(self, session) + + self["text"] = Label(title) + self["input"] = Input(**kwargs) + + self["actions"] = NumberActionMap(["WizardActions", "InputActions"], + { + "ok": self.go, + "back": self.close, + "left": self.keyLeft, + "right": self.keyRight, + "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): + self["input"].left() + + def keyRight(self): + self["input"].right() + + def keyNumberGlobal(self, number): + print "pressed", number + self["input"].number(number) + + def go(self): + 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 3365e97f..63eecb18 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 + Console.py InputBox.py diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py index 06378dc3..d5323bb8 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" ] + "PVRState", "Console", "InputBox" ] |
