frmTables.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using OTS.WinFormsUI.Docking;
  2. using OTSIncAReportApp.OTSDataMgrFunction;
  3. using OTSIncAReportApp.OTSSampleReportInfo;
  4. using OTSIncAReportApp.SysMgrTools;
  5. using System;
  6. using System.Collections;
  7. namespace OTSIncAReportApp
  8. {
  9. /// <summary>
  10. /// Grid表格主窗体
  11. /// </summary>
  12. public partial class frmTables : DockContent
  13. {
  14. #region 变量定义
  15. //private frmReportApp m_ReportApp = null;
  16. private frmReportApp m_ReportApp { get; set; }
  17. Hashtable table;
  18. #endregion
  19. #region 构造函数
  20. public frmTables(frmReportApp ReportApp)
  21. {
  22. InitializeComponent();
  23. m_ReportApp = ReportApp;
  24. #region 国际化语言
  25. Language lan = new Language(this);
  26. table = lan.GetNameTable(this.Name);
  27. #endregion
  28. }
  29. #endregion
  30. #region Grid表格被激活时事件
  31. private void OTSCaculationTablesWindow_Activated(object sender, EventArgs e)
  32. {
  33. OTSSourceGrid m_SampleGrid = m_ReportApp.m_conditionChoose.m_sourceGrid;
  34. m_SampleGrid.InitGrid();
  35. m_SampleGrid.InitGroupTitle(0, table["generalparameters"].ToString());
  36. m_SampleGrid.SetPictureType(DisplayPicutureType.AnalyzeDataTable);
  37. m_ReportApp.m_conditionChoose.DisCurrentPicProperty();//先添加属性
  38. //根据标签索引 显示默认的数据图表
  39. if (m_ReportApp.m_TablesWindow.Controls != null)
  40. {
  41. if (m_ReportApp.im_Control_DrawDistrbutionImageAndBSE != null)
  42. {
  43. if (m_ReportApp.m_TablesWindow.Controls.Count == 0 || m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.WhetherThereAreDeleteParticles() || m_ReportApp.GetSelectedParticles().Count != 0)
  44. {
  45. m_ReportApp.m_conditionChoose.tabIndex = DisplayPicutureType.AnalyzeDataTable;
  46. m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
  47. }
  48. }
  49. else
  50. {
  51. if (m_ReportApp.m_TablesWindow.Controls.Count == 0 || m_ReportApp.GetSelectedParticles().Count != 0)
  52. {
  53. m_ReportApp.m_conditionChoose.tabIndex = DisplayPicutureType.AnalyzeDataTable;
  54. m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
  55. }
  56. }
  57. }
  58. m_ReportApp.m_RstWindow.SelectWorkSampleNode();
  59. //设置每个功能模块限制菜单的显示
  60. if (this.Controls.Count != 0)
  61. {
  62. m_ReportApp.m_RibbonFun.SetRibbonButnStatu_ByModule(DisplayPicutureType.AnalyzeDataTable);
  63. }
  64. //判断样品属性与样品窗口在主窗体的位置
  65. if (m_ReportApp.m_conditionChoose.DockState != m_ReportApp.m_RstWindow.DockState)
  66. {
  67. m_ReportApp.m_RstWindow.Activate();
  68. }
  69. else
  70. {
  71. if (!m_ReportApp.m_conditionChoose.Focus())
  72. {
  73. m_ReportApp.m_RstWindow.Activate();
  74. }
  75. }
  76. }
  77. #endregion
  78. }
  79. }