frmTables.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 { get; set; }
  16. Hashtable table;
  17. #endregion
  18. #region 构造函数
  19. public frmTables(frmReportApp ReportApp)
  20. {
  21. InitializeComponent();
  22. m_ReportApp = ReportApp;
  23. #region 国际化语言
  24. Language lan = new Language(this);
  25. table = lan.GetNameTable(this.Name);
  26. #endregion
  27. }
  28. #endregion
  29. #region Grid表格被激活时事件
  30. private void OTSCaculationTablesWindow_Activated(object sender, EventArgs e)
  31. {
  32. OTSSourceGrid m_SampleGrid = m_ReportApp.m_conditionChoose.m_sourceGrid;
  33. m_SampleGrid.InitGrid();
  34. m_SampleGrid.InitGroupTitle(0, table["generalparameters"].ToString());
  35. System.Windows.Forms.Control ctl = (System.Windows.Forms.Control)sender;
  36. m_SampleGrid.SetPictureType((DisplayPicutureType)ctl.TabIndex);
  37. m_ReportApp.m_conditionChoose.DisCurrentPicProperty();//先添加属性
  38. //根据标签索引 显示默认的数据图表
  39. if (m_ReportApp.m_ParticlesListWindow.Controls != null)
  40. {
  41. m_ReportApp.m_conditionChoose.tabIndex = (DisplayPicutureType)ctl.TabIndex;
  42. m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
  43. }
  44. m_ReportApp.m_RstWindow.SelectWorkSampleNode();
  45. //设置每个功能模块限制菜单的显示
  46. if (this.Controls.Count != 0)
  47. {
  48. m_ReportApp.m_RibbonFun.SetRibbonButnStatu_ByModule((DisplayPicutureType)ctl.TabIndex);
  49. }
  50. //判断样品属性与样品窗口在主窗体的位置
  51. if (m_ReportApp.m_conditionChoose.DockState != m_ReportApp.m_RstWindow.DockState)
  52. {
  53. m_ReportApp.m_RstWindow.Activate();
  54. }
  55. else
  56. {
  57. if (!m_ReportApp.m_conditionChoose.Focus())
  58. {
  59. m_ReportApp.m_RstWindow.Activate();
  60. }
  61. }
  62. }
  63. #endregion
  64. }
  65. }