Jump to content

LOGIN ÁRABE


ALEXANDER2020

Mensajes recomendados

Debes iniciar sesión para ver el contenido del enlace en esta publicación.

    NORMAL_COLOR =  0xffa08784
    OVER_COLOR = 0xffe6d0a2
    DOWN_COLOR = 0xffefe4cd

    def __init__(self):
        Window.__init__(self)

        self.eventFunc = None
        self.eventArgs = None

        self.text = TextLine()
        self.text.SetParent(self)
        self.text.SetPackedFontColor(self.NORMAL_COLOR)
        self.text.Show()

        self.underline = TextLine()
        self.underline.SetParent(self)
        self.underline.SetPackedFontColor(self.NORMAL_COLOR)
        self.underline.Hide()

    def __del__(self):
        Window.__del__(self)

    def SetText(self, text):
        self.text.SetText(text)
        self.SetSize(self.text.GetTextSize()[0], self.text.GetTextSize()[1])
        self.underline.SetPosition(-20, self.text.GetTextSize()[1])
        self.underline.SetWindowHorizontalAlignCenter()
        self.underline.SetSize(self.text.GetTextSize()[0], 0)

    def OnMouseOverIn(self):
        self.text.SetPackedFontColor(self.OVER_COLOR)
        self.underline.Show()

    def OnMouseOverOut(self):
        self.text.SetPackedFontColor(self.NORMAL_COLOR)
        self.underline.Hide()

    def OnMouseLeftButtonDown(self):
        self.text.SetPackedFontColor(self.DOWN_COLOR)
        self.underline.SetPackedFontColor(self.DOWN_COLOR)
        self.underline.Show()

    def OnMouseLeftButtonUp(self):
        if self.eventFunc:
            apply(self.eventFunc, self.eventArgs)
        self.OnMouseOverOut()

    def SetEvent(self, event, *args):
        self.eventFunc = event
        self.eventArgs = args 
Enlace para comentar
Compartir en otros sitios

Unirse a la conversación

Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.

Guest
Responder a este tema...

×   Has pegado contenido con formato .   Eliminar formato

  Only 75 emoji are allowed.

×   Tu enlace se ha incorporado automáticamente.   Mostrar un enlace en su lugar

×   Se ha restaurado el contenido anterior. .   Borrar editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...