123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- 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
- {
- /// <summary>
- /// 测试规程 测量规程管理
- /// </summary>
- 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();
- }
- /// <summary>
- /// 自动量测
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- }
- }
- }
|