def Init(self): if self._Screen != None: if self._Screen._CanvasHWND != None and self._CanvasHWND == None: self._HWND = self._Screen._CanvasHWND self._CanvasHWND = pygame.Surface( (self._Screen._Width, self._BGheight)) self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width ## equal to screen width self._Height = self._Screen._Height DialogBoxs = MultiIconItem() DialogBoxs._ImgSurf = MyIconPool.GiveIconSurface("buttonslayout") DialogBoxs._MyType = ICON_TYPES["STAT"] DialogBoxs._Parent = self DialogBoxs._IconWidth = 300 DialogBoxs._IconHeight = 150 DialogBoxs.Adjust(0, 0, 134, 372, 0) self._Icons["DialogBoxs"] = DialogBoxs self.GenList() self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init() self._Scroller.SetCanvasHWND(self._HWND) self._ConfirmPage = UpdateConfirmPage() self._ConfirmPage._LayoutMode = GetButtonsLayoutMode() self._ConfirmPage._Screen = self._Screen self._ConfirmPage._Name = "Overwrite RA conf" self._ConfirmPage._Parent = self self._ConfirmPage.Init()
def Init(self): if self._Screen != None: if self._Screen._CanvasHWND != None and self._CanvasHWND == None: self._HWND = self._Screen._CanvasHWND self._CanvasHWND = pygame.Surface( (self._Screen._Width, self._BGheight + 50)) self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width ## equal to screen width self._Height = self._Screen._Height bgpng = MultiIconItem() bgpng._ImgSurf = MyIconPool.GiveIconSurface("about_bg") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0, 0, self._BGwidth, self._BGheight, 0) self._Icons["bg"] = bgpng self.CpuInfo() self.MemInfo() self.CpuMhz() self.Uname() self.LauncherVersion() self.OsImageVersion() self.GenList() self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init() self._Scroller.SetCanvasHWND(self._HWND)
def Init(self): self._dialog_index = 22 self._CanvasHWND = self._Screen._CanvasHWND self._Width = self._Screen._Width self._Height = self._Screen._Height self._BGpng = IconItem() self._BGpng._ImgSurf = MyIconPool._Icons["cpiCalbg5"] self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._monyearlabel = Label() self._monyearlabel.SetCanvasHWND(self._CanvasHWND) self._monyear, self._callist = self.CurMonth() self._monyearlabel.Init(self._monyear,fonts["varela15"]) calnum = MultiIconItem() calnum._ImgSurf = MyIconPool._Icons["calnum"] calnum._MyType = ICON_TYPES["STAT"] calnum._Parent = self calnum._IconWidth = 35 calnum._IconHeight = 26 calnum.Adjust(0,0,134,372,0) self._Icons["calnum"] = calnum
def Init(self): if self._Screen != None: if self._Screen._CanvasHWND != None and self._CanvasHWND == None: self._HWND = self._Screen._CanvasHWND self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) ) self._PosX = self._Index*self._Screen._Width self._Width = self._Screen._Width ## equal to screen width self._Height = self._Screen._Height airwire = IconItem() airwire._ImgSurf = MyIconPool._Icons["airwire"] airwire._MyType = ICON_TYPES["STAT"] airwire._Parent = self airwire.Adjust(0,0,5,43,0) self._Icons["airwire"] = airwire GS = IconItem() GS._ImgSurf = MyIconPool._Icons["GS"] GS._MyType = ICON_TYPES["STAT"] GS._Parent = self GS.Adjust(0,0,72,95,0) self._Icons["GS"] = GS DialogBoxs = MultiIconItem() DialogBoxs._ImgSurf = MyIconPool._Icons["DialogBoxs"] DialogBoxs._MyType = ICON_TYPES["STAT"] DialogBoxs._Parent = self DialogBoxs._IconWidth = 134 DialogBoxs._IconHeight = 93 DialogBoxs.Adjust(0,0,134,372,0) self._Icons["DialogBoxs"] = DialogBoxs """ bgpng = MultiIconItem() bgpng._ImgSurf = MyIconPool._Icons["about_bg"] bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0) self._Icons["bg"] = bgpng """ self.GenList() self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init() self._Scroller.SetCanvasHWND(self._HWND) self.OnLoadCb()
def Init(self): self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width self._Height = self._Screen._Height self._CanvasHWND = self._Screen._CanvasHWND ps = ListPageSelector() ps._Parent = self self._Ps = ps self._PsIndex = 0 self.SyncList(self._Emulator["ROM"]) self._MyStack._Emulator = self._Emulator icon_for_list = MultiIconItem() icon_for_list._ImgSurf = self._Parent._Icons["sys"] icon_for_list._MyType = ICON_TYPES["STAT"] icon_for_list._Parent = self icon_for_list.Adjust(0, 0, 18, 18, 0) self._Icons["sys"] = icon_for_list bgpng = IconItem() bgpng._ImgSurf = MyIconPool._Icons["star"] bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.AddLabel(MyLangManager.Tr("MyFavGames"), MyLangManager.TrFont("varela18")) bgpng.SetLableColor(MySkinManager.GiveColor('Disabled')) bgpng.Adjust(0, 0, self._BGwidth, self._BGheight, 0) self._Icons["bg"] = bgpng self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init() rom_so_confirm_page = RomSoConfirmPage() rom_so_confirm_page._Screen = self._Screen rom_so_confirm_page._Name = "Download Confirm" rom_so_confirm_page._Parent = self rom_so_confirm_page.Init() self._RomSoConfirmDownloadPage = rom_so_confirm_page
def Init(self): self._CanvasHWND = self._Screen._CanvasHWND self._Fonts["normal"] = MyLangManager.TrFont("varela14") self._Fonts["big"] = MyLangManager.TrFont("varela25") self._Fonts["small"] = MyLangManager.TrFont("veramono12") allsign = MultiIconItem() allsign._ImgSurf = MyIconPool._Icons["allsign"] allsign._MyType = ICON_TYPES["STAT"] allsign._Parent = self allsign._IconWidth = 140 allsign._IconHeight = 110 allsign.Adjust(0, 0, 134, 372, 0) self._Icons["allsign"] = allsign self._Icons["allsign"].NewCoord(180, 23) self._CityLabel.SetCanvasHWND(self._CanvasHWND) self._CityLabel.Init(self._location, self._Fonts["big"]) self._CityLabel.NewCoord(30, 30) self._TempLabel.SetCanvasHWND(self._CanvasHWND) self._TempLabel.Init("", self._Fonts["big"]) self._TempLabel.NewCoord(30, 60) self._TempSummaryLabel.SetCanvasHWND(self._CanvasHWND) self._TempSummaryLabel.Init("", self._Fonts["normal"]) self._TempSummaryLabel.NewCoord(30, 90) self._TempSummaryLabel._Width = 400 # spike self._WeatherSummaryLabel.SetCanvasHWND(self._CanvasHWND) self._WeatherSummaryLabel.Init(self._placeHolderText, self._Fonts["small"]) self._WeatherSummaryLabel.NewCoord(30, 130) self._WeatherSummaryLabel._Width = 800 # spike self._SummarySunLabel.SetCanvasHWND(self._CanvasHWND) self._SummarySunLabel.Init(self._placeHolderText, self._Fonts["small"]) self._SummarySunLabel.NewCoord(180, 130) self._SummarySunLabel._Width = 800 # spike self._ErrorLabel.SetCanvasHWND(self._CanvasHWND) self._ErrorLabel.Init(self._errorText, self._Fonts["small"]) self._ErrorLabel.NewCoord(0, 180)
def Init(self): self._Width = self._Parent._Width self._Height = self._Parent._Height bgpng = IconItem() bgpng._ImgSurf = MyIconPool.GiveIconSurface("light") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0, 0, self._BGwidth, self._BGheight, 0) self._Icons["bg"] = bgpng ##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA ) scale = MultiIconItem() scale._MyType = ICON_TYPES["STAT"] scale._Parent = self scale._ImgSurf = MyIconPool.GiveIconSurface("scale") scale._IconWidth = 82 scale._IconHeight = 63 scale.Adjust(0, 0, 82, 63, 0) self._Icons["scale"] = scale
def Init(self): self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width self._Height = self._Screen._Height self._CanvasHWND = self._Screen._CanvasHWND ps = ListPageSelector() ps._Parent = self self._Ps = ps self._PsIndex = 0 self.SyncList("/") icon_for_list = MultiIconItem() icon_for_list._ImgSurf = MyIconPool._Icons["sys"] icon_for_list._MyType = ICON_TYPES["STAT"] icon_for_list._Parent = self icon_for_list.Adjust(0,0,18,18,0) self._Icons["sys"] = icon_for_list self._BGpng = IconItem() self._BGpng._ImgSurf = MyIconPool._Icons["empty"] self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.AddLabel("Please upload data over Wi-Fi", fonts["varela22"]) self._BGpng.SetLableColor(SkinManager().GiveColor('Disabled')) self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init()
def Init(self): self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width self._Height = self._Screen._Height self._CanvasHWND = self._Screen._CanvasHWND ps = ListPageSelector() ps._Parent = self self._Ps = ps self._PsIndex = 0 self.SyncList("/usr/share/zoneinfo/posix") icon_for_list = MultiIconItem() icon_for_list._ImgSurf = MyIconPool._Icons["sys"] icon_for_list._MyType = ICON_TYPES["STAT"] icon_for_list._Parent = self icon_for_list.Adjust(0,0,18,18,0) self._Icons["sys"] = icon_for_list self._BGpng = IconItem() self._BGpng._ImgSurf = MyIconPool._Icons["empty"] self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.AddLabel("No timezones found on system!", MyLangManager.TrFont("varela22")) self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled')) self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init()
def Init(self): self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width self._Height = self._Screen._Height self._CanvasHWND = self._Screen._CanvasHWND ps = ListPageSelector() ps._Parent = self self._Ps = ps self._PsIndex = 0 self.SyncList(self._Emulator["ROM"]) ### will also mkdir of the ***ROM self try: os.makedirs(self._Emulator["ROM"] + "/.Trash") except OSError: if not os.path.isdir(self._Emulator["ROM"] + "/.Trash"): raise try: os.makedirs(self._Emulator["ROM"] + "/.Fav") except OSError: if not os.path.isdir(self._Emulator["ROM"] + "/.Fav"): raise self._MyStack._Emulator = self._Emulator icon_for_list = MultiIconItem() icon_for_list._ImgSurf = self._Parent._Icons["sys"] icon_for_list._MyType = ICON_TYPES["STAT"] icon_for_list._Parent = self icon_for_list.Adjust(0, 0, 18, 18, 0) self._Icons["sys"] = icon_for_list bgpng = IconItem() bgpng._ImgSurf = MyIconPool._Icons["empty"] bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.AddLabel(MyLangManager.Tr("Please upload data over Wi-Fi"), MyLangManager.TrFont("varela22")) bgpng.SetLableColor(MySkinManager.GiveColor('Disabled')) bgpng.Adjust(0, 0, self._BGwidth, self._BGheight, 0) self._Icons["bg"] = bgpng self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init() rom_so_confirm_page = RomSoConfirmPage() rom_so_confirm_page._Screen = self._Screen rom_so_confirm_page._Name = "Download Confirm" rom_so_confirm_page._Parent = self rom_so_confirm_page.Init() self._RomSoConfirmDownloadPage = rom_so_confirm_page
class SoundSlider(Slider): OnChangeCB = None _BGpng = None _BGwidth = 192 _BGheight = 173 _NeedleSurf = None _Scale = None _Parent = None snd_segs = [ [0,20],[21,40],[41,50],[51,60],[61,70],[71,85],[86,90],[91,95],[96,100] ] def __init__(self): Slider.__init__(self) def Init(self): self._Width = self._Parent._Width self._Height = self._Parent._Height self._BGpng = IconItem() self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("vol") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) ##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA ) self._Scale = MultiIconItem() self._Scale._MyType = ICON_TYPES["STAT"] self._Scale._Parent = self self._Scale._ImgSurf = MyIconPool.GiveIconSurface("scale") self._Scale._IconWidth = 82 self._Scale._IconHeight = 63 self._Scale.Adjust(0,0,82,63,0) def SetValue(self,vol):#pct 0-100 for i,v in enumerate(self.snd_segs): if vol >= v[0] and vol <= v[1]: self._Value = i # self._Value : 0 - 8 break def Further(self): self._Value+=1 if self._Value > len(self.snd_segs)-1: self._Value = len(self.snd_segs) -1 vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2 if self.OnChangeCB != None: if callable(self.OnChangeCB): self.OnChangeCB( vol ) def StepBack(self): self._Value-=1 if self._Value < 0: self._Value = 0 vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2 if self.OnChangeCB != None: if callable(self.OnChangeCB): self.OnChangeCB( vol ) def Draw(self): self._BGpng.NewCoord(self._Width/2,self._Height/2 ) self._BGpng.Draw() self._Scale.NewCoord(self._Width/2,self._Height/2) self._Scale._IconIndex = self._Value self._Scale.Draw()
class SoundSlider(Slider): OnChangeCB = None _BGpng = None _BGwidth = 192 _BGheight = 173 _NeedleSurf = None _Scale = None _Parent = None _Segs = [0, 15, 29, 45, 55, 65, 75, 90, 100] snd_segs = [[0, 20], [21, 40], [41, 50], [51, 60], [61, 70], [71, 85], [86, 90], [91, 95], [96, 100]] def __init__(self): Slider.__init__(self) def Init(self): self._Width = self._Parent._Width self._Height = self._Parent._Height self._BGpng = IconItem() self._BGpng._ImgSurf = MyIconPool._Icons["vol"] self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.Adjust(0, 0, self._BGwidth, self._BGheight, 0) ##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA ) self._Scale = MultiIconItem() self._Scale._MyType = ICON_TYPES["STAT"] self._Scale._Parent = self self._Scale._ImgSurf = MyIconPool._Icons["scale"] self._Scale._IconWidth = 82 self._Scale._IconHeight = 63 self._Scale.Adjust(0, 0, 82, 63, 0) def SetValue(self, pct): #pct 0-100 for i, v in enumerate(self.snd_segs): if pct >= v[0] and pct <= v[1]: self._Value = i def Further(self): self._Value += 1 if self._Value < len(self._Segs): if self.OnChangeCB != None: if callable(self.OnChangeCB): self.OnChangeCB(self._Segs[self._Value]) else: self._Value = len(self._Segs) - 1 def StepBack(self): self._Value -= 1 if self._Value < 0: self._Value = 0 if self.OnChangeCB != None: if callable(self.OnChangeCB): self.OnChangeCB(self._Segs[self._Value]) def Draw(self): self._BGpng.NewCoord(self._Width / 2, self._Height / 2) self._BGpng.Draw() self._Scale.NewCoord(self._Width / 2, self._Height / 2) self._Scale._IconIndex = self._Value self._Scale.Draw()