fix Makefiles
[enigma2.git] / lib / python / Screens / MinuteInput.py
1 from Screen import Screen
2 from Components.ActionMap import NumberActionMap
3 from Components.Input import Input
4
5 class MinuteInput(Screen):
6                 def __init__(self, session, basemins = 5):
7                         Screen.__init__(self, session)
8                                                 
9                         self["minutes"] = Input(str(basemins), type=Input.NUMBER)
10                         
11                         self["actions"] = NumberActionMap([ "InputActions" , "MinuteInputActions", "TextEntryActions", "KeyboardInputActions" ],
12                         {
13                                 "1": self.keyNumberGlobal,
14                                 "2": self.keyNumberGlobal,
15                                 "3": self.keyNumberGlobal,
16                                 "4": self.keyNumberGlobal,
17                                 "5": self.keyNumberGlobal,
18                                 "6": self.keyNumberGlobal,
19                                 "7": self.keyNumberGlobal,
20                                 "8": self.keyNumberGlobal,
21                                 "9": self.keyNumberGlobal,
22                                 "0": self.keyNumberGlobal,
23                                 "left": self.left,
24                                 "right": self.right,
25                                 "home": self.home,
26                                 "end": self.end,
27                                 "deleteForward": self.deleteForward,
28                                 "deleteBackward": self.deleteBackward,
29                                 "up": self.up,
30                                 "down": self.down,
31                                 "ok": self.ok,
32                                 "cancel": self.cancel
33                         })
34                         
35                 def keyNumberGlobal(self, number):
36                         self["minutes"].number(number)
37                         pass
38                         
39                 def left(self):
40                         self["minutes"].left()
41                         
42                 def right(self):
43                         self["minutes"].right()
44
45                 def home(self):
46                         self["minutes"].home()
47
48                 def end(self):
49                         self["minutes"].end()
50
51                 def deleteForward(self):
52                         self["minutes"].delete()
53
54                 def deleteBackward(self):
55                         self["minutes"].deleteBackward()
56
57                 def up(self):
58                         self["minutes"].up()
59                 
60                 def down(self):
61                         self["minutes"].down()
62                                 
63                 def ok(self):
64                         self.close(int(self["minutes"].getText()))
65                         
66                 def cancel(self):
67                         self.close(0)