using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using ITC81DB_2.Forms;
using SmartX;
using ITC81DB_2_ImageDll;

namespace ITC81DB_2.Controls
{
    public partial class ControlCenterBasicHelp : UserControl
    {
        #region Field
        private FormMenu m_ParentForm;

        private Define.E_MenuBottomBasic CurrentMenu;
        #endregion

        #region Constructor
        public ControlCenterBasicHelp(FormMenu parent)
        {
            InitializeComponent();

            this.ParentForm = parent;

            this.InitializeDesign();
            this.DefaultSetting();
        }
        #endregion

        #region Property
        public FormMenu ParentForm
        {
            get { return this.m_ParentForm; }
            private set { this.m_ParentForm = value; }
        }
        #endregion

        #region Method
        public void InitializeDesign()
        {
            Class1 images = new Class1();

            if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.English)
            {
                this.buttonTime.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpTimeDisable));
                this.buttonTime.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpTimeDown));
                this.buttonTime.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpTimeUp));
                this.buttonProduct.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpItemDisable));
                this.buttonProduct.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpItemDown));
                this.buttonProduct.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpItemUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpDataStatisticsUp));
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
            {
                this.buttonTime.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpTimeDisable));
                this.buttonTime.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpTimeDown));
                this.buttonTime.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpTimeUp));
                this.buttonProduct.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpItemDisable));
                this.buttonProduct.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpItemDown));
                this.buttonProduct.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpItemUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpDataStatisticsUp));
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Czech)
            {
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
            {
                this.buttonTime.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpTimeDisable));
                this.buttonTime.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpTimeDown));
                this.buttonTime.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpTimeUp));
                this.buttonProduct.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpItemDisable));
                this.buttonProduct.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpItemDown));
                this.buttonProduct.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpItemUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpDataStatisticsUp));
            }
            else
            {
                this.buttonTime.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpTimeDisable));
                this.buttonTime.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpTimeDown));
                this.buttonTime.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpTimeUp));
                this.buttonProduct.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpItemDisable));
                this.buttonProduct.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpItemDown));
                this.buttonProduct.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpItemUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpDataStatisticsUp));
            }
        }
        private void DefaultSetting()
        {
            this.CurrentMenu = Define.E_MenuBottomBasic.Help;
        }

        public void DisplayRefresh(SystemStatus status)
        {
            this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.BasicHelp;
            this.ParentForm.ParentForm.SetDisplayMode(Define.E_DisplayMode.Menu);
            this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);
        }
        #endregion

        #region Event Handler
        private void buttonMenu_Click(object sender, EventArgs e)
        {
            SmartButton button = sender as SmartButton;

            if (button == null)
                return;

            if (button == this.buttonTime)
                this.CurrentMenu = Define.E_MenuBottomBasic.Time;
            else if (button == this.buttonProduct)
                this.CurrentMenu = Define.E_MenuBottomBasic.Product;
            else if (button == this.buttonDataBackup)
                this.CurrentMenu = Define.E_MenuBottomBasic.DataBackup;
            else if (button == this.buttonDataStatistics)
                this.CurrentMenu = Define.E_MenuBottomBasic.DataStatistics;
            else
                this.CurrentMenu = Define.E_MenuBottomBasic.Help;

            this.ParentForm.DisplayBottomBasic(this.CurrentMenu);
        }
        #endregion
    }
}
