using OTS.WinFormsUI.Docking;
using OTSIncAReportApp.OTSRstMgrFunction;
using OTSIncAReportApp.OTSSampleReportInfo;
using OTSIncAReportApp.SysMgrTools;
using System;
using System.Collections;
namespace OTSIncAReportApp
{
    /// 
    /// Chart图表显示主窗体类
    /// 
    public partial class frmCharts : DockContent
    {
        #region 变量定义
        private frmReportApp m_ReportApp = null;
        Language lan1 = new Language();
        Hashtable table;
        #endregion
        #region 构造函数
        public frmCharts(frmReportApp ReportApp)
        {
            InitializeComponent();
            m_ReportApp = ReportApp;
            #region 国际化语言
            Language lan = new Language(this);
            table = lan.GetNameTable("frmCharts");
            #endregion
        }
        #endregion
        #region Chart图表窗体被激活事件
        /// 
        /// 当Chart图表窗体被激活时,触发事件
        /// 
        /// 
        /// 
        private void OTSCaculationChartsWindow_Activated(object sender, EventArgs e)
        {
            OTSSourceGrid m_SampleImage = m_ReportApp.m_conditionChoose.m_sourceGrid;
            string str1 = "常规参数";
            str1 = table["str1"].ToString();
            m_SampleImage.InitGrid();
            m_SampleImage.InitGroupTitle(0, str1);
            m_SampleImage.SetPictureType(DisplayPicutureType.AnalyzeDataChart);
            m_ReportApp.m_conditionChoose.DisCurrentPicProperty();
            string str2 = "颗粒成份图";
            str2 = table["str2"].ToString();
            //根据标签索引 显示默认的数据图表
            if (m_ReportApp.m_ChartsWindow.Controls != null)
            {
                if (m_ReportApp.m_ChartsWindow.Controls.Count == 0)
                {
                    m_ReportApp.m_conditionChoose.tabIndex = DisplayPicutureType.AnalyzeDataChart;
                    m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
                }
            }
            m_ReportApp.m_RstWindow.SelectWorkSampleNode();
            //设置每个功能模块限制菜单的显示
            if (this.Controls.Count != 0)
            {
                m_ReportApp.m_RibbonFun.SetRibbonButnStatu_ByModule(DisplayPicutureType.AnalyzeDataChart);
            }
            //判断样品属性与样品窗口在主窗体的位置
            if (m_ReportApp.m_conditionChoose.DockState != m_ReportApp.m_RstWindow.DockState)
            {
                m_ReportApp.m_RstWindow.Activate();
            }
            else
            {
                if (!m_ReportApp.m_conditionChoose.Focus())
                {
                    m_ReportApp.m_RstWindow.Activate();
                }
            }
        }
        #endregion
    }
}