Exemplo n.º 1
0
Arquivo: mouse.py Projeto: hlysig/O3
 def event_leftClick_up(self):
     if not dialogService.hasOpenDialog():
         p = self.get_object_hit(base.mouseWatcherNode.getMouse(),
                                 'pickable_left-up')
         message = self.messagePrefixMouse1 + str(p)
         message = '%s%s-up' % (self.messagePrefixMouse1, str(p))
         messenger.send(message, [p])
Exemplo n.º 2
0
Arquivo: mouse.py Projeto: hlysig/O3
 def event_leftClick(self):
     """
     What is this?
     """
     if not dialogService.hasOpenDialog():
         p = self.get_object_hit(base.mouseWatcherNode.getMouse(),
                                 'pickable_left')
         message = self.messagePrefixMouse1 + str(p)
         messenger.send(message, [p])
Exemplo n.º 3
0
Arquivo: mouse.py Projeto: hlysig/O3
    def mouse_over_watcher_task(self, task):
        """
        What is this?
        """
        # If there is any dialog open, we will not do anything!
        if dialogService.hasOpenDialog():
            return task.cont

            #if self.last_pos is None:
            #    if not base.mouseWatcherNode.hasMouse():
            #        return task.cont

            # Get the mouse coordinates.
            x = base.mouseWatcherNode.getMouseX()
            y = base.mouseWatcherNode.getMouseY()

        if base.mouseWatcherNode.hasMouse():
            curr_pos = (base.mouseWatcherNode.getMouseX(),
                        base.mouseWatcherNode.getMouseY())
            self.last_pos = curr_pos

            if self.mouseOverWathcer.get_object_hit(
                    base.mouseWatcherNode.getMouse()) is None:

                if self.mouse_over_node is not None:
                    messenger.send(
                        self.mouseOverWathcer.leavePrefix +
                        str(self.mouse_over_node), [self.mouse_over_node])
                    #print "zoomout_"+str(self.mouse_over_node)
                    self.mouse_over_node = None

                else:
                    messenger.send(self.mouseOverWathcer.leavePrefix + "none")
                    #print 'zoomout_none'
            else:

                if self.mouse_over_node is not None and self.mouse_over_node != self.mouseOverWathcer.get_object_hit(
                        base.mouseWatcherNode.getMouse()):
                    messenger.send(
                        self.mouseOverWathcer.leavePrefix +
                        str(self.mouse_over_node), [self.mouse_over_node])
                    #print "zoomout_"+str(self.mouse_over_node)

                if self.mouse_over_node != self.mouseOverWathcer.get_object_hit(
                        base.mouseWatcherNode.getMouse()):
                    self.mouse_over_node = self.mouseOverWathcer.get_object_hit(
                        base.mouseWatcherNode.getMouse())
                    messenger.send(
                        self.mouseOverWathcer.hoverPrefix +
                        str(self.mouse_over_node), [self.mouse_over_node])
                    #print "zoomin_"+str(self.mouse_over_node)
        return task.cont
Exemplo n.º 4
0
    def toggleFullScreen(self):
        # If there is an open dialog, then this function
        # will not execute.
        if dialogService.hasOpenDialog():
            return

        wp = WindowProperties()

        if not browser_config['fullscreen']:
            wp.setSize(base.win.getXSize(), base.win.getYSize())
            wp.setFullscreen(True)
            base.win.requestProperties(wp)
            browser_config['fullscreen'] = True

        else:
            wp.setSize(base.win.getXSize(), base.win.getYSize())
            wp.setFullscreen(False)
            base.win.requestProperties(wp)
            browser_config['fullscreen'] = False
Exemplo n.º 5
0
 def browserQuit(self):
     # If there is an open dialog, then this function
     # will not execute.
     if not dialogService.hasOpenDialog():
         exit()