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

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

        private DataStore.MenuBottomConfiguration CurrentMenu;
        #endregion

        #region Constructor
        public ControlCenterConfiHelp(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 == DataStore.LanguageID.English)
            {
                this.buttonSerial.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpSerialDisable));
                this.buttonSerial.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpSerialDown));
                this.buttonSerial.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpSerialUp));
                this.buttonOptionBoard.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpOptionBoardDisable));
                this.buttonOptionBoard.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpOptionBoardDown));
                this.buttonOptionBoard.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpOptionBoardUp));
                this.buttonOption.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpOptionDisable));
                this.buttonOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpOptionDown));
                this.buttonOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpOptionUp));
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.LanguageID.Chinese)
            {
                this.buttonSerial.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpSerialDisable));
                this.buttonSerial.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpSerialDown));
                this.buttonSerial.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpSerialUp));
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.LanguageID.Czech)
            {
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.LanguageID.Russian)
            {
            }
            else
            {
                this.buttonSerial.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpSerialDisable));
                this.buttonSerial.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpSerialDown));
                this.buttonSerial.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpSerialUp));
                this.buttonOptionBoard.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpOptionBoardDisable));
                this.buttonOptionBoard.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpOptionBoardDown));
                this.buttonOptionBoard.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpOptionBoardUp));
                this.buttonOption.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpOptionDisable));
                this.buttonOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpOptionDown));
                this.buttonOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpOptionUp));
            }
        }
        private void DefaultSetting()
        {
            this.CurrentMenu = DataStore.MenuBottomConfiguration.Help;
        }

        public void DisplayRefresh(SystemStatus status)
        {
            this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = DataStore.DisplayStore.ConfiHelp;
            this.ParentForm.ParentForm.SetDisplayMode(DataStore.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.buttonSerial)
                this.CurrentMenu = DataStore.MenuBottomConfiguration.Communication;
            else if (button == this.buttonOption)
                this.CurrentMenu = DataStore.MenuBottomConfiguration.Option;
            else if (button == this.buttonOptionBoard)
                this.CurrentMenu = DataStore.MenuBottomConfiguration.OptionBoard;
            else
                this.CurrentMenu = DataStore.MenuBottomConfiguration.Help;

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