本文整理汇总了Python中xbmcgui.ControlLabel方法的典型用法代码示例。如果您正苦于以下问题:Python xbmcgui.ControlLabel方法的具体用法?Python xbmcgui.ControlLabel怎么用?Python xbmcgui.ControlLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbmcgui
的用法示例。
在下文中一共展示了xbmcgui.ControlLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _generate_levels_labels
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def _generate_levels_labels(self):
"""Generate descriptions for the levels dynamically"""
# Limit to 1200 px max (should be longer than slider)
width = int(1200 / self.levels_count)
height = 100
pos_x = 175
pos_y = 508 # 668
self.controls = {}
for index, rating_level in enumerate(self.rating_levels):
current_x = pos_x + (width * index)
maturity_name = '[' + rating_level['label'] + ']'
lbl = xbmcgui.ControlLabel(current_x, pos_y, width, height, maturity_name,
font='font10',
alignment=XBFONT_CENTER_X)
self.controls.update({index: lbl})
self.addControl(lbl)
# pylint: disable=no-member
示例2: __init__
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def __init__(self, w=OVERLAY_WIDTH, h=OVERLAY_HEIGHT, *args, **kwargs):
self.window = xbmcgui.Window(WINDOW_FULLSCREEN_VIDEO)
viewport_w, viewport_h = self._get_skin_resolution()
# Adjust size based on viewport, we are using 1080p coordinates
w = int(old_div(w * viewport_w, VIEWPORT_WIDTH))
h = int(old_div(h * viewport_h, VIEWPORT_HEIGHT))
x = old_div((viewport_w - w), 2)
y = old_div((viewport_h - h), 2) + int(ADDON.getSetting(id="overlay_status_offset"))
self._shown = False
self._text = ""
self._label = xbmcgui.ControlLabel(x, y, w, h, self._text,
alignment=XBFONT_CENTER_X | XBFONT_CENTER_Y, *args, **kwargs)
self._shadow = xbmcgui.ControlLabel(x + 1, y + 1, w, h, self._text,
textColor='0xD0000000',
alignment=XBFONT_CENTER_X | XBFONT_CENTER_Y, *args, **kwargs)
if not PY3:
self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(ADDON_PATH, "resources", "img", "black.png").encode('utf-8'))
else:
self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(ADDON_PATH, "resources", "img", "black.png"))
if isinstance(self._background, bytes):
self._background = self._background.decode("utf8")
self._background.setColorDiffuse("0xD0000000")
示例3: place_sound_enable
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def place_sound_enable(self, row):
""" Enable sound detection button """
label_value = 'Sound Detection'
self.label_s = xbmcgui.ControlLabel(self.x + self.X_SHIFT, self.y + self.ROW_START + self.ROW_HEIGHT * row,
self.LABEL_WIDTH, self.ROW_HEIGHT, label_value)
BUTTON_WIDTH = 160
self.radio_sound = RadioButton(self.x + self.X_SHIFT + self.LABEL_WIDTH,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
BUTTON_WIDTH, self.ROW_HEIGHT, self.label_enabled.get(self.s_enable))
self.addControl(self.label_s)
self.addControl(self.radio_sound)
if self.s_enable == 1:
self.radio_sound.setSelected(True)
示例4: __init__
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def __init__(self, w, h, *args, **kwargs):
self.window = xbmcgui.Window(WINDOW_FULLSCREEN_VIDEO)
viewport_w, viewport_h = self._get_skin_resolution()
# Adjust size based on viewport, we are using 1080p coordinates
w = int(w * viewport_w / VIEWPORT_WIDTH)
h = int(h * viewport_h / VIEWPORT_HEIGHT)
x = (viewport_w - w) / 2
y = (viewport_h - h) / 2
self._shown = False
self._text = ""
self._label = xbmcgui.ControlLabel(x, y, w, h, self._text, *args, **kwargs)
self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(RESOURCES_PATH, "images", "black.png"))
self._background.setColorDiffuse("0xD0000000")
示例5: __init__
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def __init__(self):
self.showing = False
self.window = xbmcgui.Window(12005)
viewport_w, viewport_h = self._get_skin_resolution()
font_max = 'font13'
font_min = 'font10'
origin_x = int(float(viewport_w)/1.3913)
origin_y = int(float(viewport_h)/8.0)
window_w = int(float(viewport_w)/3.7647)
window_h = int(float(viewport_h)/2.5714)
acelogo_w = int(float(window_w)/8.5)
acelogo_h = int(float(window_w)/11.0)
text_lat = int(float(window_w)/15)
text_w = int(float(window_w)/1.7)
text_h = int(float(window_h)/14)
fst_setting = int(float(window_h)/3.5)
fst_stat_setting = int(float(window_h)/1.4)
#main window
self._background = xbmcgui.ControlImage(origin_x, origin_y, window_w, window_h, os.path.join(addonpath,"resources","art","background.png"))
self._acestreamlogo = xbmcgui.ControlImage(origin_x + int(float(window_w)/11.3), origin_y + int(float(window_h)/14), acelogo_w, acelogo_h, os.path.join(addonpath,"resources","art","acestreamlogo.png"))
self._supseparator = xbmcgui.ControlImage(origin_x, origin_y + int(float(viewport_h)/12.176), window_w-10, 1, os.path.join(addonpath,"resources","art","separator.png"))
self._botseparator = xbmcgui.ControlImage(origin_x, origin_y + window_h - 30, window_w-10, 1, os.path.join(addonpath,"resources","art","separator.png"))
self._title = xbmcgui.ControlLabel(origin_x+int(float(window_w)/3.4), origin_y + text_h, window_w - 140, text_h, str(translate(30062)), font=font_max, textColor='0xFFEB9E17')
self._total_stats_label = xbmcgui.ControlLabel(origin_x+int(float(window_h)/1.72), origin_y + int(float(window_h)/1.6), int(float(window_w)/1.7), 20, str(translate(30063)), font=font_min, textColor='0xFFEB9E17')
#labels
self._action = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting, int(float(text_w)*1.6), text_h, str(translate(30064)) + ' N/A', font=font_min)
self._download = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + text_h, int(float(text_w)*1.6), text_h, str(translate(30065)) + ' N/A', font=font_min)
self._upload = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + 2*text_h, text_w, text_h, str(translate(30066)) + ' N/A', font=font_min)
self._seeds = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + 3*text_h, text_w, text_h, str(translate(30067)) + ' N/A', font=font_min)
self._total_download = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_stat_setting, text_w, text_h, str(translate(30068)) + ' N/A', font=font_min)
self._total_upload = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_stat_setting + text_h, text_w, text_h, str(translate(30069)) + ' N/A', font=font_min)
self._percent_value = xbmcgui.ControlLabel(origin_x+int(float(window_h)/1.05), origin_y + fst_setting, text_w, text_h,'N/A', font=font_min)
示例6: add_control_label
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def add_control_label(self, c):
control = xbmcgui.ControlLabel(0, -100, self.controls_width, 30, "", alignment=4, font=self.font,
textColor=c["color"])
self.addControl(control)
control.setVisible(False)
control.setLabel(c["label"])
# Lo añadimos al listado
c["control"] = control
示例7: add_control_list
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [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
示例8: __init__
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def __init__(self, *args, **kwargs):
self.isPassword = kwargs["isPassword"]
self.window = kwargs["window"]
self.label = ""
self.text = ""
self.textControl = xbmcgui.ControlLabel(self.getX(), self.getY(), self.getWidth(), self.getHeight(), self.text,
font=kwargs["font"], textColor=kwargs["textColor"], alignment=4 | 1)
self.window.addControl(self.textControl)
示例9: onClick
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def onClick(self, controlID):
#labl=xbmcgui.ControlLabel()
#labl.x=500
# labl.y=500
#labl.width=50
# labl.height=50
#labl.label='Enter'
if self.getControl(controlID).getLabel() not in COMMBUTONS:
self.label = self.getControl(3000)
self.text=self.text+self.getControl(controlID).getLabel()
self.label.setText(self.text)
if self.getControl(controlID).getLabel() == 'space' : #del
self.text=self.text+' '
if self.getControl(controlID).getLabel() == 'en' : #del
self.lns=lines
self.labelezation(lines)
if self.getControl(controlID).getLabel() == 'ru' : #del
self.lns=lines_ru
self.labelezation(lines_ru)
if self.getControl(controlID).getLabel() == 'ru' : #del
self.text=self.text+' '
if self.getControl(controlID).getLabel() == 'clear' : #del
self.text=''
#print self.getControl(controlID).getLabel()
if self.getControl(controlID).getLabel() == 'del' : #del
self.text=self.text[0:(len(self.text)-1)]
if self.getControl(controlID).getLabel() == 'enter' : #Exit
self.close()
if self.getControl(controlID).getLabel() == 'cancel' : #Enter
self.close()
self.label.setText(self.text)
pass
示例10: setFrame
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [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)
示例11: add_control_label
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def add_control_label(self, c):
control = xbmcgui.ControlLabel(0, -100, self.controls_width, 30, "", alignment=4, font=self.font, textColor=c["color"])
self.addControl(control)
control.setVisible(False)
control.setLabel(c["label"])
# Lo añadimos al listado
c["control"] = control
示例12: add_control_list
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [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
示例13: _place_window
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [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)
示例14: place_pt_speedconfig
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def place_pt_speedconfig(self, row):
""" Pan and Tilt Camera Speed Controls """
self.ptlabel = {0: 'Very Slow',
1: 'Slow',
2: 'Normal',
3: 'Fast',
4: 'Very Fast'}
self.pt_speed = int(self.camera.get_ptz_speed()[1].get('speed'))
label_value = 'Pan & Tilt Speed'
self.label_pt = xbmcgui.ControlLabel(self.x + self.X_SHIFT,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
self.LABEL_WIDTH, self.ROW_HEIGHT, label_value)
BUTTON_WIDTH = 40
LABEL_WIDTH = 160
SPACE = 20
self.button_pt_speedup = Button(self.x + self.X_SHIFT + self.LABEL_WIDTH,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
BUTTON_WIDTH, self.ROW_HEIGHT, '+')
self.label_pt_speedsetting = xbmcgui.ControlLabel(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH + SPACE,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
LABEL_WIDTH, self.ROW_HEIGHT, self.ptlabel.get(self.pt_speed), alignment = 6)
self.button_pt_speeddown = Button(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH + LABEL_WIDTH + SPACE,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
BUTTON_WIDTH, self.ROW_HEIGHT, '-')
self.addControl(self.label_pt)
self.addControl(self.button_pt_speedup)
self.addControl(self.label_pt_speedsetting)
self.addControl(self.button_pt_speeddown)
self.button_pt_speedup.controlLeft(self.button_pt_speeddown)
self.button_pt_speedup.controlRight(self.button_pt_speeddown)
self.button_pt_speeddown.controlLeft(self.button_pt_speedup)
self.button_pt_speeddown.controlRight(self.button_pt_speedup)
示例15: place_z_speedconfig
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import ControlLabel [as 别名]
def place_z_speedconfig(self, row):
""" Zoom Camera Speed controls """
self.zlabel = {0: 'Slow',
1: 'Normal',
2: 'Fast',}
self.z_speed = int(self.camera.get_ptz_zoom_speed()[1].get('speed'))
label_value = 'Zoom Speed'
self.label_z = xbmcgui.ControlLabel(self.x + self.X_SHIFT,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
self.LABEL_WIDTH, self.ROW_HEIGHT, label_value)
BUTTON_WIDTH = 40
LABEL_WIDTH = 160
SPACE = 20
self.button_z_speedup = Button(self.x + self.X_SHIFT + self.LABEL_WIDTH,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
BUTTON_WIDTH, self.ROW_HEIGHT, '+')
self.label_z_speedsetting = xbmcgui.ControlLabel(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH + SPACE,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
LABEL_WIDTH, self.ROW_HEIGHT, self.zlabel.get(self.z_speed), alignment = 6)
self.button_z_speeddown = Button(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH + LABEL_WIDTH + SPACE,
self.y + self.ROW_START + self.ROW_HEIGHT * row,
BUTTON_WIDTH, self.ROW_HEIGHT, '-')
self.addControl(self.label_z)
self.addControl(self.button_z_speedup)
self.addControl(self.label_z_speedsetting)
self.addControl(self.button_z_speeddown)
self.button_z_speedup.controlLeft(self.button_z_speeddown)
self.button_z_speedup.controlRight(self.button_z_speeddown)
self.button_z_speeddown.controlLeft(self.button_z_speedup)
self.button_z_speeddown.controlRight(self.button_z_speedup)