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.MenuList import MenuList
7 from Components.GUIComponent import *
8 from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
12 class PiPSetup(Screen):
13 def __init__(self, session, pip):
14 Screen.__init__(self, session)
18 self.pos = (self.pip.instance.position().x(), self.pip.instance.position().y())
19 self.orgpos = self.pos
21 self.size = self.pip.getSize()
22 self.orgsize = self.size
24 self["text"] = Label(_("Please use direction keys to move the PiP window.\nPress Bouquet +/- to resize the window.\nPress OK to go back to the TV mode or EXIT to cancel the moving."))
26 self["actions"] = NumberActionMap(["PiPSetupActions"],
29 "cancel": self.cancel,
35 "size-": self.smaller,
42 self.movePiP(self.orgpos[0], self.orgpos[1])
43 self.resizePiP(self.orgsize[0], self.orgsize[1])
46 def movePiP(self, x, y):
50 def resizePiP(self, w, h):
55 self.movePiP(self.pos[0], self.pos[1] - 1)
58 self.movePiP(self.pos[0], self.pos[1] + 1)
61 self.movePiP(self.pos[0] - 1, self.pos[1])
64 self.movePiP(self.pos[0] + 1, self.pos[1])
67 # just for testing... TODO resize with correct aspect ratio
68 self.resizePiP(self.size[0] + 1, self.size[1] + 1)
71 # just for testing... TODO resize with correct aspect ratio
72 self.resizePiP(self.size[0] - 1, self.size[1] - 1)