def __init__(self, object): self.selected_path = -1 self.selected_idx = -1 self.selection_type = SelNone self.other_segment = -1 Editor.__init__(self, object) self.Deselect()
def ButtonDown(self, p, button, state): if self.selection == 1: start = self.trafo(cos(self.start_angle), sin(self.start_angle)) else: start = self.trafo(cos(self.end_angle), sin(self.end_angle)) Editor.DragStart(self, start) return p - start
def ButtonDown(self, p, button, state): if self.selection is not None: start = self.selection.p Editor.DragStart(self, start) return p - start else: return None
#! /usr/bin/env python3 """Startup script for XML Editor """ import sys from base import Editor if len(sys.argv) > 1: Editor(sys.argv[1]) else: Editor('')
def __init__(self, object): Editor.__init__(self, object) self.caret = 0 object.set_editor(self)
def ButtonUp(self, p, button, state): p = self.apply_constraint(p, state) Editor.DragStop(self, p) start_angle, end_angle, arc_type = self.angles() return CreateMultiUndo(self.object.SetAngles(start_angle, end_angle), self.object.SetArcType(arc_type))
def MouseMove(self, p, state): p = self.apply_constraint(p, state) Editor.MouseMove(self, p, state)
def ButtonUp(self, p, button, state): Editor.DragStop(self, p)
def ButtonDown(self, p, button, state): Editor.DragStart(self, p)