//ライセンス情報はAgeOnフォルダのLISENCEフォルダを参照してください
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Diagnostics;
using mshtml;

using nispi.controlclass;
namespace nispi
{
    class ToolMenu
    {
        private ToolStripMenuItemParts mainMenuItemOptionParts;
        private ToolStripMenuItemParts mainMenuItemMapAnalysisParts;
        private ToolStripMenuItemParts mainMenuItemLogSearchParts;
        private ToolStripMenuItemParts mainMenuItemThemeParts;

        private ToolStripMenuItemParts blackThemeParts;
        private ToolStripMenuItemParts black2ThemeParts;
        private ToolStripMenuItemParts deepBlueThemeParts;
        private ToolStripMenuItemParts deepGreenThemeParts;
        private ToolStripMenuItemParts grayThemeParts;
        private ToolStripMenuItemParts fineBlueThemeParts;
        private ToolStripMenuItemParts standard1ThemeParts;
        private ToolStripMenuItemParts standard2ThemeParts;

        public static MainForm form = null;

        public ToolMenu(ToolStripMenuItemParts menuItem)
        {
            mainMenuItemOptionParts = ToolStripMenuItemPartsManager.Pop();
            mainMenuItemMapAnalysisParts = ToolStripMenuItemPartsManager.Pop();
            mainMenuItemLogSearchParts = ToolStripMenuItemPartsManager.Pop();
            mainMenuItemThemeParts = ToolStripMenuItemPartsManager.Pop();

            blackThemeParts = ToolStripMenuItemPartsManager.Pop();
            black2ThemeParts = ToolStripMenuItemPartsManager.Pop();
            deepBlueThemeParts = ToolStripMenuItemPartsManager.Pop();
            deepGreenThemeParts = ToolStripMenuItemPartsManager.Pop();
            grayThemeParts = ToolStripMenuItemPartsManager.Pop();
            fineBlueThemeParts = ToolStripMenuItemPartsManager.Pop();
            standard1ThemeParts = ToolStripMenuItemPartsManager.Pop();
            standard2ThemeParts = ToolStripMenuItemPartsManager.Pop();

            mainMenuItemOptionParts.Text = "設定(&S)";
            mainMenuItemOptionParts.Click += new EventHandler(menuItemOption_Click);
            mainMenuItemMapAnalysisParts.Text = "地図による解析(&A)";
            mainMenuItemMapAnalysisParts.Image = Resources.map;
            mainMenuItemMapAnalysisParts.Click += new EventHandler(menuItemMapAnalysis_Click);
            mainMenuItemLogSearchParts.Text = "ログ検索(&L)";
            mainMenuItemLogSearchParts.Click += new EventHandler(menuItemLogSearch_Click);
            mainMenuItemThemeParts.Text = "テーマ(&T)";
            //mainMenuItemThemeParts.Click += new EventHandler(menuItemTheme_Click);

            blackThemeParts.Text = "Black(&1)";
            blackThemeParts.Name = "Black.xml";
            blackThemeParts.Click += new EventHandler(themeParts_Click);

            black2ThemeParts.Text = "Black2(&2)";
            black2ThemeParts.Name = "Black2.xml";
            black2ThemeParts.Click += new EventHandler(themeParts_Click);

            deepBlueThemeParts.Text = "DeepBlue(&3)";
            deepBlueThemeParts.Name = "DeepBlue.xml";
            deepBlueThemeParts.Click += new EventHandler(themeParts_Click);

            deepGreenThemeParts.Text = "DeepGreen(&4)";
            deepGreenThemeParts.Name = "DeepGreen.xml";
            deepGreenThemeParts.Click += new EventHandler(themeParts_Click);

            grayThemeParts.Text = "Gray(&5)";
            grayThemeParts.Name = "Gray.xml";
            grayThemeParts.Click += new EventHandler(themeParts_Click);

            fineBlueThemeParts.Text = "FineBlue(&6)";
            fineBlueThemeParts.Name = "FineBlue.xml";
            fineBlueThemeParts.Click += new EventHandler(themeParts_Click);

            standard1ThemeParts.Text = "標準1(&7)";
            standard1ThemeParts.Name = "Standard1.xml";
            standard1ThemeParts.Click += new EventHandler(themeParts_Click);

            standard2ThemeParts.Text = "標準2(&8)";
            standard2ThemeParts.Name = "Standard2.xml";
            standard2ThemeParts.Click += new EventHandler(themeParts_Click);

            menuItem.DropDownItemsAdd(mainMenuItemMapAnalysisParts);
            //menuItem.DropDownItemsAdd(mainMenuItemLogSearchParts);
            menuItem.DropDownItemsAdd("-");
            menuItem.DropDownItemsAdd(mainMenuItemOptionParts);
            menuItem.DropDownItemsAdd(mainMenuItemThemeParts);

            mainMenuItemThemeParts.DropDownItemsAdd(blackThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(black2ThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(deepBlueThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(deepGreenThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(grayThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(fineBlueThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(standard1ThemeParts);
            mainMenuItemThemeParts.DropDownItemsAdd(standard2ThemeParts);
        }

        private void menuItemOption_Click(object sender, EventArgs e)
        {
            Const.form.optionMainForm.OpenOptionDialog();
        }
        private void menuItemMapAnalysis_Click(object sender, EventArgs e)
        {
            Const.form.mapMainForm.mapMainForm.Show();
        }
        private void menuItemLogSearch_Click(object sender, EventArgs e)
        {

        }
        private void themeParts_Click(object sender, EventArgs e)
        {
            //Const.debugForm.OutPutDebug("BoardIndex", "a");
            ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
            //Const.debugForm.OutPutDebug("BoardIndex", "b");
            nispi.OptionControl.theme.Theme theme = new OptionControl.theme.Theme();
            //Const.debugForm.OutPutDebug("BoardIndex", "c");
            theme.GetXMLData(menuItem.Name);
            //Const.debugForm.OutPutDebug("BoardIndex", "d");
        }
    }
}