Python xbmcgui.ControlEdit() Examples

The following are 7 code examples of xbmcgui.ControlEdit(). 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: loginmanual.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def _add_editcontrol(self, x, y, height, width, password=0):

        media = os.path.join(xbmcaddon.Addon(addon_id()).getAddonInfo('path'), 'resources', 'skins', 'default', 'media')
        control = xbmcgui.ControlEdit(0, 0, 0, 0,
                                      label="User",
                                      font="font13",
                                      textColor="FF52b54b",
                                      disabledColor="FF888888",
                                      focusTexture="-",
                                      noFocusTexture="-",
                                      isPassword=password)
        control.setPosition(x, y)
        control.setHeight(height)
        control.setWidth(width)

        self.addControl(control)

        return control 
Example #2
Source File: loginconnect.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def _add_editcontrol(self, x, y, height, width, password=0):

        media = os.path.join(xbmcaddon.Addon(addon_id()).getAddonInfo('path'), 'resources', 'skins', 'default', 'media')
        control = xbmcgui.ControlEdit(0, 0, 0, 0,
                                      label="User",
                                      font="font13",
                                      textColor="FF52b54b",
                                      disabledColor="FF888888",
                                      focusTexture="-",
                                      noFocusTexture="-",
                                      isPassword=password)
        control.setPosition(x, y)
        control.setHeight(height)
        control.setWidth(width)

        self.addControl(control)
        return control 
Example #3
Source File: servermanual.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def _add_editcontrol(self, x, y, height, width):

        media = os.path.join(xbmcaddon.Addon(addon_id()).getAddonInfo('path'), 'resources', 'skins', 'default', 'media')
        control = xbmcgui.ControlEdit(0, 0, 0, 0,
                                      label="User",
                                      font="font13",
                                      textColor="FF52b54b",
                                      disabledColor="FF888888",
                                      focusTexture="-",
                                      noFocusTexture="-")
        control.setPosition(x, y)
        control.setHeight(height)
        control.setWidth(width)

        self.addControl(control)
        return control 
Example #4
Source File: xbmc_config_menu.py    From pelisalacarta-ce with GNU General Public License v3.0 6 votes vote down vote up
def add_control_text(self, c):
        if xbmcgui.ControlEdit == ControlEdit:
            control = xbmcgui.ControlEdit(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, isPassword=c["hidden"], window=self)

        else:
            control = xbmcgui.ControlEdit(0, -100, self.controls_width - 5, self.height_control,
                                          c["label"], self.font, c["color"],  '', 4, isPassword=c["hidden"],
                                          focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
                                          noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'))


        self.addControl(control)

        control.setVisible(False)
        control.setLabel(c["label"])
        control.setText(self.values[c["id"]])
        control.setWidth(self.controls_width - 5)
        control.setHeight(self.height_control)

        c["control"] = control 
Example #5
Source File: xbmc_config_menu.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
def add_control_text(self, c):
        if xbmcgui.ControlEdit == ControlEdit:
            control = xbmcgui.ControlEdit(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, isPassword=c["hidden"], window=self)

        elif xbmcgui.__version__ in ["3.0", "3.0.0"]:
            control = xbmcgui.ControlEdit(0, -100, self.controls_width - 5, self.height_control,
                                          c["label"], self.font, c["color"], '', 4)
        else:
            control = xbmcgui.ControlEdit(0, -100, self.controls_width - 5, self.height_control,
                                          c["label"], self.font, c["color"], '', 4, isPassword=c["hidden"],
                                          focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
                                          noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'))

        self.addControl(control)

        control.setVisible(False)
        control.setLabel(c["label"])
        # frodo fix
        s = self.values[c["id"]]
        if s is None:
            s = ''
        control.setText(s)
        # control.setText(self.values[c["id"]])
        control.setWidth(self.controls_width - 5)
        control.setHeight(self.height_control)

        c["control"] = control 
Example #6
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 
Example #7
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