frmTables.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using OTS.WinFormsUI.Docking;
  2. using OTSIncAReportApp.OTSRstMgrFunction;
  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. System.Windows.Forms.Control ctl=(System.Windows.Forms.Control)sender;
  37. m_SampleGrid.SetPictureType((DisplayPicutureType)ctl.TabIndex);
  38. m_ReportApp.m_conditionChoose.DisCurrentPicProperty();//先添加属性
  39. //根据标签索引 显示默认的数据图表
  40. if (m_ReportApp.m_ParticlesListWindow.Controls != null)
  41. {
  42. if (m_ReportApp.im_Control_DrawDistrbutionImageAndBSE != null)
  43. {
  44. if (m_ReportApp.m_ParticlesListWindow.Controls.Count == 0 || m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.WhetherThereAreDeleteParticles())
  45. {
  46. m_ReportApp.m_conditionChoose.tabIndex = (DisplayPicutureType)ctl.TabIndex;
  47. m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
  48. }
  49. }
  50. else
  51. {
  52. //if (m_ReportApp.m_ParticlesListWindow.Controls.Count == 0)
  53. //{
  54. m_ReportApp.m_conditionChoose.tabIndex = (DisplayPicutureType)ctl.TabIndex;
  55. m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
  56. //}
  57. }
  58. }
  59. m_ReportApp.m_RstWindow.SelectWorkSampleNode();
  60. //设置每个功能模块限制菜单的显示
  61. if (this.Controls.Count != 0)
  62. {
  63. m_ReportApp.m_RibbonFun.SetRibbonButnStatu_ByModule((DisplayPicutureType)ctl.TabIndex);
  64. }
  65. //判断样品属性与样品窗口在主窗体的位置
  66. if (m_ReportApp.m_conditionChoose.DockState != m_ReportApp.m_RstWindow.DockState)
  67. {
  68. m_ReportApp.m_RstWindow.Activate();
  69. }
  70. else
  71. {
  72. if (!m_ReportApp.m_conditionChoose.Focus())
  73. {
  74. m_ReportApp.m_RstWindow.Activate();
  75. }
  76. }
  77. }
  78. #endregion
  79. }
  80. }