2 from Screens.Screen import Screen
3 from Screens.MessageBox import MessageBox
4 from Components.ActionMap import NumberActionMap
5 from Components.Label import Label
6 from Components.Input import Input
7 from Components.GUIComponent import *
8 from Components.Pixmap import Pixmap
9 from Components.FileList import FileEntryComponent, FileList
10 from Screens.InputBox import InputBox
11 from Plugins.Plugin import PluginDescriptor
17 <screen position="100,100" size="550,400" title="Test" >
18 <!--widget name="text" position="0,0" size="550,25" font="Regular;20" /-->
19 <widget name="list" position="10,0" size="190,250" scrollbarMode="showOnDemand" />
20 <widget name="pixmap" position="200,0" size="190,250" />
22 def __init__(self, session, args = None):
24 Screen.__init__(self, session)
26 self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)")
27 self["pixmap"] = Pixmap()
29 #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER)
31 self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
35 # "left": self.keyLeft,
36 # "right": self.keyRight,
37 "1": self.keyNumberGlobal,
38 "2": self.keyNumberGlobal,
39 "3": self.keyNumberGlobal,
40 "4": self.keyNumberGlobal,
41 "5": self.keyNumberGlobal,
42 "6": self.keyNumberGlobal,
43 "7": self.keyNumberGlobal,
44 "8": self.keyNumberGlobal,
45 "9": self.keyNumberGlobal,
46 "0": self.keyNumberGlobal
49 self.onShown.append(self.openTest)
52 self.session.open(InputBox)
61 selection = self["list"].getSelection()
62 if selection[1] == True: # isDir
63 self["list"].changeDir(selection[0])
65 self["pixmap"].instance.setPixmapFromFile(selection[0])
67 def keyNumberGlobal(self, number):
68 print "pressed", number
69 self["text"].number(number)
72 session.openWithCallback(test, InputBox, title="Hallo", text="1234", maxSize=True, type=Input.NUMBER)
74 def test(returnValue):
75 print "You entered", returnValue
78 return PluginDescriptor(name="Test", description="plugin to test some capabilities", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)