using Resources; using SmartCoalApplication.Actions; using SmartCoalApplication.Core; using SmartCoalApplication.MeasureProcedure; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Windows.Forms; namespace SmartCoalApplication.Menus { /// /// 测试规程 测量规程管理 /// internal sealed class MeasureProcedureMenu : PdnMenuItem { private PdnMenuItem menuModuleSetting; private PdnMenuItem menuAutoMeasure; public MeasureProcedureMenu(int menuId) { InitializeComponent(); this.MenuId = menuId; //在脚本中不显示 this.CanUseInScript = false; this.AutomaticScript = false; } protected override void OnAppWorkspaceChanged() { base.OnAppWorkspaceChanged(); } private void InitializeComponent() { this.menuModuleSetting = new PdnMenuItem(ActionType.MeasureRuler); this.menuAutoMeasure = new PdnMenuItem(ActionType.AutoMeasure); // // 主菜单 // this.DropDownItems.AddRange(new ToolStripItem[] { this.menuAutoMeasure, this.menuModuleSetting }); this.Name = "Menu.Setting"; this.Text = PdnResources.GetString("NewTestProcedure"); this.menuModuleSetting.Text = PdnResources.GetString("NewSetTestProcedure"); this.menuModuleSetting.Click += MenuModuleSetting_Click; this.menuModuleSetting.Image = PdnResources.GetImageResource("Icons.ModuleSetting.png").Reference; // // 自动量测 // this.menuAutoMeasure.Click += new EventHandler(this.MenuAutoMeasure_Click); this.menuAutoMeasure.Text = PdnResources.GetString("NewStartTestProcedure"); this.menuAutoMeasure.Image = PdnResources.GetImageResource("Icons.AutoMeasure.png").Reference; //// //// 加载菜单的文字和icon //// //this.LoadNames(this.Name); this.namesLoaded = true; this.LoadIcons(); } /// /// 自动量测 /// /// /// private void MenuAutoMeasure_Click(object sender, System.EventArgs e) { using (AutomaticMeasurement.AutomaticMeasurement af = new AutomaticMeasurement.AutomaticMeasurement(AppWorkspace)) { af.StartPosition = FormStartPosition.CenterScreen; af.ShowDialog(AppWorkspace); } } private void MenuModuleSetting_Click(object sender, EventArgs e) { using (MeasureSettingDialog af = new MeasureSettingDialog(AppWorkspace)) { af.StartPosition = FormStartPosition.CenterScreen; af.ShowDialog(); } } } }