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()
25 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."))
27 self["actions"] = NumberActionMap(["PiPSetupActions"],
30 "cancel": self.cancel,
36 "size-": self.smaller,
43 self.movePiP(self.orgpos[0], self.orgpos[1])
47 def movePiP(self, x, y):
55 def resizePiP(self, resize):
56 w = int(self.size[0] * self.resize / 100)
57 h = int(self.size[1] * self.resize / 100)
62 self.movePiP(self.pos[0], self.pos[1] - 10)
65 self.movePiP(self.pos[0], self.pos[1] + 10)
68 self.movePiP(self.pos[0] - 10, self.pos[1])
71 self.movePiP(self.pos[0] + 10, self.pos[1])
74 self.resizePiP(self.resize + 5)
77 self.resizePiP(self.resize - 5)