//ライセンス情報は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 = "設定";
            mainMenuItemOptionParts.Click += new EventHandler(menuItemOption_Click);
            mainMenuItemMapAnalysisParts.Text = "地図による解析";
            mainMenuItemMapAnalysisParts.Image = Resources.map;
            mainMenuItemMapAnalysisParts.Click += new EventHandler(menuItemMapAnalysis_Click);
            mainMenuItemLogSearchParts.Text = "ログ検索";
            mainMenuItemLogSearchParts.Click += new EventHandler(menuItemLogSearch_Click);
            mainMenuItemThemeParts.Text = "テーマ";
            //mainMenuItemThemeParts.Click += new EventHandler(menuItemTheme_Click);

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

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

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

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

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

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

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

            standard2ThemeParts.Text = "標準2";
            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)
        {
            ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
            nispi.OptionControl.theme.Theme theme = new OptionControl.theme.Theme();
            theme.GetXMLData(menuItem.Name);
        }
    }
}