예제 #1
0
    def Generate(self, game, branches, current):
        start_x  = 0
        start_y  = 0
        i = 0
        self._Game = game

        for branch in branches:
            li = InfoPageListItem()
            li._Parent = self
            li._PosX   = start_x
            li._PosY   = start_y + i*InfoPageListItem._Height

            li._Width  = Width
            li._Fonts["normal"] = self._ListFontObj
            
            li._Fonts["small"] = self._ListSmFontObj
            
            li._LinkObj = branch

            li.Init(branch)
            
            if branch == current:
                self._PsIndex = i

            li._PosX = 2
            self._MyList.append(li)

            i = i + 1
예제 #2
0
    def Init(self):
        self._SubPage = SelectPage()
        self._SubPage._Screen = self._Screen
        self._SubPage._Name = "Select Branch"
        self._SubPage.Init()

        self._ListFontObj = MyLangManager.TrFont("varela15")
        self._ListSmFontObj = MySkinManager.GiveFont("varela12")
        if self._Screen != None:
            if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
                self._HWND = self._Screen._CanvasHWND
                self._CanvasHWND = self._Screen._CanvasHWND
        
        self._PosX = self._Index*self._Screen._Width 
        self._Width = self._Screen._Width ## equal to screen width
        self._Height = self._Screen._Height

        ps = GamePageSelector()
        ps._Parent = self 

        self._Ps = ps
        self._PsIndex = 0

        self._Scroller = ListScroller()
        self._Scroller._Parent = self
        self._Scroller._PosX = 2
        self._Scroller._PosY = 2
        self._Scroller.Init()

        start_x  = 0
        start_y  = 0
        i = 0
        games = git.get_games()
        for game in games:
            li = InfoPageListItem()
            li._Parent = self
            li._PosX   = start_x
            li._PosY   = start_y + i*InfoPageListItem._Height

            li._Width  = Width
            li._Fonts["normal"] = self._ListFontObj
            
            li._Fonts["small"] = self._ListSmFontObj
            
            li._LinkObj = game

            li.Init( game.split("/")[-1] )
            
            sm_text = str(len(git.get_branches(game)[0]))
            li.SetSmallText(sm_text)
            
            li._PosX = 2
            self._MyList.append(li)

            i = i + 1