def vcline_entry_event_cb(gtkimage, widget, tool): _entry = gtkimage.getEntry() _text = _entry.get_text() _entry.delete_text(0, -1) if len(_text): _val = util.get_float(eval(_text, gtkimage.image.getImageVariables())) tool.setPoint(_val, 0.0) gtkentities.create_entity(gtkimage)
def cline_second_entry_make_pt(gtkimage, widget, tool): _entry = gtkimage.getEntry() _text = _entry.get_text() _entry.delete_text(0,-1) if len(_text): _x, _y = make_tuple(_text, gtkimage.image.getImageVariables()) tool.setSecondPoint(_x, _y) gtkentities.create_entity(gtkimage)
def cline_second_entry_make_pt(gtkimage, widget, tool): _entry = gtkimage.getEntry() _text = _entry.get_text() _entry.delete_text(0, -1) if len(_text): _x, _y = make_tuple(_text, gtkimage.image.getImageVariables()) tool.setSecondPoint(_x, _y) gtkentities.create_entity(gtkimage)
def vcline_entry_event_cb(gtkimage, widget, tool): _entry = gtkimage.getEntry() _text = _entry.get_text() _entry.delete_text(0,-1) if len(_text): _val = util.get_float(eval(_text, gtkimage.image.getImageVariables())) tool.setPoint(_val, 0.0) gtkentities.create_entity(gtkimage)
def acline_entry_make_angle(gtkimage, widget, tool): _entry = gtkimage.getEntry() _text = _entry.get_text() _entry.delete_text(0,-1) if len(_text): _angle = util.make_angle(eval(_text, gtkimage.image.getImageVariables())) tool.setAngle(_angle) gtkentities.create_entity(gtkimage)
def acline_entry_make_angle(gtkimage, widget, tool): _entry = gtkimage.getEntry() _text = _entry.get_text() _entry.delete_text(0, -1) if len(_text): _angle = util.make_angle( eval(_text, gtkimage.image.getImageVariables())) tool.setAngle(_angle) gtkentities.create_entity(gtkimage)
def vcline_button_press_cb(gtkimage, widget, event, tool): _tol = gtkimage.getTolerance() _image = gtkimage.getImage() _x, _y = _image.getCurrentPoint() _pt, _pc = _image.getClosestPoint(_x, _y, tolerance=_tol) if _pt is not None: _x, _y = _pt.getCoords() else: _x, _y = _pc tool.setPoint(_x, _y) gtkentities.create_entity(gtkimage)
def two_cline_set_circle_cb(gtkimage, widget, event, tool): _tol = gtkimage.getTolerance() _image = gtkimage.getImage() _x, _y = _image.getCurrentPoint() _pt, _pc = _image.getClosestPoint(_x, _y, tolerance=_tol) if _pt is not None: _x, _y = _pt.getCoords() else: _x, _y = _pc tool.setLocation(_x, _y) gtkentities.create_entity(gtkimage)
def ccircle_single_second_button_press_cb(gtkimage, widget, event, tool): _tol = gtkimage.getTolerance() _image = gtkimage.getImage() _x, _y = _image.getCurrentPoint() _pt, _pc = _image.getClosestPoint(_x, _y, tolerance=_tol) if _pt is not None: _x, _y = _pt.getCoords() else: _x, _y = _pc tool.setLocation(_x, _y) gtkentities.create_entity(gtkimage) return True
def two_ccircle_tangent_cb(gtkimage, widget, event, tool): _x, _y = gtkimage.image.getCurrentPoint() tool.setLocation(_x, _y) gtkentities.create_entity(gtkimage)