OTSRibbonFun.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. 
  2. using OTSIncAReportApp.OTSRstMgrFunction;
  3. using OTSIncAReportApp.OTSSampleReportInfo;
  4. using static OTSDataType.otsdataconst;
  5. namespace OTSIncAReportApp.OTSRibbon
  6. {
  7. /// <summary>
  8. /// 报告菜单相关操作类
  9. /// </summary>
  10. public class OTSRibbonFun
  11. {
  12. #region 变量定义
  13. frmReportApp m_ReportApp = null;
  14. #endregion
  15. #region 构造函数
  16. public OTSRibbonFun(frmReportApp ReportApp)
  17. {
  18. m_ReportApp = ReportApp;
  19. }
  20. #endregion
  21. #region 相关功能方法封装
  22. /// <summary>
  23. /// 设置Ribbon按钮的可用/不可用。
  24. /// </summary>
  25. /// <param name="bRibState">bRibStstu=True: 可用; bRibStstu=False: 不可用 </param>
  26. public void SetAllRibbonButnStatu(bool bRibState)
  27. {
  28. //下拉菜单中
  29. m_ReportApp.dpbOpen.Enabled = true; //打开,下拉菜单中
  30. m_ReportApp.dpbExport.Enabled = bRibState; //输出,下拉菜单中
  31. m_ReportApp.Backup.Enabled = bRibState;//备份数据库,下拉菜单
  32. m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = bRibState; //输出,下拉菜单中
  33. m_ReportApp.ribbonOrbMenuItem_purity.Enabled = bRibState;
  34. m_ReportApp.ribbonOrbMenuItem_Extremum.Enabled = bRibState;
  35. //Ribbon菜单中
  36. m_ReportApp.rbOpen.Enabled = true; //打开,ribbon中
  37. m_ReportApp.rbAllImage.Enabled = bRibState; //全图匹配,ribbon中
  38. m_ReportApp.rbWidthImage.Enabled = bRibState; //宽度匹配,ribbon中
  39. m_ReportApp.rbReverseSelection.Enabled = bRibState; //反选,ribbon中
  40. m_ReportApp.rbCircular.Enabled = bRibState; //圆形,ribbon中
  41. m_ReportApp.rbRectangle.Enabled = bRibState; //矩形,ribbon中
  42. m_ReportApp.rbCancel.Enabled = bRibState; //取消选择,ribbon中
  43. m_ReportApp.rbFrame.Enabled = bRibState; //帧图边框,ribbon中
  44. m_ReportApp.rbStaff.Enabled = bRibState; //标尺,ribbon中
  45. m_ReportApp.rbRenew.Enabled = bRibState; //恢复,ribbon中
  46. m_ReportApp.rbReMeasure.Enabled = bRibState; //二次测量,ribbon中
  47. }
  48. /// <summary>
  49. /// 根据当前在不同的功能模块,设置不同的菜单状态
  50. /// </summary>
  51. /// <param name="str_moudle">传入的当前功能模块名</param>
  52. public void SetRibbonButnStatu_ByModule(DisplayPicutureType in_enum_displaypicturetype)
  53. {
  54. if (in_enum_displaypicturetype == DisplayPicutureType.AnalyzeImg)
  55. {
  56. m_ReportApp.rbSelTool.Enabled = true;//显示图匹配
  57. m_ReportApp.rbChoiceTools.Enabled = true;//选择工具
  58. m_ReportApp.ribbonPanel2.Enabled = true;//图形工具
  59. //(主菜单)下拉菜单中的 新建,打开,保存,另存为,输出
  60. m_ReportApp.dpbOpen.Enabled = true;
  61. m_ReportApp.dpbExport.Enabled = true;
  62. m_ReportApp.Backup.Enabled = true;
  63. //主菜单文件框里(保存、另存为、输出、新建)设置
  64. m_ReportApp.rbSave.Enabled = true;
  65. m_ReportApp.rbSaveAs.Enabled = true;
  66. m_ReportApp.rbOut.Enabled = true;
  67. m_ReportApp.ribbonButton2.Enabled = true;
  68. //设置打开按钮
  69. m_ReportApp.dpbOpen.Enabled = true;
  70. m_ReportApp.rbOpen.Enabled = true;
  71. m_ReportApp.rbReMeasure.Enabled = true;
  72. }
  73. else if (in_enum_displaypicturetype == DisplayPicutureType.AnalyzeDataTable)
  74. {
  75. m_ReportApp.rbSelTool.Enabled = false;//显示图匹配
  76. m_ReportApp.rbChoiceTools.Enabled = false;//选择工具
  77. m_ReportApp.ribbonPanel2.Enabled = false;//图形工具
  78. //(主菜单)下拉菜单中的 新建,打开,保存,另存为,输出
  79. m_ReportApp.dpbOpen.Enabled = true;
  80. m_ReportApp.dpbExport.Enabled = true;
  81. m_ReportApp.Backup.Enabled = true;
  82. //主菜单文件框里(保存、另存为、输出、新建)设置
  83. m_ReportApp.rbSave.Enabled = true;
  84. m_ReportApp.rbSaveAs.Enabled = true;
  85. m_ReportApp.rbOut.Enabled = true;
  86. m_ReportApp.ribbonButton2.Enabled = true;
  87. //设置打开按钮
  88. m_ReportApp.dpbOpen.Enabled = true;
  89. m_ReportApp.rbOpen.Enabled = true;
  90. m_ReportApp.rbReMeasure.Enabled = true;
  91. }
  92. else if (in_enum_displaypicturetype == DisplayPicutureType.AnalyzeDataChart)
  93. {
  94. m_ReportApp.rbSelTool.Enabled = false;//显示图匹配
  95. m_ReportApp.rbChoiceTools.Enabled = false;//选择工具
  96. m_ReportApp.ribbonPanel2.Enabled = false;//图形工具
  97. //(主菜单)下拉菜单中的 新建,打开,保存,另存为,输出
  98. m_ReportApp.dpbOpen.Enabled = true;
  99. m_ReportApp.dpbExport.Enabled = true;
  100. m_ReportApp.Backup.Enabled = true;
  101. //主菜单文件框里(保存、另存为、输出、新建)设置
  102. m_ReportApp.rbSave.Enabled = true;
  103. m_ReportApp.rbSaveAs.Enabled = true;
  104. m_ReportApp.rbOut.Enabled = true;
  105. m_ReportApp.ribbonButton2.Enabled = true;
  106. //设置打开按钮
  107. m_ReportApp.dpbOpen.Enabled = true;
  108. m_ReportApp.rbOpen.Enabled = true;
  109. m_ReportApp.rbReMeasure.Enabled = true;
  110. }
  111. var m_RptConfigFile =RptConfigFile.GetRptConfig(); //报表程序的配置文件
  112. if (m_RptConfigFile.Systype == OTS_SysType_ID.IncA)
  113. {
  114. m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
  115. m_ReportApp.ribbonOrbMenuItem_Extremum.Enabled = true;
  116. m_ReportApp.ribbonOrbMenuItem_purity.Enabled = true;
  117. }
  118. else
  119. {
  120. m_ReportApp.ribbonOrbMenuItem_Extremum.Enabled = false;
  121. m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = false;
  122. m_ReportApp.ribbonOrbMenuItem_purity.Enabled = false;
  123. }
  124. }
  125. #endregion
  126. }
  127. }