From 7f99c732ea3533a3c7d5a0dc3030a2d3609cd2e3 Mon Sep 17 00:00:00 2001 From: ChenX Date: Tue, 25 May 2021 17:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E9=81=BF=E5=85=8D=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E6=A0=87=E6=B3=A8=E5=B0=BA=E5=AF=B8=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E7=A1=AE=E7=9A=84=E5=93=8D=E5=BA=94=E6=92=A4?= =?UTF-8?q?=E9=94=80=E9=87=8D=E5=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/HistoricManage.ts | 4 ++-- src/UI/Components/ToolBar/Properties_Dim.tsx | 22 ++++++++++++++++++- src/UI/Components/ToolBar/Properties_Text.tsx | 1 - 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/DatabaseServices/HistoricManage.ts b/src/DatabaseServices/HistoricManage.ts index 058554bf0..9a5cae39c 100644 --- a/src/DatabaseServices/HistoricManage.ts +++ b/src/DatabaseServices/HistoricManage.ts @@ -79,9 +79,9 @@ export class HistoricManage extends CADObject { ReportErrorWrap.ReportError(new Error().stack, "命令未执行中,但是却产生了错误了记录!"); Toaster({ - message: "程序内部错误!命令未执行中,但是却产生了错误了记录! (请与我们联系,将错误报告给我们)", + message: "警告:命令未执行中,但是却产生了错误了历史记录! (不会造成图纸错误,但是会影响撤销(Ctrl+Z)重做(Ctrl+Y),请与我们联系,将错误报告给我们)", timeout: 5000, - intent: Intent.DANGER, + intent: Intent.WARNING, key: "no_command_his" }); } diff --git a/src/UI/Components/ToolBar/Properties_Dim.tsx b/src/UI/Components/ToolBar/Properties_Dim.tsx index 8ae33da24..2905a8fa0 100644 --- a/src/UI/Components/ToolBar/Properties_Dim.tsx +++ b/src/UI/Components/ToolBar/Properties_Dim.tsx @@ -10,7 +10,9 @@ import { safeEval } from "../../../Common/eval"; import { KeyBoard, KeyCode } from "../../../Common/KeyEnum"; import { digitStrReg } from "../../../Common/Utils"; import { AlignedDimension } from "../../../DatabaseServices/Dimension/AlignedDimension"; -import { CommandWrap } from "../../../Editor/CommandMachine"; +import { commandMachine, CommandWrap } from "../../../Editor/CommandMachine"; +import { CommandState } from "../../../Editor/CommandState"; +import { AppToaster } from "../Toaster"; import { PropertiesStore } from "./PropertiesStore"; export interface Properties_DimPanelProps { @@ -210,6 +212,19 @@ export class Properties_DimPanel extends React.Component { + if (!CommandState.CommandIng) + commandMachine.CommandStart("更改标注文字尺寸"); + else + if (app.Database.hm.UndoData.CommandName !== "更改标注文字尺寸") + { + AppToaster.show({ + message: "命令执行中,无法修改标注尺寸!", + timeout: 5000, + intent: Intent.WARNING, + }, "change_dim_text"); + return false; + } + this.numericInputVal = value.toString(); this.dim_TextSize = value; for (let al of ents) @@ -218,6 +233,11 @@ export class Properties_DimPanel extends React.Component + { + if (CommandState.CommandIng && app.Database.hm.UndoData.CommandName === "更改标注文字尺寸") + commandMachine.CommandEnd(); + }} vertical={false} /> diff --git a/src/UI/Components/ToolBar/Properties_Text.tsx b/src/UI/Components/ToolBar/Properties_Text.tsx index cc4b2b1e3..619dbaec7 100644 --- a/src/UI/Components/ToolBar/Properties_Text.tsx +++ b/src/UI/Components/ToolBar/Properties_Text.tsx @@ -24,7 +24,6 @@ export class Properties_Text extends React.Component componentDidMount() { let propsStore = PropertiesStore.GetInstance() as PropertiesStore; - let selectCtrl = app.Editor.SelectCtrl; propsStore.isWorking = true; let numval = this.props.ents[0].Height; this.dim_TextSize = numval;