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 ITC81DB_2_ImageDll;
using SmartX;

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

        private Define.E_MenuBottomInformation CurrentMenu;
        #endregion

        #region Constructor
        public ControlCenterInforHelp(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.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInformationUp));
                this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpASDisable));
                this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpASDown));
                this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpASUp));
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
            {
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInformationUp));
                this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpASDisable));
                this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpASDown));
                this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpASUp));
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Czech)
            {
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
            {
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpInformationUp));
                this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpASDisable));
                this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpASDown));
                this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnHelpASUp));
            }
            else
            {
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInformationUp));
                this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpASDisable));
                this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpASDown));
                this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpASUp));
            }
        }
        private void DefaultSetting()
        {
            this.CurrentMenu = Define.E_MenuBottomInformation.Help;
        }

        public void DisplayRefresh(SystemStatus status)
        {
            this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.InforHelp;
            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.buttonInformation)
                this.CurrentMenu = Define.E_MenuBottomInformation.SystemInformation;
            else if (button == this.buttonAS)
                this.CurrentMenu = Define.E_MenuBottomInformation.AS;
            else
                this.CurrentMenu = Define.E_MenuBottomInformation.Help;

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