def OnClick(self, mouseEvent): if self.vwr is None: return # Encode mouse button events for HypView. btnNum = -1 # Left mouse button for X-Y motion of the hyperbolic center. if mouseEvent.LeftDown(): btnNum = 0 btnState = 0 elif mouseEvent.LeftUp(): btnNum = 0 btnState = 1 pass # Middle button for rotation of the hyperbolic space. elif mouseEvent.MiddleDown(): btnNum = 1 btnState = 0 elif mouseEvent.MiddleUp(): btnNum = 1 btnState = 1 pass # Left button with control or shift held down is also rotation. if btnNum == 0 and (mouseEvent.ControlDown() or mouseEvent.ShiftDown()): btnNum = 1 pass # Handle mouse clicks in HypView. if btnNum != -1: ##print "click", btnNum, btnState, mouseEvent.GetX(), mouseEvent.GetY() self.vwr.mouse(btnNum, btnState, mouseEvent.GetX(), mouseEvent.GetY(), 0, 0) self.vwr.redraw() # If a pick occurred, the current node name has changed. self.SelectedNode(hv.getSelected()) pass pass
def OnClick(self, mouseEvent): if self.vwr is None: return # Encode mouse button events for HypView. btnNum = -1 # Left mouse button for X-Y motion of the hyperbolic center. if mouseEvent.LeftDown(): btnNum = 0 btnState = 0 elif mouseEvent.LeftUp(): btnNum = 0 btnState = 1 pass # Middle button for rotation of the hyperbolic space. elif mouseEvent.MiddleDown(): btnNum = 1 btnState = 0 elif mouseEvent.MiddleUp(): btnNum = 1 btnState = 1 pass # Left button with control or shift held down is also rotation. if btnNum == 0 and ( mouseEvent.ControlDown() or mouseEvent.ShiftDown() ): btnNum = 1 pass # Handle mouse clicks in HypView. if btnNum != -1: ##print "click", btnNum, btnState, mouseEvent.GetX(), mouseEvent.GetY() self.vwr.mouse(btnNum, btnState, mouseEvent.GetX(), mouseEvent.GetY(), 0, 0) self.vwr.redraw() # If a pick occurred, the current node name has changed. self.SelectedNode(hv.getSelected()) pass pass
def OnHideLinksOut(self, buttonEvent): self.vwr.setDrawBackFrom(hv.getSelected(), 0, self.DescendLinksOut.IsChecked()) self.DrawGL() pass
def OnShowLinksIn(self, buttonEvent): self.vwr.setDrawBackTo(hv.getSelected(), 1, self.DescendLinksIn.IsChecked()) self.DrawGL() pass