123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- using Resources;
- using SmartCoalApplication.Annotation.Enum;
- using SmartCoalApplication.Core;
- using SmartCoalApplication.Instrument;
- using SmartCoalApplication.Measure;
- using SmartCoalApplication.MeasureProcedure;
- using SmartCoalApplication.Rule;
- using SmartCoalApplication.Setup;
- using SmartCoalApplication.SystemLayer;
- using System;
- using System.Diagnostics;
- using System.Threading;
- using System.Windows.Forms;
- namespace SmartCoalApplication.Menus
- {
- /// <summary>
- /// 测试规程菜单=>设置
- /// </summary>
- internal sealed class SettingMenu : PdnMenuItem
- {
- ////测量规程管理
- //private PdnMenuItem menuToolsGridLine;
- //测量线设置
- private PdnMenuItem menuMeasureLineSetting;
- //测量区域设置
- private PdnMenuItem menuMeasureRectSetting;
- //分隔线
- private ToolStripSeparator menuToolsSeperator1;
- //标尺标定
- private PdnMenuItem menuRulerTools;
- //标尺标定子菜单
- //标尺标定
- private PdnMenuItem menuSubRulerCalibration;
- //应用当前
- private PdnMenuItem menuSubApplyCurrent;
- //应用全部
- private PdnMenuItem menuSubApplyAll;
- //分隔线
- private ToolStripSeparator menuToolsSeperator7;
- //模块管理
- private PdnMenuItem menuModulesManager;
- //自定义软件界面
- private PdnMenuItem menuCustomToolBar;
- //分隔线
- private ToolStripSeparator menuToolsSeperator8;
- //基本信息设置
- private PdnMenuItem menuBasicInfoSetting;
- //基本设置
- private PdnMenuItem menuBasicSetting;
- //基本设置
- private PdnMenuItem fileNamingRules;
- //基本设置
- private PdnMenuItem auxiliaryLineSetting;
- //测试规程导入导出
- private PdnMenuItem measureProcedureImport;
- public SettingMenu(int menuId)
- {
- InitializeComponent();
- this.MenuId = menuId;
- }
- private void InitializeComponent()
- {
- //this.menuToolsGridLine = new PdnMenuItem(ActionType.GridLine, true);
- this.menuMeasureLineSetting = new PdnMenuItem(ActionType.MenuMeasureLineSetting);
- this.menuMeasureRectSetting = new PdnMenuItem(ActionType.MenuMeasureRectSetting);
- this.menuToolsSeperator1 = new ToolStripSeparator();
- this.menuRulerTools = new PdnMenuItem(ActionType.MenuRulerTools);
- this.menuToolsSeperator7 = new ToolStripSeparator();
- this.menuModulesManager = new PdnMenuItem(ActionType.ModuleSetting);
- this.menuCustomToolBar = new PdnMenuItem(ActionType.CustomToolBar);
- this.menuToolsSeperator8 = new ToolStripSeparator();
- this.menuBasicInfoSetting = new PdnMenuItem(ActionType.BasicInfoSetting);
- this.menuBasicSetting = new PdnMenuItem(ActionType.BasicSetting);
- this.menuSubRulerCalibration = new PdnMenuItem(ActionType.SubRulerCalibration);
- this.menuSubApplyCurrent = new PdnMenuItem(ActionType.SubApplyCurrent);
- this.menuSubApplyAll = new PdnMenuItem(ActionType.SubApplyAll);
- this.fileNamingRules = new PdnMenuItem(ActionType.FileNamingRules);
- this.auxiliaryLineSetting = new PdnMenuItem(ActionType.AuxiliaryLineSetting);
- this.measureProcedureImport = new PdnMenuItem(ActionType.MeasureProcedureImport);
- //
- // 标尺标定
- //
- //this.menuRulerCalibration.NeedWaitKey = true;
- this.menuRulerTools.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuSubRulerCalibration,
- this.menuSubApplyCurrent,
- this.menuSubApplyAll
- });
- //
- // MeasureManagerMenu
- //
- this.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- //this.menuToolsGridLine,
- this.menuMeasureLineSetting,
- this.menuMeasureRectSetting,
- this.menuToolsSeperator1,
- this.menuRulerTools,
- this.menuToolsSeperator7,
- this.menuModulesManager,
- this.menuCustomToolBar,
- this.menuToolsSeperator8,
- this.menuBasicInfoSetting,
- this.menuBasicSetting,
- this.fileNamingRules,
- this.auxiliaryLineSetting,
- this.measureProcedureImport
- });
- this.Name = "Menu.Tools";
- this.Text = PdnResources.GetString("NewSetting");
- //
- // 标尺标定(子菜单)
- //
- this.menuSubRulerCalibration.Text = PdnResources.GetString("Menu.MeasureAction.RulerCalibration.Text");
- this.menuSubRulerCalibration.NeedWaitKey = true;
- this.menuSubRulerCalibration.Click += new EventHandler(MenuToolsViewRuler_Click);
- this.menuSubRulerCalibration.Image = PdnResources.GetImageResource("Icons.MenuRulerCalibration.png").Reference;
- //
- // 应用当前
- //
- this.menuSubApplyCurrent.Text = PdnResources.GetString("Menu.Imagement.Rulersetting.current.text");
- this.menuSubApplyCurrent.NeedWaitKey = true;
- this.menuSubApplyCurrent.Click += new EventHandler(MenuSubApplyCurrent_Click);
- this.menuSubApplyCurrent.Image = PdnResources.GetImageResource("Icons.MenuNow.png").Reference;
- //
- // 应用全部
- //
- this.menuSubApplyAll.Text = PdnResources.GetString("Menu.Binaryoperation.Binaryextraction.Applytoall.text");
- this.menuSubApplyAll.NeedWaitKey = true;
- this.menuSubApplyAll.Click += new EventHandler(MenuSubApplyAll_Click);
- this.menuSubApplyAll.Image = PdnResources.GetImageResource("Icons.MenuAll.png").Reference;
- //
- // 测量线设置
- //
- this.menuMeasureLineSetting.Click += new EventHandler(MenuToolsAuxiliaryLine_Click);
- this.menuMeasureLineSetting.Text = PdnResources.GetString("NewMeasureLineSetting");
- this.menuMeasureLineSetting.Image = PdnResources.GetImageResource("Icons.MeasureLineSetting.png").Reference;
- //
- // 测量区域设置
- //
- this.menuMeasureRectSetting.Click += new EventHandler(MenuToolsCustomInterface_Click);
- this.menuMeasureRectSetting.Text = PdnResources.GetString("NewMeasureRectSetting");
- this.menuMeasureRectSetting.Image = PdnResources.GetImageResource("Icons.MeasureRectSetting.png").Reference;
- //
- // 标尺标定
- //
- //this.menuRulerTools.Click += new EventHandler(MenuToolsViewRuler_Click);
- this.menuRulerTools.Text = PdnResources.GetString("NewRulerTools");
- this.menuRulerTools.Image = PdnResources.GetImageResource("Icons.RulerTools.png").Reference;
- //
- // 模块管理
- //
- this.menuModulesManager.Click += new EventHandler(MenuToolsTemplateManager_Click);
- this.menuModulesManager.Text = PdnResources.GetString("NewModulesManager");
- this.menuModulesManager.Image = PdnResources.GetImageResource("Icons.ModulesManager.png").Reference;
- //
- // 自定义软件界面
- //
- this.menuCustomToolBar.Click += new EventHandler(MenuToolsCreateReport_Click);
- this.menuCustomToolBar.Text = PdnResources.GetString("NewCustomToolBar");
- this.menuCustomToolBar.Image = PdnResources.GetImageResource("Icons.CustomToolBar.png").Reference;
- //
- // 基本信息设置
- //
- this.menuBasicInfoSetting.Click += new EventHandler(MenuToolsSelfRestart_Click);
- this.menuBasicInfoSetting.Text = PdnResources.GetString("NewBasicInfoSetting");
- this.menuBasicInfoSetting.Image = PdnResources.GetImageResource("Icons.BasicInfoSetting.png").Reference;
- //
- // 基本设置
- //
- this.menuBasicSetting.Click += new EventHandler(MenuBasic_Click);
- this.menuBasicSetting.Text = PdnResources.GetString("Menu.BasicSetting");
- this.menuBasicSetting.Image = PdnResources.GetImageResource("Icons.baseSheZhi.png").Reference;
- //
- // 命名规则
- //
- this.fileNamingRules.Text = PdnResources.GetString("Menu.FileNamingRules");
- this.fileNamingRules.Click += new EventHandler(MenuFileNamingRules_Click);
- this.fileNamingRules.Image = PdnResources.GetImageResource("Icons.FileNameRole.png").Reference;
- //
- // 辅助线设置
- //
- this.auxiliaryLineSetting.Text = PdnResources.GetString("Menu.AuxiliaryLineSetting");
- this.auxiliaryLineSetting.Click += new EventHandler(MenuAuxiliaryLineSetting_Click);
- this.auxiliaryLineSetting.Image = PdnResources.GetImageResource("Icons.FileNameRole.png").Reference;
- //
- //
- //
- this.measureProcedureImport.Text = PdnResources.GetString("ImportAndExportSet");
- this.measureProcedureImport.Click += new EventHandler(MenuMeasureProcedureImport_Click);
- this.measureProcedureImport.Image = PdnResources.GetImageResource("Icons.FileNameRole.png").Reference;
- ////
- //// 加载菜单的文字和icon
- ////
- //this.LoadNames(this.Name);
- this.namesLoaded = true;
- this.LoadIcons();
- }
- protected override void OnDropDownOpening(EventArgs e)
- {
- //this.menuToolsGridLine.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled : false;
- //this.menuMeasureRectSetting.Checked = Settings.CurrentUser.GetBoolean(SettingNames.Rulers, true);
-
- base.OnDropDownOpening(e);
- }
-
- /// <summary>
- /// 测量线设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuToolsAuxiliaryLine_Click(object sender, EventArgs e)
- {
- using (Measure.MeasureSettingDialog af = new Measure.MeasureSettingDialog(AppWorkspace))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog(AppWorkspace);
- }
- }
- /// <summary>
- /// 标尺标定
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuToolsViewRuler_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.RuleListForm.Visible = !AppWorkspace.Widgets.RuleListForm.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.RuleListForm.Visible, "RulerCalibration");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.RuleListForm.Visible, "RulerCalibration");
- this.menuRulerTools.Checked = AppWorkspace.Widgets.RuleListForm.Visible;
- }
- }
- /// <summary>
- /// 测量区域设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuToolsCustomInterface_Click(object sender, EventArgs e)
- {
- using (MeasureAreaDialog af = new MeasureAreaDialog(AppWorkspace))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog(AppWorkspace);
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuToolsSelfRestart_Click(object sender, EventArgs e)
- {
- using (BasicInformationSettings af = new BasicInformationSettings())
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog();
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuBasic_Click(object sender, EventArgs e)
- {
- using (BasicMeasureDialog af = new BasicMeasureDialog(AppWorkspace))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog();
- }
- }
- /// <summary>
- /// 模块管理
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuToolsTemplateManager_Click(object sender, EventArgs e)
- {
- using (ModuleManageDialog af = new ModuleManageDialog(AppWorkspace))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog(AppWorkspace);
- }
- }
- /// <summary>
- /// 命名规则
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuFileNamingRules_Click(object sender, EventArgs e)
- {
- using (FileNamingRules af = new FileNamingRules(AppWorkspace))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog(AppWorkspace);
- }
- }
- /// <summary>
- /// 辅助线设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuAuxiliaryLineSetting_Click(object sender, EventArgs e)
- {
- using (AuxiliaryLineSetting af = new AuxiliaryLineSetting())
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog();
- }
- }
- /// <summary>
- /// 自定义软件界面
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuToolsCreateReport_Click(object sender, EventArgs e)
- {
- CustomInterfaceDialog dialog = new CustomInterfaceDialog(AppWorkspace);
- dialog.ShowDialog();
- }
- /// <summary>
- /// 应用当前
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuSubApplyCurrent_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.RuleListForm.MenuSubApplyCurrent();
- }
- /// <summary>
- /// 应用全部
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuSubApplyAll_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.RuleListForm.MenuSubApplyAll();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuMeasureProcedureImport_Click(object sender, EventArgs e)
- {
- using (MeasureProcedureImport af = new MeasureProcedureImport(AppWorkspace))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog(AppWorkspace);
- }
- }
- }
- }
|