當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmcgui.ControlButton方法代碼示例

本文整理匯總了Python中xbmcgui.ControlButton方法的典型用法代碼示例。如果您正苦於以下問題:Python xbmcgui.ControlButton方法的具體用法?Python xbmcgui.ControlButton怎麽用?Python xbmcgui.ControlButton使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xbmcgui的用法示例。


在下文中一共展示了xbmcgui.ControlButton方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
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, 220, 50, label=u'輸入驗證碼', alignment=6, font='font13', textColor='0xFFFFFFFF'
        )
        self.buttonRefresh = xbmcgui.ControlButton(
            290, 330, 220, 50, label=u'刷新驗證碼', alignment=6, font='font13', textColor='0xFFFFFFFF'
        )
        self.addControls([self.image, self.buttonInput, self.buttonRefresh])
        self.buttonInput.controlRight(self.buttonRefresh)
        self.buttonRefresh.controlLeft(self.buttonInput)
        self.setFocus(self.buttonInput) 
開發者ID:taxigps,項目名稱:xbmc-addons-chinese,代碼行數:21,代碼來源:get_auth.py

示例2: add_control_list

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
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 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:35,代碼來源:xbmc_config_menu.py

示例3: __new__

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def __new__(cls, *args, **kwargs):
        del kwargs["isPassword"]
        del kwargs["window"]
        args = list(args)
        return xbmcgui.ControlButton.__new__(cls, *args, **kwargs) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:7,代碼來源:xbmc_config_menu.py

示例4: setLabel

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def setLabel(self, val):
        self.label = val
        xbmcgui.ControlButton.setLabel(self, val) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:5,代碼來源:xbmc_config_menu.py

示例5: getX

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def getX(self):
        return xbmcgui.ControlButton.getPosition(self)[0] 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:4,代碼來源:xbmc_config_menu.py

示例6: getY

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def getY(self):
        return xbmcgui.ControlButton.getPosition(self)[1] 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:4,代碼來源:xbmc_config_menu.py

示例7: setWidth

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def setWidth(self, w):
        xbmcgui.ControlButton.setWidth(self, w)
        self.textControl.setWidth(old_div(w, 2)) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:5,代碼來源:xbmc_config_menu.py

示例8: setHeight

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def setHeight(self, w):
        xbmcgui.ControlButton.setHeight(self, w)
        self.textControl.setHeight(w) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:5,代碼來源:xbmc_config_menu.py

示例9: setPosition

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def setPosition(self, x, y):
        xbmcgui.ControlButton.setPosition(self, x, y)
        if xbmcgui.__version__ == "1.2":
            self.textControl.setPosition(x + self.getWidth(), y)
        else:
            self.textControl.setPosition(x + old_div(self.getWidth(), 2), y) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:8,代碼來源:xbmc_config_menu.py

示例10: onInit

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def onInit(self):
		#xbmc.executebuiltin('ReplaceWindow(progressdialog)')
		#xbmc.executebuiltin('Dialog.Close(progressdialog)')
		#ctr=self.getControl(10101)
		#ctr.close()
		print 'lalalalal'
		st_x=250
		st_y=250
		y=1
		while (y<5):
			n=1
			while (n<15):
				self.label = xbmcgui.ControlButton(st_x+n*50, st_y+y*50, 50, 50, self.lns[y-1][n-1])
				if n==1: 
					self.label.setWidth(100)
					self.label.setPosition(st_x, st_y+y*50)
				if n==14: 
					self.label.setWidth(100)
					self.label.setPosition(st_x+n*50, st_y+y*50)
				self.label.setVisible(False)
				self.addControl(self.label)
				#print self.label.getId()
				n=n+1
			y=y+1
			
		id=3001
		y=1
		while (y<5):
			n=1
			while (n<15):
				self.label = self.getControl(3001+(n-1)+(y-1)*14)
				if n>1: self.label.controlLeft(self.getControl(3001+(n-1)+(y-1)*14-1))
				if y>1: self.label.controlUp(self.getControl(3001+(n-1)+(y-2)*14))
				if n<14: self.label.controlRight(self.getControl(3001+(n-1)+(y-1)*14+1))
				if y<4: self.label.controlDown(self.getControl(3001+(n-1)+(y)*14))
				#print self.label.getId()
				n=n+1
				self.label.setVisible(True)
			y=y+1
		pass
		# Put your List Populating code/ and GUI startup stuff here 
開發者ID:seppius-xbmc-repo,項目名稱:ru,代碼行數:43,代碼來源:keyboard_ru.py

示例11: setFrame

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
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.
        """
        # 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) 
開發者ID:seppius-xbmc-repo,項目名稱:ru,代碼行數:35,代碼來源:addonwindow.py

示例12: add_control_list

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
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 
開發者ID:pelisalacarta-ce,項目名稱:pelisalacarta-ce,代碼行數:36,代碼來源:xbmc_config_menu.py

示例13: setWidth

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def setWidth(self, w):
        xbmcgui.ControlButton.setWidth(self, w)
        self.textControl.setWidth(w/2) 
開發者ID:pelisalacarta-ce,項目名稱:pelisalacarta-ce,代碼行數:5,代碼來源:xbmc_config_menu.py

示例14: setPosition

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def setPosition(self, x, y):
        xbmcgui.ControlButton.setPosition(self, x, y)
        if xbmcgui.__version__ == "1.2":
          self.textControl.setPosition(x + self.getWidth(), y)
        else:
          self.textControl.setPosition(x + self.getWidth() / 2, y) 
開發者ID:pelisalacarta-ce,項目名稱:pelisalacarta-ce,代碼行數:8,代碼來源:xbmc_config_menu.py

示例15: _place_window

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ControlButton [as 別名]
def _place_window(self, width, height, title):
        """ Main window drawing """

        X_MARGIN = 5    # Horisontal adjustment for a header background if the main background has transparent edges. 
        Y_MARGIN = 5    # Vertical adjustment for a header background if the main background has transparent edges  
        Y_SHIFT = 4     # Header position adjustment if the main backround has visible borders.
        HEADER_HEIGHT = 35  # The height of a window header (for the title background and the title label).


        background_img = os.path.join(_images, 'AddonWindow', 'ContentPanel.png')
        background = xbmcgui.ControlImage(self.x, self.y, width, height, background_img)
        
        title_background_img = os.path.join(_images, 'AddonWindow', 'dialogheader.png')
        title_background = xbmcgui.ControlImage(self.x + X_MARGIN, self.y + Y_MARGIN, width - 2 * X_MARGIN, HEADER_HEIGHT, title_background_img)
        
        title_bar = xbmcgui.ControlLabel(self.x + X_MARGIN, self.y + Y_MARGIN + Y_SHIFT, width - 2 * X_MARGIN, HEADER_HEIGHT,
                                         title, alignment=ALIGN_CENTER, textColor='0xFFFFA500', font='font13_title')
        
        self.window_close_button = xbmcgui.ControlButton(self.x + width - 70, self.y + Y_MARGIN + Y_SHIFT, 60, 30, '',
                        focusTexture=os.path.join(_images, 'AddonWindow', 'DialogCloseButton-focus.png'),
                        noFocusTexture=os.path.join(_images, 'AddonWindow', 'DialogCloseButton.png'))
        
        self.addControl(background)
        self.addControl(title_background)
        self.addControl(title_bar)
        self.addControl(self.window_close_button) 
開發者ID:maikito26,項目名稱:plugin.video.surveillanceroom,代碼行數:28,代碼來源:camerasettings.py


注:本文中的xbmcgui.ControlButton方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。