renumbertools.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:pelisalacarta-ce 作者: pelisalacarta-ce 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号