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

using System.Windows.Forms;
using System.Diagnostics;
using System.Drawing;

using mshtml;
using nispi.controlclass;

namespace nispi.Menu
{
    class BrowserNonTextMainMenu
    {
        public ToolStripMenuItemParts menuItemSetShioriParts;
        public ToolStripMenuItemParts menuItemGoToShioriParts;
        public ToolStripMenuItemParts menuItem0Parts;
        public ToolStripMenuItemParts menuItem100Parts;
        public ToolStripMenuItemParts menuItem200Parts;
        public ToolStripMenuItemParts menuItem300Parts;
        public ToolStripMenuItemParts menuItem400Parts;
        public ToolStripMenuItemParts menuItem500Parts;
        public ToolStripMenuItemParts menuItem600Parts;
        public ToolStripMenuItemParts menuItem700Parts;
        public ToolStripMenuItemParts menuItem800Parts;
        public ToolStripMenuItemParts menuItem900Parts;
        public ToolStripMenuItemParts menuItemEndParts;

        public NonTextMenuEvent nonTextMenuEvent;

        public BrowserNonTextMainMenu(ToolStripMenuItemParts menuItem)
        {
            /*テキストがない場合*/
            menuItemSetShioriParts = ToolStripMenuItemPartsManager.Pop();
            menuItemGoToShioriParts = ToolStripMenuItemPartsManager.Pop();
            menuItem0Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem100Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem200Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem300Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem400Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem500Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem600Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem700Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem800Parts = ToolStripMenuItemPartsManager.Pop();
            menuItem900Parts = ToolStripMenuItemPartsManager.Pop();
            menuItemEndParts = ToolStripMenuItemPartsManager.Pop();

            menuItemSetShioriParts.Text = "しおりをセット(&S)";
            menuItemGoToShioriParts.Text = "しおりに移動(&G)";

            menuItem0Parts.Text = "1 に移動(&0)";
            menuItem0Parts.Name = ">>1";

            menuItem100Parts.Text = "100 に移動(&1)";
            menuItem100Parts.Name = ">>100";

            menuItem200Parts.Text = "200 に移動(&2)";
            menuItem200Parts.Name = ">>200";

            menuItem300Parts.Text = "300 に移動(&3)";
            menuItem300Parts.Name = ">>300";

            menuItem400Parts.Text = "400 に移動(&4)";
            menuItem400Parts.Name = ">>400";

            menuItem500Parts.Text = "500 に移動(&5)";
            menuItem500Parts.Name = ">>500";

            menuItem600Parts.Text = "600 に移動(&6)";
            menuItem600Parts.Name = ">>600";

            menuItem700Parts.Text = "700 に移動(&7)";
            menuItem700Parts.Name = ">>700";

            menuItem800Parts.Text = "800 に移動(&8)";
            menuItem800Parts.Name = ">>800";

            menuItem900Parts.Text = "900 に移動(&9)";
            menuItem900Parts.Name = ">>900";

            menuItemEndParts.Text = "最後まで移動(&Z)";


            menuItem.DropDownItemsAdd(menuItemSetShioriParts);
            menuItem.DropDownItemsAdd(menuItemGoToShioriParts);
            menuItem.DropDownItemsAdd("-");
            menuItem.DropDownItemsAdd(menuItem0Parts);
            menuItem.DropDownItemsAdd(menuItem100Parts);
            menuItem.DropDownItemsAdd(menuItem200Parts);
            menuItem.DropDownItemsAdd(menuItem300Parts);
            menuItem.DropDownItemsAdd(menuItem400Parts);
            menuItem.DropDownItemsAdd(menuItem500Parts);
            menuItem.DropDownItemsAdd(menuItem600Parts);
            menuItem.DropDownItemsAdd(menuItem700Parts);
            menuItem.DropDownItemsAdd(menuItem800Parts);
            menuItem.DropDownItemsAdd(menuItem900Parts);
            menuItem.DropDownItemsAdd(menuItemEndParts);

            this.nonTextMenuEvent = new NonTextMenuEvent(this);
        }

        public void SetMainMenu()
        {
            int index = Const.form.threadListTabControlParts.SelectedIndex;

            if ((MainFormConst.threadListTabMain.viewList[index].datUrl != null) &&
                (MainFormConst.threadListTabMain.viewList[index].datUrl.Length > 0))
            {
                menuItemSetShioriParts.Enabled = true;
                menuItemGoToShioriParts.Enabled = true;
                menuItem0Parts.Enabled = true;
                menuItem100Parts.Enabled = true;
                menuItem200Parts.Enabled = true;
                menuItem300Parts.Enabled = true;
                menuItem400Parts.Enabled = true;
                menuItem500Parts.Enabled = true;
                menuItem600Parts.Enabled = true;
                menuItem700Parts.Enabled = true;
                menuItem800Parts.Enabled = true;
                menuItem900Parts.Enabled = true;
                menuItemEndParts.Enabled = true;
            }
            else
            {
                menuItemSetShioriParts.Enabled = false;
                menuItemGoToShioriParts.Enabled = false;
                menuItem0Parts.Enabled = false;
                menuItem100Parts.Enabled = false;
                menuItem200Parts.Enabled = false;
                menuItem300Parts.Enabled = false;
                menuItem400Parts.Enabled = false;
                menuItem500Parts.Enabled = false;
                menuItem600Parts.Enabled = false;
                menuItem700Parts.Enabled = false;
                menuItem800Parts.Enabled = false;
                menuItem900Parts.Enabled = false;
                menuItemEndParts.Enabled = false;
            }
        }
    }
}