示例#1
0
    def handleEvent(self, event, clock):
        handled = False
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)):
            handled = True

        if (event.type == MOUSEBUTTONUP):
            if self.handler:
                self.handler(self, event, clock)
                handled = True

        LcarsWidget.handleEvent(self, event, clock)
        return handled
示例#2
0
    def handleEvent(self, event, clock):
        handled = False
        
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)):
            self.applyColour(colours.WHITE)
            self.highlighted = True
            self.beep.play()
            handled = True

        if (event.type == MOUSEBUTTONUP and self.highlighted):
            self.applyColour(self.colour)
            if self.handler:
                self.handler(self, event, clock)
                handled = True
            
        LcarsWidget.handleEvent(self, event, clock)
        return handled
示例#3
0
    def handleEvent(self, event, clock):
        handled = False

        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)):
            self.applyColour(colours.WHITE)
            self.highlighted = True
            self.beep.play()
            handled = True

        if (event.type == MOUSEBUTTONUP and self.highlighted):
            self.applyColour(self.colour)
            if self.handler:
                self.handler(self, event, clock)
                handled = True

        LcarsWidget.handleEvent(self, event, clock)
        return handled
示例#4
0
    def handleEvent(self, event, clock):
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)
                and self.visible == True):
            self.beep.play()

        if (event.type == MOUSEBUTTONUP and self.visible == True):
            self.togglevalue = not self.togglevalue

        return LcarsWidget.handleEvent(self, event, clock)
示例#5
0
    def handleEvent(self, event, clock):
        handled = False

        if (event.type == MOUSEBUTTONDOWN and
           self.rect.collidepoint(event.pos)):
            self.applyColour(colours.WHITE)
            self.highlighted = True
            # NOTE: Should put the sounds behind a global/config param
#            self.beep.play()
            handled = True

        if (event.type == MOUSEBUTTONUP and self.highlighted):
            self.applyColour(self.colour)
            if self.handler:
                self.handler(self, event, clock)
                handled = True

        LcarsWidget.handleEvent(self, event, clock)
        return handled
    def handleEvent(self, event, clock):
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos) and self.visible == True):
            self.applyColour(colours.WHITE)
            self.highlighted = True
            self.beep.play()

        if (event.type == MOUSEBUTTONUP and self.highlighted and self.visible == True):
            self.applyColour(self.colour)
           
        return LcarsWidget.handleEvent(self, event, clock)
示例#7
0
    def handleEvent(self, event, clock):
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)
                and self.visible == True):
            cursor = (pygame.mouse.get_pos()[0] - self.pos[1],
                      pygame.mouse.get_pos()[1] - self.pos[0])
            for item in self.textList:
                if item[0].collidepoint(cursor):
                    self.item_selected = item[1]
            self.beep.play()

        if (event.type == MOUSEBUTTONUP and self.visible == True):
            pass

        return LcarsWidget.handleEvent(self, event, clock)
示例#8
0
    def handleEvent(self, event, clock):
        image2 = pygame.image.load("assets/button_modern_down.png")
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)
                and self.visible == True):
            self.highlighted = True
            self.beep.play()
            self.image = image2.convert_alpha()

        image = pygame.image.load("assets/button_modern.png")
        if (event.type == MOUSEBUTTONUP and self.highlighted
                and self.visible == True):
            self.image = image.convert_alpha()

        return LcarsWidget.handleEvent(self, event, clock)
示例#9
0
    def handleEvent(self, event, clock):
        if (event.type == MOUSEBUTTONDOWN and self.rect.collidepoint(event.pos)
                and self.visible == True):
            if self.imageonly:
                self.image = self.image_pressed
            else:
                self.applyColour(self.colour_pressed)
            self.highlighted = True
            self.beep.play()

        #need to add mouseover highlight functionality here

        if (event.type == MOUSEBUTTONUP and self.highlighted
                and self.visible == True):
            if self.imageonly:
                self.image = self.image_normal
            else:
                self.applyColour(self.colour)

        return LcarsWidget.handleEvent(self, event, clock)