Python xbmcgui.ControlLabel() Examples

The following are 29 code examples of xbmcgui.ControlLabel(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmcgui , or try the search function .
Example #1
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
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 
Example #2
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #3
Source File: overlay.py    From addon with GNU General Public License v3.0 6 votes vote down vote up
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") 
Example #4
Source File: keyboard_ru.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #5
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
def place_sound_triggerconfig(self, row):
        """ Sound detection trigger interval control """
        
        label_value = 'Sound Trigger Interval'
        self.label_st = 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_s_triggerup = 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_s_triggersetting = 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.label_interval.get(self.s_trigger), alignment = 6)
        
        self.button_s_triggerdown = 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_st)
        self.addControl(self.button_s_triggerup)
        self.addControl(self.label_s_triggersetting)
        self.addControl(self.button_s_triggerdown)

        self.button_s_triggerup.controlLeft(self.button_s_triggerdown)
        self.button_s_triggerup.controlRight(self.button_s_triggerdown)
        self.button_s_triggerdown.controlLeft(self.button_s_triggerup)
        self.button_s_triggerdown.controlRight(self.button_s_triggerup) 
Example #6
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
def place_sound_sensitivityconfig(self, row):
        """ Sound detection sensitivity control """
        
        label_value = 'Sound Sensitivity'
        self.label_ss = 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_s_sensitivityup = 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_s_sensitivitysetting = 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.label_sensitivity.get(self.s_sensitivity), alignment = 6)
        
        self.button_s_sensitivitydown = 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_ss)
        self.addControl(self.button_s_sensitivityup)
        self.addControl(self.label_s_sensitivitysetting)
        self.addControl(self.button_s_sensitivitydown)

        self.button_s_sensitivityup.controlLeft(self.button_s_sensitivitydown)
        self.button_s_sensitivityup.controlRight(self.button_s_sensitivitydown)
        self.button_s_sensitivitydown.controlLeft(self.button_s_sensitivityup)
        self.button_s_sensitivitydown.controlRight(self.button_s_sensitivityup) 
Example #7
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
def place_motion_triggerconfig(self, row):
        """ Motion detection trigger interval control """
        
        label_value = 'Motion Trigger Interval'
        self.label_mt = 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_m_triggerup = 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_m_triggersetting = 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.label_interval.get(self.m_trigger), alignment = 6)
        
        self.button_m_triggerdown = 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_mt)
        self.addControl(self.button_m_triggerup)
        self.addControl(self.label_m_triggersetting)
        self.addControl(self.button_m_triggerdown)

        self.button_m_triggerup.controlLeft(self.button_m_triggerdown)
        self.button_m_triggerup.controlRight(self.button_m_triggerdown)
        self.button_m_triggerdown.controlLeft(self.button_m_triggerup)
        self.button_m_triggerdown.controlRight(self.button_m_triggerup)


    # SOUND ####################################################### 
Example #8
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
def place_motion_sensitivityconfig(self, row):
        """ Motion Detection Sensitivity control """
        
        label_value = 'Motion Sensitivity'
        self.label_ms = 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_m_sensitivityup = 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_m_sensitivitysetting = 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.label_sensitivity.get(self.m_sensitivity), alignment = 6)
        
        self.button_m_sensitivitydown = 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_ms)
        self.addControl(self.button_m_sensitivityup)
        self.addControl(self.label_m_sensitivitysetting)
        self.addControl(self.button_m_sensitivitydown)

        self.button_m_sensitivityup.controlLeft(self.button_m_sensitivitydown)
        self.button_m_sensitivityup.controlRight(self.button_m_sensitivitydown)
        self.button_m_sensitivitydown.controlLeft(self.button_m_sensitivityup)
        self.button_m_sensitivitydown.controlRight(self.button_m_sensitivityup) 
Example #9
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
def place_mjpeg_enable(self, row):
        """ Enable MJPEG Video Control """
        
        label_value = 'Substream Type'
        self.label_mjpeg = 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 = 120
        SPACE = 20
        
        self.radio_mjpeg = RadioButton(self.x + self.X_SHIFT + self.LABEL_WIDTH,
                                        self.y + self.ROW_START + self.ROW_HEIGHT * row,
                                        BUTTON_WIDTH, self.ROW_HEIGHT, 'MJPEG')

        self.radio_h264 = RadioButton(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH + SPACE,
                                      self.y + self.ROW_START + self.ROW_HEIGHT * row,
                                      BUTTON_WIDTH, self.ROW_HEIGHT, 'h264')
        
        self.addControl(self.label_mjpeg)
        self.addControl(self.radio_mjpeg)
        self.addControl(self.radio_h264)

        self.radio_mjpeg.controlLeft(self.radio_h264)
        self.radio_mjpeg.controlRight(self.radio_h264)
        self.radio_h264.controlLeft(self.radio_mjpeg)
        self.radio_h264.controlRight(self.radio_mjpeg)

    
    # MOTION ####################################################### 
Example #10
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #11
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #12
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #13
Source File: xbmc_config_menu.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #14
Source File: xbmc_config_menu.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #15
Source File: xbmc_config_menu.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #16
Source File: player.py    From plugin.video.kmediatorrent with GNU General Public License v3.0 5 votes vote down vote up
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") 
Example #17
Source File: addonwindow.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #18
Source File: keyboardint.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #19
Source File: keyboard_ru.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #20
Source File: xbmc_config_menu.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #21
Source File: xbmc_config_menu.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #22
Source File: xbmc_config_menu.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #23
Source File: acecore.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #24
Source File: acecore.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #25
Source File: DialogDownloadProgress.py    From ru with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self, control, ctype, coords=(0, 0), anim=[], **kwargs):
        self.SKINS_PATH = os.path.join(addonDir, "resources", "skins")
        self.ADDON_SKIN = ("default", XBMC_SKIN)[os.path.exists(os.path.join(self.SKINS_PATH, XBMC_SKIN))]
        self.MEDIA_PATH = os.path.join(self.SKINS_PATH, self.ADDON_SKIN, "media")

        self.controlXML = control
        self.id = self.controlXML.getId()
        self.label = xbmc.getInfoLabel("Control.GetLabel(%i)" % self.id)
        self.anim = anim

        try: extra = dict([k.split("=") for k in self.label.split(",")])
        except: extra = {}
        option = {}
        x, y, w, h = self.getCoords(coords)
        if type(self.controlXML) == xbmcgui.ControlImage or ctype == 0:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlImage
            texture = self.label
            valideOption = "colorKey, aspectRatio, colorDiffuse".split(", ")
            for key, value in extra.items():
                key, value = key.strip(), value.strip()
                if key == "texture": texture = value
                if key not in valideOption: continue
                option[key] = value
                if "color" in key.lower():
                    option[key] = '0x' + value
                elif key == "aspectRatio" and value.isdigit():
                    option[key] = int(value)
                texture = self.getTexture(texture)
            # ControlImage(x, y, width, height, filename[, colorKey, aspectRatio, colorDiffuse])
            self.control = xbmcgui.ControlImage(x, y, w, h, texture, **option)

        elif type(self.controlXML) == xbmcgui.ControlLabel or ctype == 1:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlLabel
            valideOption = "font, textColor, disabledColor, alignment, hasPath, angle".split(", ")
            for key, value in extra.items():
                key, value = key.strip(), value.strip()
                if key not in valideOption: continue
                option[key] = value
                if "color" in key.lower():
                    option[key] = '0x' + value
                elif key == "alignment":
                    option[key] = self.getAlignment(value)
                elif key == "hasPath" and value == "true":
                    option[key] = True
                elif key == "angle" and value.isdigit():
                    option[key] = int(value)
            # ControlLabel(x, y, width, height, label[, font, textColor, disabledColor, alignment, hasPath, angle])
            self.control = xbmcgui.ControlLabel(x, y, w, h, "", **option)

        elif type(self.controlXML) == xbmcgui.ControlProgress or ctype == 2:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlProgress
            valideOption = "texturebg, textureleft, texturemid, textureright, textureoverlay".split(", ")
            for key, value in kwargs.items():
                key, value = key.strip(), value.strip()
                if key not in valideOption: continue
                option[key] = self.getTexture(value)
            # ControlProgress(x, y, width, height[, texturebg, textureleft, texturemid, textureright, textureoverlay])
            self.control = xbmcgui.ControlProgress(x, y, w, h, **option)
        else:
            print "No match for self.controlXML: " + repr(self.controlXML) 
Example #26
Source File: renumbertools.py    From pelisalacarta-ce with GNU General Public License v3.0 4 votes vote down vote up
def onAction(self, action):
        self.close()

# TODO mirar retro-compatiblidad
# class ControlEdit(xbmcgui.ControlButton):
#     def __new__(self, *args, **kwargs):
#         del kwargs["isPassword"]
#         del kwargs["window"]
#         args = list(args)
#         return xbmcgui.ControlButton.__new__(self, *args, **kwargs)
#
#     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)
#
#     def setLabel(self, val):
#         self.label = val
#         xbmcgui.ControlButton.setLabel(self, val)
#
#     def getX(self):
#         return xbmcgui.ControlButton.getPosition(self)[0]
#
#     def getY(self):
#         return xbmcgui.ControlButton.getPosition(self)[1]
#
#     def setEnabled(self, e):
#         xbmcgui.ControlButton.setEnabled(self, e)
#         self.textControl.setEnabled(e)
#
#     def setWidth(self, w):
#         xbmcgui.ControlButton.setWidth(self, w)
#         self.textControl.setWidth(w / 2)
#
#     def setHeight(self, w):
#         xbmcgui.ControlButton.setHeight(self, w)
#         self.textControl.setHeight(w)
#
#     def setPosition(self, x, y):
#         xbmcgui.ControlButton.setPosition(self, x, y)
#         self.textControl.setPosition(x + self.getWidth() / 2, y)
#
#     def setText(self, text):
#         self.text = text
#         if self.isPassword:
#             self.textControl.setLabel("*" * len(self.text))
#         else:
#             self.textControl.setLabel(self.text)
#
#     def getText(self):
#         return self.text
#
#
# if not hasattr(xbmcgui, "ControlEdit"):
#     xbmcgui.ControlEdit = ControlEdit 
Example #27
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 4 votes vote down vote up
def place_irconfig(self, row):
        """ IR LED Controls """
        
        label_value = 'IR LED Control'
        self.label_ir = 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 = 80
        SPACE = 20
        
        self.radio_irAuto = RadioButton(self.x + self.X_SHIFT + self.LABEL_WIDTH,
                                        self.y + self.ROW_START + self.ROW_HEIGHT * row,
                                        BUTTON_WIDTH, self.ROW_HEIGHT, 'Auto')
        
        self.radio_irOn = RadioButton(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH + SPACE,
                                      self.y + self.ROW_START + self.ROW_HEIGHT * row,
                                      BUTTON_WIDTH, self.ROW_HEIGHT, 'On')
        
        self.radio_irOff = RadioButton(self.x + self.X_SHIFT + self.LABEL_WIDTH + BUTTON_WIDTH * 2 + SPACE,
                                       self.y + self.ROW_START + self.ROW_HEIGHT * row,
                                       BUTTON_WIDTH, self.ROW_HEIGHT, 'Off')
        
        self.addControl(self.label_ir)
        self.addControl(self.radio_irAuto)
        self.addControl(self.radio_irOn)
        self.addControl(self.radio_irOff)

        self.radio_irAuto.controlLeft(self.radio_irOff)
        self.radio_irAuto.controlRight(self.radio_irOn)
        self.radio_irOn.controlLeft(self.radio_irAuto)
        self.radio_irOn.controlRight(self.radio_irOff)
        self.radio_irOff.controlLeft(self.radio_irOn)
        self.radio_irOff.controlRight(self.radio_irAuto)
        
        if int(self.camera.get_ir_config()[1].get('mode')) == 0:
            self.radio_irAuto.setSelected(True)
        else:
            if int(self.camera.get_dev_state()[1].get('infraLedState')) == 1:
                self.radio_irOn.setSelected(True)
            else:
                self.radio_irOff.setSelected(True) 
Example #28
Source File: BulletScreen.py    From xbmc-addons-chinese with GNU General Public License v2.0 4 votes vote down vote up
def run(self):
        interval = 100
        while self.running:
            while len(self.texts) >= (2 << self.lines):
                self.available_line.append(self.lines)
                self.lines += 1

            while ((len(self.available_line) > 0) and (len(self.texts) > 0)):
                #Add texts
                text = self.texts.pop(0)
                line = self.available_line.pop(0) 
                top = self.top + self.direction * self.fontHeight * line
                label = xbmcgui.ControlLabel(self.left, top, self.width, self.fontHeight, text, 
                                             self.fontSize, self.textColor)
                self.labels.append(BulletLabel(text, label, self.speed, line)) 
                self.window.addControl(label)
                label.setAnimations([('conditional', 'condition=true effect=slide start=%d,0 end=%d,0 time=%d' % 
                                                     (0, -(self.width * 2), self.speed))])
                logging.debug('Add label: ' + text)

            for label in self.labels:
                #Check for available line
                if label.delay != 0:
                    if label.delay > interval:
                        label.delay -= interval
                    else:
                        self.available_line.append(label.line)
                        while (self.lines > 0) and (len(self.texts) < (2 << (self.lines - 1))) and ((self.lines - 1) in self.available_line):
                            self.lines -= 1
                            self.available_line.remove((self.lines))
                        label.delay = 0

                #Remove label that is timeout
                if label.timeout > interval:
                    label.timeout -= interval
                else:
                    logging.debug('Remove text: ' + label.label.getLabel())
                    self.window.removeControl(label.label)
                    self.labels.remove(label)

            xbmc.sleep(interval)

        logging.info('BulletScreen thread exit')

        #Remove labels
        for label in  self.labels:
            self.window.removeControl(label.label) 
Example #29
Source File: renumbertools.py    From addon with GNU General Public License v3.0 4 votes vote down vote up
def onAction(self, action):
            self.close()

            # TODO mirar retro-compatiblidad
            # class ControlEdit(xbmcgui.ControlButton):
            #     def __new__(self, *args, **kwargs):
            #         del kwargs["isPassword"]
            #         del kwargs["window"]
            #         args = list(args)
            #         return xbmcgui.ControlButton.__new__(self, *args, **kwargs)
            #
            #     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)
            #
            #     def setLabel(self, val):
            #         self.label = val
            #         xbmcgui.ControlButton.setLabel(self, val)
            #
            #     def getX(self):
            #         return xbmcgui.ControlButton.getPosition(self)[0]
            #
            #     def getY(self):
            #         return xbmcgui.ControlButton.getPosition(self)[1]
            #
            #     def setEnabled(self, e):
            #         xbmcgui.ControlButton.setEnabled(self, e)
            #         self.textControl.setEnabled(e)
            #
            #     def setWidth(self, w):
            #         xbmcgui.ControlButton.setWidth(self, w)
            #         self.textControl.setWidth(w / 2)
            #
            #     def setHeight(self, w):
            #         xbmcgui.ControlButton.setHeight(self, w)
            #         self.textControl.setHeight(w)
            #
            #     def setPosition(self, x, y):
            #         xbmcgui.ControlButton.setPosition(self, x, y)
            #         self.textControl.setPosition(x + self.getWidth() / 2, y)
            #
            #     def setText(self, text):
            #         self.text = text
            #         if self.isPassword:
            #             self.textControl.setLabel("*" * len(self.text))
            #         else:
            #             self.textControl.setLabel(self.text)
            #
            #     def getText(self):
            #         return self.text
            #
            #
            # if not hasattr(xbmcgui, "ControlEdit"):
            #     xbmcgui.ControlEdit = ControlEdit