Jump to content
ALEXANDER2020

interface LOGIN ÁRABE

Recommended Posts

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 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...