Ejemplo n.º 1
0
 def Change_sub_page(self):
     self.background = xbmcgui.ControlImage(
         0, 0, 1280, 720, self.txt_array[self.sub_page - 1])
     self.addControl(self.background)
     self.pagelabel = xbmcgui.ControlLabel(
         38,
         5,
         500,
         500,
         'Página ' + str(self.page) + ' - ' + str(self.sub_page) + '/' +
         str(len(self.txt_array)),
         font='font24_title',
         angle=-90)
     self.addControl(self.pagelabel)
     if len(channel_list) > 1:
         self.switch_channel = xbmcgui.ControlButton(
             1202,
             0,
             80,
             70,
             '',
             focusTexture=addonfolder + artfolder + 'switch.png',
             noFocusTexture=addonfolder + artfolder + 'switch.png')
         self.addControl(self.switch_channel)
     self.page_input = xbmcgui.ControlButton(
         0,
         240,
         80,
         70,
         '',
         focusTexture=addonfolder + artfolder + 'comando.png',
         noFocusTexture=addonfolder + artfolder + 'comando.png')
     self.addControl(self.page_input)
     self.addon_exit = xbmcgui.ControlButton(
         1202,
         240,
         80,
         70,
         '',
         focusTexture=addonfolder + artfolder + 'sair.png',
         noFocusTexture=addonfolder + artfolder + 'sair.png')
     self.addControl(self.addon_exit)
     self.anterior = xbmcgui.ControlButton(
         0,
         652,
         80,
         70,
         '',
         focusTexture=addonfolder + artfolder + 'anterior.png',
         noFocusTexture=addonfolder + artfolder + 'anterior.png')
     self.addControl(self.anterior)
     self.proximo = xbmcgui.ControlButton(
         1202,
         652,
         80,
         70,
         '',
         focusTexture=addonfolder + artfolder + 'proximo.png',
         noFocusTexture=addonfolder + artfolder + 'proximo.png')
     self.addControl(self.proximo)
Ejemplo n.º 2
0
    def __init__(self, window, x, y, width, height, label, lvalues, value):
        self.options = lvalues
        self.window = window
        self.etiqueta = xbmcgui.ControlLabel(x, y, width, height, label)
        window.addControl(self.etiqueta)

        self.downBtn = xbmcgui.ControlButton(
            x + width - height * 2,
            y,
            height,
            height,
            '',
            focusTexture=os.path.join(_path_imagen, 'Controls',
                                      'spinDown-Focus.png'),
            noFocusTexture=os.path.join(_path_imagen, 'Controls',
                                        'spinDown-noFocus.png'))
        window.addControl(self.downBtn)

        self.upBtn = xbmcgui.ControlButton(
            x + width - height,
            y,
            height,
            height,
            '',
            focusTexture=os.path.join(_path_imagen, 'Controls',
                                      'spinUp-Focus.png'),
            noFocusTexture=os.path.join(_path_imagen, 'Controls',
                                        'spinUp-noFocus.png'))
        window.addControl(self.upBtn)
        self.selectedIndex = lvalues.index(value)
        self.__setSelected()
Ejemplo n.º 3
0
    def add_control_list(self, c):
        control = xbmcgui.ControlButton(0, -100, self.controls_width, self.height_control,
                                        c["label"], os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
                                        os.path.join(self.mediapath, 'Controls','MenuItemNF.png'),
                                        0, textColor=c["color"], 
                                        font=self.font)

        label = xbmcgui.ControlLabel(0, -100, self.controls_width - 30, self.height_control,
                                     "", font=self.font, textColor=c["color"], alignment=4 | 1)

        upBtn = xbmcgui.ControlButton(0, -100, 20, 15, "",
                                      focusTexture=os.path.join(self.mediapath, 'Controls', 'spinUp-Focus.png'),
                                      noFocusTexture=os.path.join(self.mediapath, 'Controls', 'spinUp-noFocus.png'))

        downBtn = xbmcgui.ControlButton(0, -100 + 15, 20, 15, "",
                                        focusTexture=os.path.join(self.mediapath, 'Controls', 'spinDown-Focus.png'),
                                        noFocusTexture=os.path.join(self.mediapath, 'Controls', 'spinDown-noFocus.png'))


        self.addControl(control)
        self.addControl(label)
        self.addControl(upBtn)
        self.addControl(downBtn)

        control.setVisible(False)
        label.setVisible(False)
        upBtn.setVisible(False)
        downBtn.setVisible(False)
        label.setLabel(c["lvalues"][self.values[c["id"]]])

        c["control"] = control
        c["label"] = label
        c["downBtn"] = downBtn
        c["upBtn"] = upBtn
Ejemplo n.º 4
0
    def __init__(self, cookie, tokens, vcodetype, codeString, vcode_path):
        self.cookie = cookie
        self.tokens = tokens
        self.vcodetype = vcodetype
        self.codeString = codeString
        self.vcode_path = vcode_path

        # windowItems
        self.image = xbmcgui.ControlImage(80, 100, 500, 200, self.vcode_path)
        self.buttonInput = xbmcgui.ControlButton(100,
                                                 330,
                                                 140,
                                                 50,
                                                 label=u'输入验证码',
                                                 font='font20',
                                                 textColor='0xFFFFFFFF')
        self.buttonRefresh = xbmcgui.ControlButton(290,
                                                   330,
                                                   140,
                                                   50,
                                                   label=u'刷新验证码',
                                                   font='font20',
                                                   textColor='0xFFFFFFFF')
        self.addControls([self.image, self.buttonInput, self.buttonRefresh])
        self.setFocus(self.buttonInput)
Ejemplo n.º 5
0
    def __init__(self, *args, **kwargs):
        self.cptloc = kwargs.get('captcha')

        bg_image = 'special://home/addons/plugin.video.vstream/resources/art/background.png'

        self.ctrlBackground = xbmcgui.ControlImage(0, 0, 1280, 720, bg_image)
        self.cancelled = False
        self.addControl(self.ctrlBackground)

        self.strActionInfo = xbmcgui.ControlLabel(250, 20, 724, 400,
                                                  kwargs.get('msg'), 'font40',
                                                  '0xFFFF00FF')
        self.addControl(self.strActionInfo)

        self.img = xbmcgui.ControlImage(250, 110, 500, 300, str(self.cptloc))
        self.addControl(self.img)

        self.Yesbutton = xbmcgui.ControlButton(250 + 520 - 50,
                                               620,
                                               100,
                                               50,
                                               'Yes',
                                               alignment=2)
        self.Nobutton = xbmcgui.ControlButton(250 + 260 - 70,
                                              620,
                                              140,
                                              50,
                                              'No',
                                              alignment=2)
        self.addControl(self.Yesbutton)
        self.addControl(self.Nobutton)

        self.setFocus(self.Yesbutton)
        self.Yesbutton.controlLeft(self.Nobutton)
        self.Nobutton.controlRight(self.Yesbutton)
Ejemplo n.º 6
0
    def addFeat(self):
        self.pic1 = xbmcgui.ControlImage(int(225 * self.X), int(130 * self.Y),
                                         0, 0, ROOT_DIR + "temp1.jpg")
        self.pic2 = xbmcgui.ControlImage(int(445 * self.X), int(130 * self.Y),
                                         0, 0, ROOT_DIR + "temp2.jpg")
        self.pic3 = xbmcgui.ControlImage(int(225 * self.X), int(280 * self.Y),
                                         0, 0, ROOT_DIR + "temp3.jpg")
        self.pic4 = xbmcgui.ControlImage(int(445 * self.X), int(280 * self.Y),
                                         0, 0, ROOT_DIR + "temp4.jpg")

        self.addControl(self.pic1)
        self.addControl(self.pic2)
        self.addControl(self.pic3)
        self.addControl(self.pic4)

        self.Hlight1 = xbmcgui.ControlButton(int(225 * self.X),
                                             int(100 * self.Y),
                                             int(169 * self.X),
                                             int(30 * self.Y), movies[0].name)
        self.Hlight2 = xbmcgui.ControlButton(int(445 * self.X),
                                             int(100 * self.Y),
                                             int(169 * self.X),
                                             int(30 * self.Y), movies[1].name)
        self.Hlight3 = xbmcgui.ControlButton(int(225 * self.X),
                                             int(250 * self.Y),
                                             int(169 * self.X),
                                             int(30 * self.Y), movies[2].name)
        self.Hlight4 = xbmcgui.ControlButton(int(445 * self.X),
                                             int(250 * self.Y),
                                             int(169 * self.X),
                                             int(30 * self.Y), movies[3].name)

        self.addControl(self.Hlight1)
        self.addControl(self.Hlight2)
        self.addControl(self.Hlight3)
        self.addControl(self.Hlight4)

        self.btnFeatured.controlRight(self.Hlight1)
        self.btnNewest.controlRight(self.Hlight1)
        self.btnComing.controlRight(self.Hlight1)
        self.btnPopular.controlRight(self.Hlight1)
        self.btnListAll.controlRight(self.Hlight1)
        self.btnOptions.controlRight(self.Hlight1)
        self.btnPlayback.controlRight(self.Hlight1)
        self.btnSave.controlRight(self.Hlight1)

        self.Hlight1.controlDown(self.Hlight3)
        self.Hlight1.controlLeft(self.btnFeatured)
        self.Hlight1.controlRight(self.Hlight2)

        self.Hlight2.controlDown(self.Hlight4)
        self.Hlight2.controlLeft(self.Hlight1)

        self.Hlight3.controlUp(self.Hlight1)
        self.Hlight3.controlLeft(self.btnFeatured)
        self.Hlight3.controlRight(self.Hlight4)

        self.Hlight4.controlUp(self.Hlight2)
        self.Hlight4.controlLeft(self.Hlight3)
Ejemplo n.º 7
0
    def main_window(self):

        self.buttons = list()
        self.setProperty("title", "Alfa - Configuración inicial")
        label = "Continuar"
        btn = xbmcgui.ControlButton(450,
                                    540,
                                    120,
                                    40,
                                    label,
                                    font=self.font,
                                    alignment=6,
                                    shadowColor=self.shadow,
                                    noFocusTexture=media_path +
                                    'MenuItemNOFO.png',
                                    focusTexture=media_path + "MenuItemFO.png")
        self.addControl(btn)
        self.buttons.append(btn)

        posx = 20
        posy = 50
        width = 180
        height = 60
        labels = [
            "videoteca", "cliente torrent", "titulos inteligentes",
            "set de iconos", "ajustes Avanzados"
        ]

        for label in labels:
            btn = xbmcgui.ControlButton(
                posx,
                posy,
                width,
                height,
                label.title(),
                font=self.font,
                alignment=6,
                shadowColor=self.shadow,
                noFocusTexture=media_path + 'MenuItemNOFO.png',
                focusTexture=media_path + "MenuItemFO.png",
                textColor="0xFFFFFFFF")

            self.addControl(btn)
            self.buttons.append(btn)
            posy += 70

        self.hand = xbmcgui.ControlImage(0, 0, 40, 40,
                                         media_path + "click.png")

        self.addControl(self.hand)
        self.hand.setVisible(False)
        self.hand.setAnimations([(
            "isVisible",
            "effect=zoom delay=120 center=auto start=80 end=50  time=350 loop=true condition=true"
        )])

        self.setFocus(self.buttons[1])
        self.focus = 1
Ejemplo n.º 8
0
		def __init__(self,msg='',L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font10',BorderWidth=10):
			buttonfocus, buttonnofocus = artwork('button')
			self.BG=xbmcgui.ControlImage(L+BorderWidth,T+BorderWidth,W-(BorderWidth*2),H-(BorderWidth*2), FANART, aspectRatio=0)
			self.addControl(self.BG)
			top = T+BorderWidth
			leftside = L+BorderWidth
			rightside = L+(W/2)-(BorderWidth*2)
			
			header = '[COLOR %s]Quick Advanced Settings Configurator[/COLOR]' % (COLOR3)
			self.Header=xbmcgui.ControlLabel(L, top, W, 30, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header)
			top += 30+BorderWidth
			
			#####Video Cache Size####
			freeMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.33)
			recMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.23)

			self.videomin = 0; self.videomax = freeMemory if freeMemory < 2000 else 2000
			self.recommendedVideo = recMemory if recMemory < 500 else 500; self.currentVideo = self.recommendedVideo
			current1 = '[COLOR %s]Video Cache Size[/COLOR]=[COLOR %s]%s MB[/COLOR]' % (COLOR1, COLOR2, self.currentVideo)
			recommended1 = '[COLOR %s]Video Cache Size:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (COLOR1, COLOR5, self.recommendedVideo)
			
			####CURL Timeout/CURL Low Speed####
			self.curlmin = 0; self.curlmax = 20
			self.recommendedCurl = 10; self.currentCurl = self.recommendedCurl
			curlpos = wiz.percentage(self.currentCurl, self.curlmax)
			recommended2 = '[COLOR %s]CURL Timeout/CURL Low Speed:[/COLOR] [COLOR %s]%ss[/COLOR]' % (COLOR1, COLOR5, self.recommendedCurl)
			
			########Read Buffer Factor#####
			self.readmin = 0; self.readmax = 10
			self.recommendedRead = 5; self.currentRead = self.recommendedRead
			readpos = wiz.percentage(self.currentRead, self.readmax)
			recommended3 = '[COLOR %s]Read Buffer Factor:[/COLOR] [COLOR %s]%s[/COLOR]' % (COLOR1, COLOR5, self.recommendedRead)
			
			######Buffer Mode#####
			recommended4 = '[COLOR %s]Buffer Mode:[/COLOR] [COLOR %s]2[/COLOR]' %(COLOR1, COLOR5)

			
			####BOX##
			msgbox='[COLOR %s]These settings will be written to the advancesettings.xml[/COLOR]\r\n\r\n%s\r\n%s\r\n%s\r\n%s' %(COLOR4, recommended4, recommended1, recommended3, recommended2)
			self.box=xbmcgui.ControlTextBox(L+25,T+50,W,H, font='font14')
			self.addControl(self.box)
			self.box.setText(msgbox)
			
			####Buttons###
			
			
			
			self.buttonWrite=xbmcgui.ControlButton(leftside,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Write File",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			self.buttonCancel=xbmcgui.ControlButton(rightside+BorderWidth*2,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Cancel",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			
			self.addControl(self.buttonWrite); self.addControl(self.buttonCancel)
			self.setFocus(self.buttonCancel)
			
			self.buttonWrite.controlLeft(self.buttonCancel); self.buttonWrite.controlRight(self.buttonCancel); self.buttonCancel.controlLeft(self.buttonWrite); self.buttonCancel.controlRight(self.buttonWrite)
Ejemplo n.º 9
0
		def __init__(self,msg='',L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font10',BorderWidth=10):
			buttonfocus, buttonnofocus = artwork('button')
			self.BG=xbmcgui.ControlImage(L+BorderWidth,T+BorderWidth,W-(BorderWidth*2),H-(BorderWidth*2), FANART, aspectRatio=0)
			self.addControl(self.BG)
			top = T+BorderWidth
			leftside = L+BorderWidth
			rightside = L+(W/2)-(BorderWidth*2)
			
			header = '[COLOR lime]Brzo konfiguriranje naprednih postavki[/COLOR]'
			self.Header=xbmcgui.ControlLabel(L, top, W, 30, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header)
			top += 30+BorderWidth
			
			#####Video Cache Size####
			freeMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.33)
			recMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.23)

			self.videomin = 0; self.videomax = freeMemory if freeMemory < 2000 else 2000
			self.recommendedVideo = recMemory if recMemory < 500 else 500; self.currentVideo = self.recommendedVideo
			current1 = '[COLOR lime]Velicina predmomorije videa:[/COLOR]=[COLOR white]%s MB[/COLOR]' % (self.currentVideo)
			recommended1 = '[COLOR lime]Velicina predmemorije videozapisa:[/COLOR] [COLOR white]%s MB[/COLOR]' % (self.recommendedVideo)
			
			####CURL Timeout/CURL Low Speed####
			self.curlmin = 0; self.curlmax = 20
			self.recommendedCurl = 10; self.currentCurl = self.recommendedCurl
			curlpos = wiz.percentage(self.currentCurl, self.curlmax)
			recommended2 = '[COLOR lime]CURL pauza/CURL niska brzina:[/COLOR] [COLOR white]%ss[/COLOR]' % (self.recommendedCurl)
			
			########Read Buffer Factor#####
			self.readmin = 0; self.readmax = 10
			self.recommendedRead = 5; self.currentRead = self.recommendedRead
			readpos = wiz.percentage(self.currentRead, self.readmax)
			recommended3 = '[COLOR lime]Ocitavanje buffera[/COLOR] [COLOR white]%s[/COLOR]' % (self.recommendedRead)
			
			######Buffer Mode#####
			recommended4 = '[COLOR lime]Buffer Mode:[/COLOR] [COLOR white]2[/COLOR]' 

			
			####BOX##
			msgbox='[COLOR lime]Postavke ce se upisati u advancesettings.xml[/COLOR]\r\n\r\n%s\r\n%s\r\n%s\r\n%s' %(recommended4, recommended1, recommended3, recommended2)
			self.box=xbmcgui.ControlTextBox(L+25,T+50,W,H, font='font14')
			self.addControl(self.box)
			self.box.setText(msgbox)
			
			####Buttons###
			
			
			
			self.buttonWrite=xbmcgui.ControlButton(leftside,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Napravi datoteku",textColor="0xFFFFFFFF",focusedColor="0xFF04fc05",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			self.buttonCancel=xbmcgui.ControlButton(rightside+BorderWidth*2,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Odustani",textColor="0xFFFFFFFF",focusedColor="0xFF04fc05",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			
			self.addControl(self.buttonWrite); self.addControl(self.buttonCancel)
			self.setFocus(self.buttonCancel)
			
			self.buttonWrite.controlLeft(self.buttonCancel); self.buttonWrite.controlRight(self.buttonCancel); self.buttonCancel.controlLeft(self.buttonWrite); self.buttonCancel.controlRight(self.buttonWrite)
Ejemplo n.º 10
0
    def __init__(self):
        self.addControl(
            xbmcgui.ControlImage(
                0, 0, 1280, 720,
                '/home/vader/.xbmc/scripts/helpMenu/helpMenuBackground.jpg'))
        self.strActionInfo = xbmcgui.ControlLabel(465, 60, 500, 200,
                                                  'A/V Source Control (cont)',
                                                  'Font_Bold35', '0xFF000000')
        self.addControl(self.strActionInfo)

        #3 buttons: Image, left and homeButton
        self.sourceImage2 = xbmcgui.ControlButton(
            280,
            110,
            746,
            483,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/sourceHelp2.jpg'
        )
        self.addControl(self.sourceImage2)

        self.leftArrow = xbmcgui.ControlButton(
            550,
            600,
            100,
            80,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/leftArrow.jpg',
            focusTexture='/home/vader/.xbmc/scripts/helpMenu/FTleftArrow.jpg')
        self.addControl(self.leftArrow)

        self.homeButton = xbmcgui.ControlButton(
            650,
            600,
            100,
            80,
            'Home',
            font='Font_Bold24',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/homeButton.jpg',
            focusTexture='/home/vader/.xbmc/scripts/helpMenu/FThomeButton.jpg',
            textOffsetY=25,
            textOffsetX=18,
            textColor='0xFFFFFFFF',
            focusedColor='0xFFD9D919')
        self.addControl(self.homeButton)

        #Start flashing icon on Projector Icon
        self.setFocus(self.homeButton)

        #Moves buttons can make
        self.leftArrow.controlLeft(self.homeButton)
        self.leftArrow.controlRight(self.homeButton)

        self.homeButton.controlLeft(self.leftArrow)
        self.homeButton.controlRight(self.leftArrow)
Ejemplo n.º 11
0
		def __init__(self,L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font14',BorderWidth=10):
			if BUILDNAME == "" or not wiz.checkBuild(BUILDNAME, 'version'):
				bgArt   = ICON
				icon    = ICON
				build   = "Test Window"
				version = '1.0'
				latest  = '1.0'
			else:
				bgArt   = wiz.checkBuild(BUILDNAME, 'fanart')
				icon    = wiz.checkBuild(BUILDNAME, 'icon')
				build   = BUILDNAME
				version = BUILDVERSION
				latest  = wiz.checkBuild(BUILDNAME, 'version')
			image_path = os.path.join(ART, 'ContentPanel.png')
			self.border = xbmcgui.ControlImage(L,T,W,H, image_path)
			self.addControl(self.border); 
			self.BG=xbmcgui.ControlImage(L+BorderWidth, T+BorderWidth, W-(BorderWidth*2), H-(BorderWidth*2), bgArt, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.BG)
			#title
			times = int(float(Font[-2:]))
			title = ADDONTITLE
			temp = title.replace('[', '<').replace(']', '>')
			temp = re.sub('<[^<]+?>', '', temp)
			title_width = len(str(temp))*(times - 1)
			title   = THEME2 % title
			self.title=xbmcgui.ControlTextBox(L+(W-title_width)/2,T+BorderWidth,title_width,30,font='font14',textColor='0xFF1E90FF')
			self.addControl(self.title)
			self.title.setText(title)
			#update
			if version < latest: msg = "Update avaliable for installed build:\n[COLOR %s]%s[/COLOR]\n\nCurrent Version: v[COLOR %s]%s[/COLOR]\nLatest Version: v[COLOR %s]%s[/COLOR]\n\n[COLOR %s]*Recommened: Fresh install[/COLOR]" % (COLOR1, build, COLOR1, version, COLOR1, latest, COLOR1)
			else: msg = "Running latest version of installed build:\n[COLOR %s]%s[/COLOR]\n\nCurrent Version: v[COLOR %s]%s[/COLOR]\nLatest Version: v[COLOR %s]%s[/COLOR]\n\n[COLOR %s]*Recommended: Fresh install[/COLOR]" % (COLOR1, build, COLOR1, version, COLOR1, latest, COLOR1)
			msg = THEME2 % msg
			self.update=xbmcgui.ControlTextBox(L+(BorderWidth*2),T+BorderWidth+30,W-150-(BorderWidth*3),H-(BorderWidth*2)-30,font=Font,textColor=TxtColor)
			self.addControl(self.update)
			self.update.setText(msg)
			#icon
			self.Icon=xbmcgui.ControlImage(L+W-(BorderWidth*2)-150, T+BorderWidth+35, 150, 150, icon, aspectRatio=0, colorDiffuse='0xAFFFFFFF')
			self.addControl(self.Icon)
			#buttons
			focus, nofocus = artwork('button')
			w1      = int((W-(BorderWidth*5))/3); h1 = 35
			t       = int(T+H-h1-(BorderWidth*1.5))
			fresh   = int(L+(BorderWidth*1.5))
			normal  = int(fresh+w1+BorderWidth)
			ignore  = int(normal+w1+BorderWidth)
			
			self.buttonFRESH=xbmcgui.ControlButton(fresh,t, w1,h1,"Fresh Install",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.buttonNORMAL=xbmcgui.ControlButton(normal,t,w1,h1,"Normal Install",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.buttonIGNORE=xbmcgui.ControlButton(ignore,t,w1,h1,"Ignore 3 days",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.addControl(self.buttonFRESH); self.addControl(self.buttonNORMAL); self.addControl(self.buttonIGNORE)
			self.buttonIGNORE.controlLeft(self.buttonNORMAL); self.buttonIGNORE.controlRight(self.buttonFRESH)
			self.buttonNORMAL.controlLeft(self.buttonFRESH); self.buttonNORMAL.controlRight(self.buttonIGNORE)
			self.buttonFRESH.controlLeft(self.buttonIGNORE); self.buttonFRESH.controlRight(self.buttonNORMAL)
			self.setFocus(self.buttonFRESH)
Ejemplo n.º 12
0
	def __init__(self):
		self.setCoordinateResolution(6)

		#
		# Menu
		
		# Build screen
		self.addControl(xbmcgui.ControlImage(0,0, 720,576, HOMEDIR+'images/background.png'))
		self.addControl(xbmcgui.ControlLabel(56,45, 200, 145, 'Arcade Browser v'+VERSION, 'special12', '0xFFFFFFFF'))
		self.addControl(xbmcgui.ControlImage(211, 29, 64, 43, HOMEDIR+"images/rednet.png"))
		self.addControl(xbmcgui.ControlLabel(280, 50, 200, 100, 'www.REDnet.nl', 'font101', '0xFFCCCCFF'))
		self.addControl(xbmcgui.ControlLabel(56,65, 200, 135, 'Emulators', 'special13', '0xFFFFFF00'))

		# Define controls
		self.lstMain = xbmcgui.ControlList(50, 110, 320, 450, buttonTexture=HOMEDIR+"images/btn.png", buttonFocusTexture=HOMEDIR+"images/btnHili.png")
		self.lblTotal = xbmcgui.ControlLabel(340,526, 200,35, '', 'font10', '0xFFFFFF00', alignment=1)
		self.lblTitle = xbmcgui.ControlLabel(400, 65, 400, 35, '', 'special13', '0xFFFFFF00')
		self.txtDesc = xbmcgui.ControlTextBox(400, 330, 290, 300, 'font101', '0xFFFFCC88') # Out of screen on purpose - no 1/1 in textfield
		self.lblDebug = xbmcgui.ControlLabel(4, 560, 0, 0, '', 'font10', '0xFFFF8800')
		self.imgPreview = xbmcgui.ControlImage(400, 115, 256, 192, "")
		self.btnView = xbmcgui.ControlButton(400, 504, 80, 30, "Favorites")
		self.btnInit = xbmcgui.ControlButton(496, 504, 80, 30, "Reload")
		self.btnHelp = xbmcgui.ControlButton(592, 504, 80, 30, "Help")

		# Add controls
		self.addControl(self.lstMain)
		self.addControl(self.lblTotal)
		self.addControl(self.lblTitle)
		self.addControl(self.txtDesc)
		self.addControl(self.imgPreview)
		self.addControl(self.lblDebug)

		# Add button controls
		self.addControl(self.btnView)
		self.addControl(self.btnInit)
		self.addControl(self.btnHelp)

		# Link control navigation
		self.lstMain.controlLeft(self.btnHelp)
		self.lstMain.controlRight(self.btnView)
		self.btnView.controlLeft(self.lstMain)
		self.btnView.controlRight(self.btnInit)
		self.btnInit.controlLeft(self.btnView)
		self.btnInit.controlRight(self.btnHelp)
		self.btnHelp.controlLeft(self.btnInit)
		self.btnHelp.controlRight(self.lstMain)

		self.setFocus(self.lstMain)

		self.getConfig(HOMEDIR+INIFILE)
		if not self.selRom < 0:
			self.listRoms(self.selEmu)
		else:
			self.listEmulators(self.selEmu)
Ejemplo n.º 13
0
 def __init__(self, *kargs):
     noFocus = sys.modules["__main__"].__root__ + '/icons/bookmarks.png'
     focus = sys.modules["__main__"].__root__ + '/icons/add_bookmark.png'
     self.addControl(
         xbmcgui.ControlLabel(
             0,
             self.height / 4,
             self.width,
             100,
             Localization.localize('Please, rate watched video:'),
             alignment=6))
     self.bad = xbmcgui.ControlButton(self.buttonWidth / 2,
                                      self.height / 2,
                                      self.buttonWidth,
                                      self.buttonHeight,
                                      Localization.localize('Bad'),
                                      alignment=6,
                                      textColor='0xFFCC3333',
                                      focusedColor='0xFFFF0000',
                                      focusTexture=focus,
                                      noFocusTexture=noFocus,
                                      shadowColor='0xFF000000')
     self.normal = xbmcgui.ControlButton(self.width / 2 -
                                         self.buttonWidth / 2,
                                         self.height / 2,
                                         self.buttonWidth,
                                         self.buttonHeight,
                                         Localization.localize('So-So'),
                                         alignment=6,
                                         textColor='0xFFCCCC33',
                                         focusedColor='0xFFFFFF00',
                                         focusTexture=focus,
                                         noFocusTexture=noFocus,
                                         shadowColor='0xFF000000')
     self.good = xbmcgui.ControlButton(self.width -
                                       self.buttonWidth * 3 / 2,
                                       self.height / 2,
                                       self.buttonWidth,
                                       self.buttonHeight,
                                       Localization.localize('Good'),
                                       alignment=6,
                                       textColor='0xFF33CC33',
                                       focusedColor='0xFF00FF00',
                                       focusTexture=focus,
                                       noFocusTexture=noFocus,
                                       shadowColor='0xFF000000')
     self.addControl(self.bad)
     self.addControl(self.normal)
     self.addControl(self.good)
     self.bad.setNavigation(self.bad, self.bad, self.bad, self.normal)
     self.normal.setNavigation(self.normal, self.normal, self.bad,
                               self.good)
     self.good.setNavigation(self.good, self.good, self.normal, self.good)
     self.setFocus(self.normal)
Ejemplo n.º 14
0
def addButon(self, text):
    if self.butalign == "Hori":
        c = xbmcgui.ControlButton(self.butx + (self.numbut * self.butwidth),
                                  self.buty, self.butwidth, self.butheight,
                                  text)
        self.addControl(c)
    elif self.butalign == "Vert":
        c = xbmcgui.ControlButton(self.butx,
                                  self.buty + (self.numbut * self.butheight),
                                  self.butwidth, self.butheight, text)
        self.addControl(c)
    self.numbut += 1
    return c
Ejemplo n.º 15
0
    def __init__(self):
        os.system("DISPLAY=:0 xdotool mousemove 32 90 click 1&")
        os.system("DISPLAY=:0 xdotool mousemove 2000 2000&")

        # Store original window ID
        self.prevWindowId = xbmcgui.getCurrentWindowId()

        # Go to x11 skin page
        xbmc.executebuiltin("XBMC.ActivateWindow(1114)")

        self.retval = 0

        # Background
        self.w = addonW  #self.getWidth()
        self.h = addonH  #self.getHeight()
        self.mediaPath = os.path.join(addon.getAddonInfo('path'), 'resources',
                                      'media') + '/'

        # Click button
        self.button_click = xbmcgui.ControlButton(
            0, 0, self.w, self.h, "", self.mediaPath + 'transparent.png',
            self.mediaPath + 'transparent.png', 0, 0)
        self.addControl(self.button_click)
        self.setFocus(self.button_click)

        # Back button
        self.button_back = xbmcgui.ControlButton(self.w - 50, self.h - 47, 50,
                                                 50, "", 'floor_buttonFO.png',
                                                 'floor_button.png', 0, 0)
        self.addControl(self.button_back)
        self.backImage = xbmcgui.ControlImage(self.w - 50, self.h - 47, 50, 50,
                                              'icon_back_w.png')
        self.addControl(self.backImage)

        # Add temp label on stage
        #self.addControl(tempLabel)

        # Invisible button used to control focus
        self.buttonfocus = xbmcgui.ControlButton(500, 0, 1, 1, "")
        self.addControl(self.buttonfocus)
        self.setFocus(self.buttonfocus)

        # Start click events thread
        #self.clickHandlerThread = clickHandlerClass()
        #self.clickHandlerThread.start()

        cmd = "DISPLAY=:0 /usr/bin/mplayer -vo x11 -fs -nosound --no-correct-pts --fps=15 -framedrop tv:// -tv driver=v4l2:norm=NTSC:width=720:height=576:device=/dev/video0:input=0"
        os.system(cmd)
        self.onControl(self.button_click)
        self.onControl(self.button_back)
Ejemplo n.º 16
0
    def __init__(self, *args, **kwargs):
        self.value = -1
        self.window = kwargs["window"]
        self.lvalues = kwargs['lvalues']
        self.values = kwargs['values']
        self.mode = kwargs['mode']
        self.enabled = True
        self.textControl = xbmcgui.ControlLabel(
            x=0,
            y=-100,
            width=kwargs['window'].controls_width / 2,
            height=kwargs['window'].height_control,
            label='',
            font=kwargs["window"].font,
            textColor=kwargs["color"],
            alignment=4 | 1)

        self.upButton = xbmcgui.ControlButton(
            x=0,
            y=-100,
            width=20,
            height=13,
            label='',
            font=kwargs["window"].font,
            textColor=kwargs["color"],
            alignment=4 | 1,
            focusTexture=os.path.join(self.window.mediapath, 'Controls',
                                      'UpFO.png'),
            noFocusTexture=os.path.join(self.window.mediapath, 'Controls',
                                        'UpNF.png'))

        self.downButton = xbmcgui.ControlButton(
            x=0,
            y=-100,
            width=20,
            height=13,
            label='',
            font=kwargs["window"].font,
            textColor=kwargs["color"],
            alignment=4 | 1,
            focusTexture=os.path.join(self.window.mediapath, 'Controls',
                                      'DownFO.png'),
            noFocusTexture=os.path.join(self.window.mediapath, 'Controls',
                                        'DownNF.png'))

        self.window.addControl(self)
        self.window.addControl(self.textControl)
        self.window.addControl(self.upButton)
        self.window.addControl(self.downButton)
        self.setValue(kwargs['value'])
Ejemplo n.º 17
0
    def __init__(self):
        self.addControl(
            xbmcgui.ControlImage(
                0, 0, 1280, 720,
                '/home/vader/.xbmc/scripts/helpMenu/helpMenuBackground.jpg'))
        self.strActionInfo = xbmcgui.ControlLabel(555, 60, 300, 200,
                                                  'Images (cont)',
                                                  'Font_Bold35', '0xFF000000')
        self.addControl(self.strActionInfo)

        #3 buttons: Image, left and right arrow
        self.imagesImage2 = xbmcgui.ControlButton(
            280,
            130,
            750,
            422,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/imagesHelp2.jpg'
        )
        self.addControl(self.imagesImage2)

        self.leftArrow = xbmcgui.ControlButton(
            550,
            600,
            100,
            80,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/leftArrow.jpg',
            focusTexture='/home/vader/.xbmc/scripts/helpMenu/FTleftArrow.jpg')
        self.addControl(self.leftArrow)

        self.rightArrow = xbmcgui.ControlButton(
            650,
            600,
            100,
            80,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/rightArrow.jpg',
            focusTexture='/home/vader/.xbmc/scripts/helpMenu/FTrightArrow.jpg')
        self.addControl(self.rightArrow)

        #Start flashing icon on Projector Icon
        self.setFocus(self.rightArrow)

        #Moves buttons can make
        self.leftArrow.controlLeft(self.rightArrow)
        self.leftArrow.controlRight(self.rightArrow)

        self.rightArrow.controlLeft(self.leftArrow)
        self.rightArrow.controlRight(self.leftArrow)
Ejemplo n.º 18
0
    def __init__(self):
        self.addControl(
            xbmcgui.ControlImage(
                0, 0, 1280, 720,
                '/home/vader/.xbmc/scripts/helpMenu/helpMenuBackground.jpg'))
        self.strActionInfo = xbmcgui.ControlLabel(570, 60, 200, 200,
                                                  'Front View', 'Font_Bold35',
                                                  '0xFF000000')
        self.addControl(self.strActionInfo)

        #3 buttons: Image, left and right arrow
        self.remoteImage1 = xbmcgui.ControlButton(
            395,
            105,
            537,
            527,
            '',
            noFocusTexture=
            '/home/vader/.xbmc/scripts/helpMenu/remoteKeysFront.jpg')
        self.addControl(self.remoteImage1)

        self.leftArrow = xbmcgui.ControlButton(
            550,
            600,
            100,
            80,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/leftArrow.jpg',
            focusTexture='/home/vader/.xbmc/scripts/helpMenu/FTleftArrow.jpg')
        self.addControl(self.leftArrow)

        self.rightArrow = xbmcgui.ControlButton(
            650,
            600,
            100,
            80,
            '',
            noFocusTexture='/home/vader/.xbmc/scripts/helpMenu/rightArrow.jpg',
            focusTexture='/home/vader/.xbmc/scripts/helpMenu/FTrightArrow.jpg')
        self.addControl(self.rightArrow)

        #Start flashing icon on Projector Icon
        self.setFocus(self.rightArrow)

        #Moves buttons can make
        self.leftArrow.controlLeft(self.rightArrow)
        self.leftArrow.controlRight(self.rightArrow)

        self.rightArrow.controlLeft(self.leftArrow)
        self.rightArrow.controlRight(self.leftArrow)
Ejemplo n.º 19
0
    def createButtons(self):
        buttons = []
        spacing = 60
        buttonWidth = 120
        buttonHeight = 30
        font = "font14"

        self.buttonOK = xbmcgui.ControlButton(
            self.x + buttonWidth + 20,
            self.y + spacing,
            80,
            buttonHeight,
            "OK",
            font=font,
            noFocusTexture=self.grayTexture,
            focusTexture=self.blueTexture,
        )
        self.buttonClose = xbmcgui.ControlButton(
            self.x + buttonWidth + 20,
            self.y + spacing + 35,
            80,
            buttonHeight,
            "Close",
            font=font,
            noFocusTexture=self.grayTexture,
            focusTexture=self.blueTexture,
        )

        for res in self.resolutions:
            buttons.append(
                xbmcgui.ControlButton(
                    self.x + 10,
                    self.y + spacing,
                    buttonWidth,
                    buttonHeight,
                    res,
                    noFocusTexture=self.grayTexture,
                    focusTexture=self.blueTexture,
                    font=font,
                ))
            spacing += 30

        self.addControls(buttons + [self.buttonOK, self.buttonClose])
        self.buttonIDs = [button.getId() for button in buttons]
        self.buttonCloseID = self.buttonClose.getId()

        self.buttonOKid = self.buttonOK.getId()
        self.menuButtons = [self.buttonOKid, self.buttonCloseID]
        self.setFocusId(self.buttonIDs[0])
Ejemplo n.º 20
0
	def __init__(self,noteType='t',noteMessage='',noteImage='',L=140,T=110,W=1000,H=500,Font='font14',TxtColor='0xFF64d1ff'):
		if len(noteImage)==0: noteImage=DefaultNoteImage
		if   (noteType.lower()=='text')  or (noteType.lower()=='t'): noteType='t'
		elif (noteType.lower()=='image') or (noteType.lower()=='i'): noteType='i'
		self.noteType=noteType; self.noteMessage=noteMessage; self.noteImage=noteImage; self.Font=Font; self.TxtColor=TxtColor; 
		## ### ## 
		self.background=OverlayBackground; #artp('black1'); 
		self.BG=xbmcgui.ControlImage(L,T,W,H,self.background,aspectRatio=0,colorDiffuse='0xFF3030FF'); 
		#self.OlayBrdr=xbmcgui.ControlImage(L,T,W,H,OverlayBorder,aspectRatio=0); 
		#self.OlaySplash=xbmcgui.ControlImage(L,T,W,H,icon,aspectRatio=0); 
		iLogoW=144; iLogoH=68; 
		self.iLogo=xbmcgui.ControlImage((L+(W/2))-(iLogoW/2),T+10,iLogoW,iLogoH,hubLogo,aspectRatio=0); 
		## ### ## 
		###L2=L+110; T2=T+130; W2=W-(T2-T)-90; H2=H-(L2-L)-110; #L3=L2+5; T3=T2+5; W3=W2-18; H3=H2-10; 
		##L2=L+87; T2=T+80; W2=W-(T2-T)-96; H2=H-(L2-L)-74; L3=L2+5; T3=T2+60; W3=W2-18; H3=H2-5-60; 
		#L2=L+67; T2=T+60; W2=W-(T2-T)-96; H2=H-(L2-L)-74; 
		L2=200; T2=200; W2=880; H2=340; 
		L3=L2+5; T3=T2+60; W3=W2-18; H3=H2-5-60; 
		self.ImgMessage=xbmcgui.ControlImage(L2,T2,W2,H2,self.noteImage,aspectRatio=0); 
		self.TxtMessage=xbmcgui.ControlTextBox(L2+5,T2,W2-10,H2,font=self.Font,textColor=self.TxtColor); 
		#self.TxtMessage=xbmcgui.ControlTextBox(L3,T3,W3,H3,font=self.Font,textColor=self.TxtColor); 
		#print [self.background,OverlayBorder,self.noteImage]
		## ### ## 
		focus=artp('button-focus_lightblue'); nofocus=artp('button-focus_grey'); 
		w1=120; h1=35; w2=160; h2=35; spacing1=20; 
		l2=L+W-spacing1-w2; t2=T+H-h2-spacing1; 
		l1=L+W-spacing1-w2-spacing1-w1; t1=T+H-h1-spacing1; ###Modded by FTG###
		self.buttonDismiss=xbmcgui.ControlButton(l1,t1,w1,h1,"Dismiss",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus); 
		self.buttonRemindMe=xbmcgui.ControlButton(l2,t2,w2,h2,"Remind Later",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus); 
		#self.buttonRemindMe=xbmcgui.ControlButton(l2,t2,w2,h2,"Remind Later",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus); 
		#self.OlaySplash
		for z in [self.BG,self.ImgMessage,self.TxtMessage,self.iLogo,self.buttonRemindMe,self.buttonDismiss]: self.addControl(z); 
		#for z in [self.BG,self.ImgMessage,self.TxtMessage,self.OlayBrdr,self.buttonRemindMe,self.buttonDismiss]: self.addControl(z); 
		#for z in [self.BG,self.OlayBrdr,self.ImgMessage,self.TxtMessage,self.buttonRemindMe,self.buttonDismiss]: self.addControl(z); 
		#self.OlayBrdr.setAnimations([('WindowOpen','effect=fade delay=0 time=0 start=0 end=70')]); 
		#self.ImgMessage.setAnimations([('WindowOpen','effect=fade delay=0 time=0 start=0 end=70')]); 
		#self.OlaySplash.setAnimations([('WindowOpen','effect=fade delay=0 time=8000 start=100 end=0')]); 
		#self.OlaySplash.setAnimations([('WindowOpen','effect=slide delay=0 time=5000 start=-1800 end=1800')]); 
		#self.ImgMessage.setAnimations([('WindowOpen','effect=fade delay=2000 time=2000 start=0 end=100')]); 
		#for z in [self.BG,self.ImgMessage,self.TxtMessage,self.OlayBrdr,self.buttonRemindMe,self.buttonDismiss]: 
		for z in [self.BG,self.ImgMessage,self.TxtMessage,self.iLogo,self.buttonRemindMe,self.buttonDismiss]: 
			#z.setAnimations([('WindowOpen','effect=slide delay=0 time=5000 start=0,-1800 end=0'),('WindowClose','effect=slide delay=0 time=5000 start=0 end=0,-1800')]); 
			z.setAnimations([('WindowOpen','effect=fade delay=0 time=2000 start=0 end=100'),('WindowClose','effect=slide delay=0 time=2000 start=0 end=0,'+str(0-(H+T+10)))]); 
		## ### ## 
		self.buttonRemindMe.controlLeft(self.buttonDismiss); self.buttonRemindMe.controlRight(self.buttonDismiss); 
		self.buttonDismiss.controlLeft(self.buttonRemindMe); self.buttonDismiss.controlRight(self.buttonRemindMe); 
		## ### ## 
		self.TxtMessage.setText(self.noteMessage); 
		self.setFocus(self.buttonRemindMe); 
Ejemplo n.º 21
0
    def renderHeader(self):
        numCols = int(self.hoursPerPage * 2)
        x = self.guide_x
        y = self.time_y
        h = self.time_h
        w = (self.guide_w - numCols * self.guide_dx) / numCols
        t = self.startTime
        lastDay = t.day
        i = 0
        log.debug("numCols=%d guide_w=%d" % (numCols, self.guide_w))

        if len(self.timeLabels) == 0:
            c = xbmcgui.ControlButton(
                self.channel_x + self.channel_dx + WIDTH_CHANNEL_ICON + 2,
                y,
                self.channel_w - self.channel_dx - WIDTH_CHANNEL_ICON - 14,
                h,
                label='',
                font='font13',
                noFocusTexture=self.platform.getMediaPath(
                    'gradient_header.png'))
            self.timeLabels.append(c)
            self.addControl(c)

            for i in xrange(numCols):
                c = xbmcgui.ControlButton(
                    x,
                    y,
                    w + 10,
                    h,
                    label='',
                    font='font13',
                    noFocusTexture=self.platform.getMediaPath(
                        'gradient_header.png'))
                self.timeLabels.append(c)
                self.addControl(c)
                x = x + w + self.guide_dx

        for i, c in enumerate(self.timeLabels):
            if i == 0:
                c.setLabel(label='', label2=t.strftime('%a %m/%d'))
            else:
                label = ('%d' % int(t.strftime('%I'))) + t.strftime(':%M %p')
                if t.day != lastDay:
                    label += '+1'
                t += timedelta(minutes=30)
                lastDay = t.day
                c.setLabel(label)
Ejemplo n.º 22
0
 def __init__(self, window, line, type, technology, id, name, value, left,
              top):
     #@param window : The main window against which we should register our items
     #@param line : the line where the device is
     #@param type : device type (lighting, temperature, etc)
     #@param name : device name
     #@param value : device value
     #@param left : left padding of the left-top corner
     #@param top : top padding of the left-top corner
     self._id = id
     self._technology = technology
     self.n = name
     self.line = line
     self.image = xbmcgui.ControlImage(left + 10, top + 10, 80, 80,
                                       'background.png')
     self._win = window
     self.name = xbmcgui.ControlButton(left + 10,
                                       top + 85,
                                       80,
                                       20,
                                       name,
                                       focusedColor='0xF0F0F0F0',
                                       alignment=2)
     #        self.name.setAnimations([('unfocus', 'effect=rotate start=0 end=180 time=4000',)])
     window.addControl(self.image)
     window.addControl(self.name)
     self.image.setAnimations([('WindowOpen',
                                'effect=slide start=500 time=800')])
     self.name.setAnimations([
         ('Focus', 'effect=fade start=60 end=100 time=200'),
         ('UnFocus', 'effect=fade start=100 end=60 time=200')
     ])
Ejemplo n.º 23
0
    def setFrame(self, title):
        """
		Define paths to images for window background and title background textures,
		and set control position adjustment constants used in setGrid.
		This is a helper method not to be called directly.
		"""
        if self.show_frame:
            if self.__background_img:
                self.main_bg = xbmcgui.ControlImage(1, 1, 1280, 720,
                                                    self.__background_img)
                self.addControl(self.main_bg)
            # Window background image
            self.background_img = os.path.join(_images, 'AddonWindow',
                                               'ContentPanel.png')
            # Background for a window header
            self.title_background_img = os.path.join(_images, 'AddonWindow',
                                                     'dialogheader.png')
            # Horisontal adjustment for a header background if the main background has transparent edges.
            self.X_MARGIN = 5
            # Vertical adjustment for a header background if the main background has transparent edges
            self.Y_MARGIN = 5
            # Header position adjustment if the main backround has visible borders.
            self.Y_SHIFT = 4
            # The height of a window header (for the title background and the title label).
            self.HEADER_HEIGHT = 35
            self.background = xbmcgui.ControlImage(-10, -10, 1, 1,
                                                   self.background_img)
            self.addControl(self.background)
            self.setAnimation(self.background)
            self.title_background = xbmcgui.ControlImage(
                -10, -10, 1, 1, self.title_background_img)
            self.addControl(self.title_background)
            self.setAnimation(self.title_background)
            self.title_bar = xbmcgui.ControlLabel(-10,
                                                  -10,
                                                  1,
                                                  1,
                                                  title,
                                                  alignment=ALIGN_CENTER,
                                                  textColor='0xFFFFA500',
                                                  font='font13_title')
            self.addControl(self.title_bar)
            self.setAnimation(self.title_bar)
            self.window_close_button = xbmcgui.ControlButton(
                -100,
                -100,
                60,
                30,
                '',
                focusTexture=os.path.join(_images, 'AddonWindow',
                                          'DialogCloseButton-focus.png'),
                noFocusTexture=os.path.join(_images, 'AddonWindow',
                                            'DialogCloseButton.png'))
            self.addControl(self.window_close_button)
            self.setAnimation(self.window_close_button)
        else:
            self.X_MARGIN = 0
            self.Y_MARGIN = 0
            self.Y_SHIFT = 0
            self.HEADER_HEIGHT = 0
Ejemplo n.º 24
0
    def onInit(self):
        self.title_control = xbmcgui.ControlLabel(400,
                                                  55,
                                                  600,
                                                  75,
                                                  self.scene.get_name(),
                                                  font="font16",
                                                  textColor="white")
        self.radiobutton_control = self.getControl(134)
        self.addControl(self.title_control)
        self.__set_state()

        self.gerate_group_control = self.getControl(146)
        self.gerate_group_control.setPosition(350, 300)
        self.gerate_group_control.setVisible(True)
        self.gerate_group_control.setHeight(100)

        self.execcontrol = xbmcgui.ControlButton(
            600, 110, 120, 50, self.addon.getLocalizedString(32370))
        self.addControl(self.execcontrol)
        if not self.scene.is_executable():
            self.execcontrol.setVisible(False)

        self.__generate_geraetelist()
        self.__generate_automationlist()
        self.__handle_navigation(self.scene.is_executable())
Ejemplo n.º 25
0
    def add_control_list(self, c):
        control = xbmcgui.ControlButton(0,
                                        -100,
                                        self.controls_width + 10,
                                        self.height_control,
                                        c["label"],
                                        os.path.join(self.mediapath,
                                                     'Controls',
                                                     'MenuItemFO.png'),
                                        os.path.join(self.mediapath,
                                                     'Controls',
                                                     'MenuItemNF.png'),
                                        10,
                                        textColor=c["color"],
                                        font=self.font)
        label = xbmcgui.ControlLabel(0,
                                     -100,
                                     self.controls_width,
                                     self.height_control,
                                     "",
                                     font=self.font,
                                     textColor=c["color"],
                                     alignment=1 | 4)

        self.addControl(control)
        self.addControl(label)

        control.setVisible(False)
        label.setVisible(False)
        label.setLabel(c["lvalues"][self.values[c["id"]]])

        c["control"] = control
        c["label"] = label
Ejemplo n.º 26
0
def AddButton(win,text,ext_gap=0,text_fc="dialog-context-button-FO.png",textn_fc="dialog-context-button-NF.png"):
    #text_fc="button-focus.png",textn_fc="button-nofocus.png"
    win.buty = win.buty + ext_gap
    c = xbmcgui.ControlButton(win.butx ,win.buty + (win.numbut * win.butheight + win.gap*win.numbut),win.butwidth,win.butheight,text,text_fc,textn_fc,textColor=fc,font="font13",alignment=6)
    win.addControl(c)
    win.numbut += 1
    return c
Ejemplo n.º 27
0
    def displayProgram(self, program):
        channel_index = program['channel']
        program_index = program[
            'program']  # index in channel (not sure how you're going to define it, but let's stick with it for now)
        program_start = program['start']  # in minutes
        program_length = program['length']  # in minutes
        program_title = program['title']

        print program_start
        print program_length
        print program_title

        pos_x = self.PROGRAM_AREA_X + (program_start *
                                       self.PIXELS_PER_MINUTE) + (
                                           (program_index - 1) * self.GAP)
        pos_y = self.PROGRAM_AREA_Y + (channel_index * self.PROGRAM_HEIGHT) + (
            (channel_index - 1) * self.GAP)
        width = program_length * self.PIXELS_PER_MINUTE
        height = self.PROGRAM_HEIGHT

        button = xbmcgui.ControlButton(pos_x,
                                       pos_y,
                                       width,
                                       height,
                                       program_title,
                                       focusTexture='channels_bar1.png',
                                       noFocusTexture='channels_bar1.png')
        self.addControl(button)
Ejemplo n.º 28
0
    def __init__(self):
        self.retval = 0
        self.w = 1280
        self.h = 720

        self.background = xbmcgui.ControlImage(
            0,
            0,
            self.w,
            self.h,
            os.path.join(settings_addon.getAddonInfo('path'), 'resources',
                         'media', 'background.jpg'),
            colorDiffuse='0xff777777')
        self.addControl(self.background)

        # Создаем текстовую надпись.
        self.label = xbmcgui.ControlLabel(780,
                                          200,
                                          1024,
                                          900,
                                          self.read_ical(),
                                          textColor='0xFFFFFFFF',
                                          font='Font_Neon_200')
        # Добавляем надпись в контейнер
        self.addControl(self.label)
        # Background
        self.buttonok = xbmcgui.ControlButton(
            self.w / 2 - 100,
            self.h - 80,
            200,
            30,
            settings_addon.getLocalizedString(id=30003),
            alignment=6)
        self.addControl(self.buttonok)
Ejemplo n.º 29
0
	def displayButtonClose(self, function="true"):
		if (function == "true"):
			self.button_close_glow = xbmcgui.ControlImage(880, 418, 300, 122, '', aspectRatio=0)
			self.addControl(self.button_close_glow)
			self.button_close_glow.setVisible(False)
			self.button_close_glow.setImage(self.image_button_run_glow)
			self.button_close_glow.setAnimations([
				('conditional',
				'effect=fade start=0 time=1000 delay=2000 pulse=true condition=Control.IsVisible(%d)' % self.button_close_glow.getId())
			])

			self.button_close = xbmcgui.ControlButton(99999, 99999, 300, 122, "[B]Close[/B]",
													focusTexture=self.image_button_run,
													noFocusTexture=self.image_button_run, alignment=2 | 4,
													textColor='0xFF000000', focusedColor='0xFF000000',
													shadowColor='0xFFCCCCCC')
			self.addControl(self.button_close)
			self.button_close.setVisible(False)
			self.button_close.setPosition(880, 418)
			self.button_close_ID = self.button_close.getId()
			self.button_close.setAnimations([
				('conditional',
				'effect=fade start=0 end=100 delay=1000 time=1000 condition=Control.IsVisible(%d)' % self.button_close.getId())
			])
		elif (function == "visible"):
			self.button_close.setVisible(True)
			self.button_close_glow.setVisible(True)
			self.setFocus(self.button_close)
		else:
			self.button_close.setVisible(False)
			self.button_close_glow.setVisible(False)
Ejemplo n.º 30
0
	def displayButtonRun(self, function="true"):
		if (function == "true"):
			button_run_glowx = (self.screenx / 3) - (300 / 2)
			button_run_glowy = (self.screeny / 3) - (122 / 2) + 50

			self.button_run_glow = xbmcgui.ControlImage(button_run_glowx, button_run_glowy, 300, 122, '', aspectRatio=0)
			self.addControl(self.button_run_glow)
			self.button_run_glow.setVisible(False)
			self.button_run_glow.setImage(self.image_button_run_glow)
			self.button_run_glow.setAnimations([
				('conditional', 'effect=fade start=0 time=1000 condition=true pulse=true')
			])

			self.button_run = xbmcgui.ControlButton(button_run_glowx, button_run_glowy, 300, 122, "[B]Run Speedtest[/B]",
													focusTexture=self.image_button_run,
													noFocusTexture=self.image_button_run, alignment=2 | 4,
													textColor='0xFF000000', focusedColor='0xFF000000',
													shadowColor='0xFFCCCCCC', disabledColor='0xFF000000')
			self.addControl(self.button_run)
			self.setFocus(self.button_run)
			self.button_run.setVisible(False)
			self.button_run.setAnimations([
				('conditional',
				'effect=fade start=100 end=0 time=300 condition=!Control.IsEnabled(%d)' % self.button_run.getId())
			])
			self.button_run_ID = self.button_run.getId()
			self.button_run.setEnabled(True)
			self.button_run.setVisible(True)
			self.button_run_glow.setEnabled(True)
			self.button_run_glow.setVisible(True)
		else:
			self.button_run.setEnabled(False)
			self.button_run.setVisible(False)
			self.button_run_glow.setEnabled(False)
			self.button_run_glow.setVisible(False)