def create_text(self, rect, width=0): rect = self._normalize_rect(rect) parent = self.presenter.active_layer if width == 0: width = rect[2] text = dialogs.text_edit_dialog(self.app.mw) if text: obj = model.Text(self.pdxf_cfg, parent, rect, text, width) obj.style = deepcopy(self.model.styles['Default Style']) obj.update() self.insert_object(obj, parent, len(parent.childs))
def edit_text(self): if self.selection.objs: obj = self.selection.objs[0] obj.text = dialogs.text_edit_dialog(self.app.mw, obj.text) obj.update()