1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159 |
- using PaintDotNet.Annotation.Enum;
- using PaintDotNet.Annotation.Label;
- using PaintDotNet.Base;
- using PaintDotNet.Data.Param;
- using PaintDotNet.ImageLabel;
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Reflection;
- using System.Windows.Forms;
- namespace PaintDotNet.Menus
- {
- /// <summary>
- /// 图像标注菜单
- /// </summary>
- internal sealed class LabelActionMenu : PdnMenuItem
- {
- private PdnMenuItem menuChoiseAction;
- private PdnMenuItem menuSelectAllAction;
- private PdnMenuItem menuContinuousDrawingAction;
- private PdnMenuItem menuClearAllAction;
- private ToolStripSeparator menuHelpSeparator1;
- private PdnMenuItem menuAutoRulerAction;
- private PdnMenuItem menuPrestoredRulerAction;
- private PdnMenuItem menuHandRulerAction;
- private ToolStripSeparator menuHelpSeparator2;
- private PdnMenuItem menuTextAction;
- private PdnMenuItem menuMarkAction;
- private PdnMenuItem menuLineAction;
- private PdnMenuItem menuCurveLineAction;
- private PdnMenuItem menuArrowAction;
- private PdnMenuItem menuCircleAction;
- private PdnMenuItem menuPolygonAction;
- private ToolStripSeparator menuHelpSeparator3;
- private PdnMenuItem menuWaterMarkAction;
- private PdnMenuItem menuWordLineAction;
- private ToolStripSeparator menuHelpSeparator4;
- private PdnMenuItem menuMoveUpAction;
- private PdnMenuItem menuMoveDownAction;
- private PdnMenuItem menuMoveTopAction;
- private PdnMenuItem menuMoveBottomAction;
- private ToolStripSeparator menuHelpSeparator5;
- private PdnMenuItem menuLabelListAction;
- //标记子菜单
- private PdnMenuItem menuDateMark;
- private PdnMenuItem menuTimeMark;
- private PdnMenuItem menuPointMark;
- private PdnMenuItem menuNumberMark;
- private PdnMenuItem menuGainNumber;
- //直线子菜单
- private PdnMenuItem menuLineChildLine;
- private PdnMenuItem menuLineChildLineSegment;
- //曲线子菜单
- private PdnMenuItem menuCurvePencil;
- private PdnMenuItem menuCurvePolyline;
- private PdnMenuItem menuCurveCurve;
- private PdnMenuItem menuCurveClosedCurve;
- //箭头子菜单
- private PdnMenuItem menuOnewayArrow;
- private PdnMenuItem menuTwowayArrow;
- //圆子菜单
- private PdnMenuItem menuCircleOval;
- private PdnMenuItem menuCircleCircle;
- //多边形子菜单
- private PdnMenuItem menuPolygonRectangle;
- private PdnMenuItem menuPolygonPolygon;
- private PdnMenuItem menuRoundedRectangle;
- public LabelActionMenu(int menuId)
- {
- InitializeComponent();
- this.MenuId = menuId;
- this.AutomaticScript = false;
- }
- protected override void OnAppWorkspaceChanged()
- {
- base.OnAppWorkspaceChanged();
- }
- private void InitializeComponent()
- {
- this.menuChoiseAction = new PdnMenuItem(ActionType.LabelSelect);
- this.menuSelectAllAction = new PdnMenuItem(ActionType.SelectAllLabel);
- this.menuContinuousDrawingAction = new PdnMenuItem(ActionType.ContinuousDrawingLabel, true);
- this.menuClearAllAction = new PdnMenuItem(ActionType.ClearAllLabel);
- this.menuHelpSeparator1 = new ToolStripSeparator();
- this.menuAutoRulerAction = new PdnMenuItem(ActionType.AutoRuler);
- this.menuPrestoredRulerAction = new PdnMenuItem(ActionType.PrestoredRuler);
- this.menuHandRulerAction = new PdnMenuItem(ActionType.HandRuler);
- this.menuHelpSeparator2 = new ToolStripSeparator();
- this.menuTextAction = new PdnMenuItem(ActionType.TextLabel);
- this.menuMarkAction = new PdnMenuItem(ActionType.MarkAction);
- this.menuLineAction = new PdnMenuItem(ActionType.LineAction);
- this.menuCurveLineAction = new PdnMenuItem(ActionType.CurveLineAction);
- this.menuArrowAction = new PdnMenuItem(ActionType.ArrowAction);
- this.menuCircleAction = new PdnMenuItem(ActionType.CircleAction);
- this.menuPolygonAction = new PdnMenuItem(ActionType.PolygonAction);
- this.menuHelpSeparator3 = new ToolStripSeparator();
- this.menuWaterMarkAction = new PdnMenuItem(ActionType.WaterMarkAction);
- this.menuWordLineAction = new PdnMenuItem(ActionType.WordLineAction);
- this.menuHelpSeparator4 = new ToolStripSeparator();
- this.menuMoveUpAction = new PdnMenuItem(ActionType.MoveUpAction);
- this.menuMoveDownAction = new PdnMenuItem(ActionType.MoveDownAction);
- this.menuMoveTopAction = new PdnMenuItem(ActionType.MoveTopAction);
- this.menuMoveBottomAction = new PdnMenuItem(ActionType.MoveBottomAction);
- this.menuHelpSeparator5 = new ToolStripSeparator();
- this.menuLabelListAction = new PdnMenuItem(ActionType.LabelListAction);
- this.menuDateMark = new PdnMenuItem(ActionType.DateMark);
- this.menuTimeMark = new PdnMenuItem(ActionType.TimeMark);
- this.menuPointMark = new PdnMenuItem(ActionType.PointMark);
- this.menuNumberMark = new PdnMenuItem(ActionType.NumberMark);
- this.menuGainNumber = new PdnMenuItem(ActionType.GainNumber);
- this.menuLineChildLine = new PdnMenuItem(ActionType.LineChildLine);
- this.menuLineChildLineSegment = new PdnMenuItem(ActionType.LineChildLineSegment);
- this.menuCurvePencil = new PdnMenuItem(ActionType.CurvePencil);
- this.menuCurvePolyline = new PdnMenuItem(ActionType.CurvePolyline);
- this.menuCurveCurve = new PdnMenuItem(ActionType.CurveCurve);
- this.menuCurveClosedCurve = new PdnMenuItem(ActionType.CurveClosedCurve);
- this.menuOnewayArrow = new PdnMenuItem(ActionType.OnewayArrow);
- this.menuTwowayArrow = new PdnMenuItem(ActionType.TwowayArrow);
- this.menuCircleOval = new PdnMenuItem(ActionType.CircleOval);
- this.menuCircleCircle = new PdnMenuItem(ActionType.CircleCircle);
- this.menuPolygonRectangle = new PdnMenuItem(ActionType.PolygonRectangle);
- this.menuPolygonPolygon = new PdnMenuItem(ActionType.PolygonPolygon);
- this.menuRoundedRectangle = new PdnMenuItem(ActionType.RoundedRectangle);
- //
- // 添加到主菜单
- //
- this.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuChoiseAction,
- this.menuSelectAllAction,
- this.menuContinuousDrawingAction,
- this.menuClearAllAction,
- this.menuHelpSeparator1,
- this.menuAutoRulerAction,
- this.menuPrestoredRulerAction,
- this.menuHandRulerAction,
- this.menuHelpSeparator2,
- this.menuTextAction,
- this.menuMarkAction,
- this.menuLineAction,
- this.menuCurveLineAction,
- this.menuArrowAction,
- this.menuCircleAction,
- this.menuPolygonAction,
- this.menuHelpSeparator3,
- this.menuWaterMarkAction,
- this.menuWordLineAction,
- this.menuHelpSeparator4,
- this.menuMoveUpAction,
- this.menuMoveDownAction,
- this.menuMoveTopAction,
- this.menuMoveBottomAction,
- this.menuHelpSeparator5,
- this.menuLabelListAction
- });
- //
- // 主菜单
- //
- this.Name = "Menu.LabelAction";
- this.Text = PdnResources.GetString("Menu.LabelAction.Text");
- //
- // 选择
- //
- this.menuChoiseAction.NeedWaitKey = true;
- this.menuChoiseAction.Click += new EventHandler(MenuChoiseAction_Click);
- //
- // 全选
- //
- this.menuSelectAllAction.NeedWaitKey = true;
- this.menuSelectAllAction.Click += new EventHandler(MenuSelectAllAction_Click);
- //
- // 连续绘制
- //
- this.menuContinuousDrawingAction.NeedWaitKey = true;
- this.menuContinuousDrawingAction.Click += new EventHandler(MenuContinuousDrawingAction_Click);
- //
- // 清空元素
- //
- this.menuClearAllAction.Click += new EventHandler(MenuClearAllAction_Click);
- //
- // 自动标尺
- //
- this.menuAutoRulerAction.NeedWaitKey = true;
- this.menuAutoRulerAction.Click += new EventHandler(MenuAutoRuler_Click);
- //
- // 预存标尺
- //
- this.menuPrestoredRulerAction.Click += new EventHandler(MenuPrestoredRuler_Click);
- //
- // 手动标尺
- //
- this.menuHandRulerAction.NeedWaitKey = true;
- this.menuHandRulerAction.Click += new EventHandler(MenuHandRuler_Click);
- //
- // 文本
- //
- this.menuTextAction.NeedWaitKey = true;
- this.menuTextAction.Click += new EventHandler(MenuTextAction_Click);
- //
- // 标记
- //
- this.menuMarkAction.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuDateMark,
- this.menuTimeMark,
- this.menuPointMark,
- this.menuNumberMark,
- this.menuGainNumber
- });
- //
- // 直线
- //
- this.menuLineAction.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuLineChildLine,
- this.menuLineChildLineSegment
- });
- //
- // 曲线
- //
- this.menuCurveLineAction.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuCurvePencil,
- this.menuCurvePolyline,
- this.menuCurveCurve,
- this.menuCurveClosedCurve
- });
- //
- // 箭头
- //
- this.menuArrowAction.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuOnewayArrow,
- this.menuTwowayArrow
- });
- //
- // 圆
- //
- this.menuCircleAction.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuCircleOval,
- this.menuCircleCircle
- });
- //
- // 多边形
- //
- this.menuPolygonAction.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuPolygonRectangle,
- this.menuPolygonPolygon,
- this.menuRoundedRectangle
- });
- //
- // 水印
- //
- this.menuWaterMarkAction.NeedWaitKey = true;
- this.menuWaterMarkAction.Click += new EventHandler(MenuWaterMarkAction_Click);
- //
- // 工字线
- //
- this.menuWordLineAction.NeedWaitKey = true;
- this.menuWordLineAction.Click += new EventHandler(MenuWorkTypeAction_Click);
- //
- // 向上移动
- //
- this.menuMoveUpAction.NeedWaitKey = true;
- this.menuMoveUpAction.Click += new EventHandler(MenuMoveUpAction_Click);
- //
- // 向下移动
- //
- this.menuMoveDownAction.NeedWaitKey = true;
- this.menuMoveDownAction.Click += new EventHandler(MenuMoveDownAction_Click);
- //
- // 移动到最上
- //
- this.menuMoveTopAction.NeedWaitKey = true;
- this.menuMoveTopAction.Click += new EventHandler(MenuMoveTopAction_Click);
- //
- // 移动到最下
- //
- this.menuMoveBottomAction.NeedWaitKey = true;
- this.menuMoveBottomAction.Click += new EventHandler(MenuMoveBottomAction_Click);
- //
- // 标注信息列表
- //
- this.menuLabelListAction.NeedWaitKey = true;
- this.menuLabelListAction.Click += new EventHandler(MenuLabelListAction_Click);
- //
- // 以下是子菜单
- //
- //
- // 标记->日期
- //
- this.menuDateMark.Text = PdnResources.GetString("Menu.LabelAction.DrawDateMark.Text");
- this.menuDateMark.NeedWaitKey = true;
- this.menuDateMark.Click += new EventHandler(MenuDateMark_Click);
- this.menuDateMark.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawDateMarkIcon.png").Reference;
- //
- // 标记->时间
- //
- this.menuTimeMark.Text = PdnResources.GetString("Menu.LabelAction.DrawTimeMark.Text");
- this.menuTimeMark.NeedWaitKey = true;
- this.menuTimeMark.Click += new EventHandler(MenuTimeMark_Click);
- this.menuTimeMark.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawTimeMarkIcon.png").Reference;
- //
- // 标记->点标记
- //
- this.menuPointMark.Text = PdnResources.GetString("Menu.LabelAction.DrawPointMark.Text");
- this.menuPointMark.NeedWaitKey = true;
- this.menuPointMark.Click += new EventHandler(MenuPointMark_Click);
- this.menuPointMark.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawPointMarkIcon.png").Reference;
- //
- // 标记->数字标记
- //
- this.menuNumberMark.Text = PdnResources.GetString("Menu.LabelAction.DrawNumberMark.Text");
- this.menuNumberMark.NeedWaitKey = true;
- this.menuNumberMark.Click += new EventHandler(MenuNumberMark_Click);
- this.menuNumberMark.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawNumberMarkIcon.png").Reference;
- //
- // 放大倍数
- //
- this.menuGainNumber.Text = PdnResources.GetString("Menu.LabelAction.DrawGainNumber.Text");
- this.menuGainNumber.NeedWaitKey = true;
- this.menuGainNumber.Click += new EventHandler(MenuGainNumber_Click);
- this.menuGainNumber.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawGainNumberIcon.png").Reference;
- //
- // 直线->直线
- //
- this.menuLineChildLine.Text = PdnResources.GetString("Menu.LabelAction.DrawLine.Text");
- this.menuLineChildLine.NeedWaitKey = true;
- this.menuLineChildLine.Click += new EventHandler(MenuLineChildLine_Click);
- this.menuLineChildLine.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawLineIcon.png").Reference;
- //
- // 直线->线段
- //
- this.menuLineChildLineSegment.Text = PdnResources.GetString("Menu.LabelAction.DrawLineSegment.Text");
- this.menuLineChildLineSegment.NeedWaitKey = true;
- this.menuLineChildLineSegment.Click += new EventHandler(MenuLineChildLineSegment_Click);
- this.menuLineChildLineSegment.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawLineSegmentIcon.png").Reference;
- //
- // 曲线->铅笔
- //
- this.menuCurvePencil.Text = PdnResources.GetString("Menu.LabelAction.DrawPencil.Text");
- this.menuCurvePencil.NeedWaitKey = true;
- this.menuCurvePencil.Click += new EventHandler(MenuCurvePencil_Click);
- this.menuCurvePencil.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawPencilIcon.png").Reference;
- //
- // 曲线->折线
- //
- this.menuCurvePolyline.Text = PdnResources.GetString("Menu.LabelAction.DrawPolygonLine.Text");
- this.menuCurvePolyline.NeedWaitKey = true;
- this.menuCurvePolyline.Click += new EventHandler(MenuCurvePolyline_Click);
- this.menuCurvePolyline.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawPolygonLineIcon.png").Reference;
- //
- // 曲线->曲线
- //
- this.menuCurveCurve.Text = PdnResources.GetString("Menu.LabelAction.DrawCurve.Text");
- this.menuCurveCurve.NeedWaitKey = true;
- this.menuCurveCurve.Click += new EventHandler(MenuCurveCurve_Click);
- this.menuCurveCurve.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawCurveIcon.png").Reference;
- //
- // 曲线->闭合曲线
- //
- this.menuCurveClosedCurve.Text = PdnResources.GetString("Menu.LabelAction.DrawClosedCurve.Text");
- this.menuCurveClosedCurve.NeedWaitKey = true;
- this.menuCurveClosedCurve.Click += new EventHandler(MenuCurveClosedCurve_Click);
- this.menuCurveClosedCurve.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawClosedCurveIcon.png").Reference;
- //
- // 箭头->单向箭头
- //
- this.menuOnewayArrow.Text = PdnResources.GetString("Menu.LabelAction.DrawOneArrowLine.Text");
- this.menuOnewayArrow.NeedWaitKey = true;
- this.menuOnewayArrow.Click += new EventHandler(MenuOnewayArrow_Click);
- this.menuOnewayArrow.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawOneArrowLineIcon.png").Reference;
- //
- // 箭头->双向箭头
- //
- this.menuTwowayArrow.Text = PdnResources.GetString("Menu.LabelAction.DrawTwoArrowLine.Text");
- this.menuTwowayArrow.NeedWaitKey = true;
- this.menuTwowayArrow.Click += new EventHandler(MenuTwowayArrow_Click);
- this.menuTwowayArrow.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawTwoArrowLineIcon.png").Reference;
- //
- // 圆->椭圆
- //
- this.menuCircleOval.Text = PdnResources.GetString("Menu.LabelAction.DrawEllipse.Text");
- this.menuCircleOval.NeedWaitKey = true;
- this.menuCircleOval.Click += new EventHandler(MenuCircleOval_Click);
- this.menuCircleOval.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawEllipseIcon.png").Reference;
- //
- // 圆->圆
- //
- this.menuCircleCircle.Text = PdnResources.GetString("Menu.LabelAction.DrawCircle.Text");
- this.menuCircleCircle.NeedWaitKey = true;
- this.menuCircleCircle.Click += new EventHandler(MenuCircleCircle_Click);
- this.menuCircleCircle.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawCircleIcon.png").Reference;
- //
- // 多边形->矩形
- //
- this.menuPolygonRectangle.Text = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
- this.menuPolygonRectangle.NeedWaitKey = true;
- this.menuPolygonRectangle.Click += new EventHandler(MenuPolygonRectangle_Click);
- this.menuPolygonRectangle.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawRectangleIcon.png").Reference;
- //
- // 多边形->多边形
- //
- this.menuPolygonPolygon.Text = PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text");
- this.menuPolygonPolygon.NeedWaitKey = true;
- this.menuPolygonPolygon.Click += new EventHandler(MenuPolygonPolygon_Click);
- this.menuPolygonPolygon.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawPolygonIcon.png").Reference;
- //
- // 多边形->圆角矩形
- //
- this.menuRoundedRectangle.Text = PdnResources.GetString("Menu.LabelAction.DrawRoundRectangle.Text");
- this.menuRoundedRectangle.NeedWaitKey = true;
- this.menuRoundedRectangle.Click += new EventHandler(MenuRoundedRectangle_Click);
- this.menuRoundedRectangle.Image = PdnResources.GetImageResource("Icons.MenuLabelDrawRoundRectangleIcon.png").Reference;
- //
- // 加载菜单的文字和icon
- //
- this.LoadNames(this.Name);
- this.LoadIcons();
- }
- protected override void OnDropDownOpening(EventArgs e)
- {
- //if (AppWorkspace.ActiveDocumentWorkspace != null/* && !AppWorkspace.ScriptRunning*/)
- //{
- // this.menuLineAction.Enabled = true;
- //}
- //else
- //{
- // this.menuLineAction.Enabled = false;
- //}
- this.menuLabelListAction.Checked = AppWorkspace.Widgets.LabelListDialog.Visible;
- this.menuContinuousDrawingAction.Checked = DocumentView.ContinuousDrawing;
- //this.RecursiveData(this.DropDownItems);
- base.OnDropDownOpening(e);
- }
- /// <summary>
- /// 选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuChoiseAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.Pointer);
- }
- /// <summary>
- /// 全选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuSelectAllAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectAll();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.GraphicsList.SelectAll();
- AppWorkspace.cameraPreviewDialog.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 连续绘制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuContinuousDrawingAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ContinuousDrawing = !AppWorkspace.ContinuousDrawing;
- }
- /// <summary>
- /// 清空元素
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuClearAllAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.Clear();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.GraphicsList.Clear();
- AppWorkspace.cameraPreviewDialog.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 自动标尺
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuAutoRuler_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawAutoRuler;
- if (AppWorkspace.ContinuousDrawing)
- {
- AppWorkspace.ContinuousDrawing = false;
- }
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawAutoRuler);
- }
- /// <summary>
- /// 手动标尺
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuHandRuler_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawHandModeRuler;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawHandModeRuler);
- }
- /// <summary>
- /// 预存标尺
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPrestoredRuler_Click(object sender, EventArgs e)
- {
- using (PresetRulerDialog presetRulerDialog = new PresetRulerDialog(this.AppWorkspace))
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- if (AppWorkspace.ContinuousDrawing)
- {
- AppWorkspace.ContinuousDrawing = false;
- }
- presetRulerDialog.StartPosition = FormStartPosition.CenterScreen;
- presetRulerDialog.ShowDialog();
- }
- }
- /// <summary>
- /// 标记->文本
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuTextAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawTextString;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawTextString);
- }
- /// <summary>
- /// 标记->日期
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuDateMark_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawDateMark;
- if (AppWorkspace.ContinuousDrawing)
- {
- AppWorkspace.ContinuousDrawing = false;
- }
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawDateMark);
- }
- /// <summary>
- /// 标记->时间
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuTimeMark_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawTimeMark;
- if (AppWorkspace.ContinuousDrawing)
- {
- AppWorkspace.ContinuousDrawing = false;
- }
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawTimeMark);
- }
- /// <summary>
- /// 标记->点标记
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPointMark_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawPointMark;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawPointMark);
- }
- /// <summary>
- /// 标记->数字标记
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuNumberMark_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawNumberMark;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawNumberMark);
- }
- /// <summary>
- /// 标记->放大倍数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuGainNumber_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawGainNumber;
- if (AppWorkspace.ContinuousDrawing) {
- AppWorkspace.ContinuousDrawing = false;
- }
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawGainNumber);
- }
- /// <summary>
- /// 直线->直线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuLineChildLine_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawLine);
- }
- /// <summary>
- /// 直线->线段
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuLineChildLineSegment_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawLineSegment;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawLineSegment);
- }
- /// <summary>
- /// 曲线->铅笔
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCurvePencil_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawPencil;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawPencil);
- }
- /// <summary>
- /// 曲线->折线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCurvePolyline_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawPolygonLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawPolygonLine);
- }
- /// <summary>
- /// 曲线->曲线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCurveCurve_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawCurve;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawCurve);
- }
- /// <summary>
- /// 曲线->闭合曲线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCurveClosedCurve_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawClosedCurve;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawClosedCurve);
- }
- /// <summary>
- /// 箭头->单向箭头
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuOnewayArrow_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawOneArrowLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawOneArrowLine);
- }
- /// <summary>
- /// 箭头->双向箭头
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuTwowayArrow_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawTwoArrowLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawTwoArrowLine);
- }
- /// <summary>
- /// 圆->椭圆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCircleOval_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawEllipse;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawEllipse);
- }
- /// <summary>
- /// 圆->圆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCircleCircle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawCircle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawCircle);
- }
- /// <summary>
- /// 多边形->矩形
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPolygonRectangle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawRectangle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawRectangle);
- }
- /// <summary>
- /// 多边形->多边形
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPolygonPolygon_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawPolygon;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawPolygon);
- }
- /// <summary>
- /// 多边形->圆角矩形
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuRoundedRectangle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawRoundRectangle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawRoundRectangle);
- }
- /// <summary>
- /// 水印
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuWaterMarkAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawWaterMark;
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawWaterMark);
- }
- /// <summary>
- /// 工字线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuWorkTypeAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawWorkType;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.DrawWorkType);
- }
- /// <summary>
- /// 向上移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuMoveUpAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.MoveSelectionToMoveUp();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- }
- /// <summary>
- /// 向下移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuMoveDownAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.MoveSelectionToMoveDown();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- }
- /// <summary>
- /// 移动到最上
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuMoveTopAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.MoveSelectionToFront();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- }
- /// <summary>
- /// 移动到最下
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuMoveBottomAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.MoveSelectionToBack();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- if (AppWorkspace.Widgets.LabelListDialog != null)
- {
- AppWorkspace.Widgets.LabelListDialog.RefreshDateGridView(null, null);
- }
- }
- }
- /// <summary>
- /// 标注列表
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuLabelListAction_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.LabelListDialog.Visible = !AppWorkspace.Widgets.LabelListDialog.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.LabelListDialog.Visible, "LabelListAction");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.LabelListDialog.Visible, "LabelListAction");
- this.menuLabelListAction.Checked = AppWorkspace.Widgets.LabelListDialog.Visible;
- AppWorkspace.Widgets.LabelListDialog.getData();
- AppWorkspace.ActiveDocumentWorkspace.Focus();
- }
- }
- private void SetCameraPreviewActiveTool(DrawToolType drawToolType)
- {
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = drawToolType;
- }
- }
- private string GetCultureInfoName(CultureInfo ci)
- {
- CultureInfo en_US = new CultureInfo("en-US");
- if (ci.Equals(en_US))
- {
- return GetCultureInfoName(ci.Parent);
- }
- else
- {
- return ci.NativeName;
- }
- }
- public void checkMenu(bool v)
- {
- this.menuContinuousDrawingAction.Checked = v;
- }
- }
- }
|