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

using System.Windows.Forms;

using nispi.controlclass;
using nispi.Menu;
using nispi.OptionControl;
using nispi.AgeOnDebuger;

namespace nispi
{
    partial class MainForm
    {
        public void MainType3PanelResize(object sender, EventArgs e)
        {
            System.Windows.Forms.Control control = (System.Windows.Forms.Control)sender;
            MainType3PanelResize();
        }
        public void MainType3PanelResize()
        {
            mainSplitContainerType3Parts.Size = new Size(Const.MainFormType3Size.Width - Scale.GetMainSplitContainerMinusSize().Width,
                Const.MainFormType3Size.Height - Scale.GetMainSplitContainerMinusSize().Height);

            subMainSplitContainerType3Parts.Size = new Size(mainSplitContainerType3Parts.SplitterDistance - 2,
                mainSplitContainerType3Parts.Size.Height);

            MainFormConst.formShowStyle.ReSizeType3();
        }

        public void SubType3PanelResize(object sender, EventArgs e)
        {
            SubType3PanelResize();
        }
        public void SubType3PanelResize()
        {
            mainSplitContainerType3Parts.Size = new Size(Const.MainFormType3Size.Width - Scale.GetMainSplitContainerMinusSize().Width,
                Const.MainFormType3Size.Height - Scale.GetMainSplitContainerMinusSize().Height);

            subMainSplitContainerType3Parts.Size = new Size(mainSplitContainerType3Parts.SplitterDistance - 2,
                mainSplitContainerType3Parts.Size.Height);


            /*if (subMainSplitContainerType2Parts.SplitterDistance < 100)
                subMainSplitContainerType2Parts.SplitterDistance = 100;

            if ((subMainSplitContainerType2Parts.Size.Height - subMainSplitContainerType2Parts.SplitterDistance) < 100)
                subMainSplitContainerType2Parts.SplitterDistance = subMainSplitContainerType2Parts.Size.Height - 100;*/
            MainFormConst.formShowStyle.ReSizeType3();
        }

        public void FormResizeType3(object sender, EventArgs e)
        {
            //ちらつき防止
            MainFormConst.boardIndexTabMain.boardIndexView.boardIndexControls.treeViewParts.Visible = false;
            MainFormConst.boardIndexTabMain.scBoardIndexView.boardIndexControls.treeViewParts.Visible = false;
            MainFormConst.boardIndexTabMain.open2chBoardIndexView.boardIndexControls.treeViewParts.Visible = false;
            MainFormConst.boardIndexTabMain.next2chBoardIndexView.boardIndexControls.treeViewParts.Visible = false;

            MainFormConst.boardIndexTabMain.jikkyoBoardIndexView.boardIndexControls.treeViewParts.Visible = false;
            //MainFormConst.boardIndexTabMain.blogbanBoardIndexView.boardIndexControls.treeViewParts.Visible = false;
            MainFormConst.boardIndexTabMain.shizuBoardIndexView.boardIndexControls.treeViewParts.Visible = false;

            MainFormConst.boardIndexTabMain.vip2chBoardIndexView.boardIndexControls.treeViewParts.Visible = false;
            MainFormConst.boardIndexTabMain.machibbsBoardIndexView.boardIndexControls.treeViewParts.Visible = false;

            MainFormConst.boardIndexTabMain.favoriteBoardIndexView.boardIndexControls.treeViewParts.Visible = false;

            //mainSplitContainerType2Parts.Panel1_Resize -= new EventHandler(MainType2PanelResize);
            //subMainSplitContainerType2Parts.Panel1_Resize -= new EventHandler(SubType2PanelResize);

            System.Windows.Forms.Control control = (System.Windows.Forms.Control)sender;
            Const.MainFormType3Size = control.Size;
            FormResizeType3();

            MainFormConst.formShowStyle.ReSizeType3();
            //mainSplitContainerType2Parts.Panel1_Resize += new EventHandler(MainType2PanelResize);
            //subMainSplitContainerType2Parts.Panel1_Resize += new EventHandler(SubType2PanelResize);

            //ちらつき防止後処理
            MainFormConst.boardIndexTabMain.boardIndexView.boardIndexControls.treeViewParts.Visible = true;
            MainFormConst.boardIndexTabMain.scBoardIndexView.boardIndexControls.treeViewParts.Visible = true;
            MainFormConst.boardIndexTabMain.open2chBoardIndexView.boardIndexControls.treeViewParts.Visible = true;
            MainFormConst.boardIndexTabMain.next2chBoardIndexView.boardIndexControls.treeViewParts.Visible = true;

            MainFormConst.boardIndexTabMain.jikkyoBoardIndexView.boardIndexControls.treeViewParts.Visible = true;
            //MainFormConst.boardIndexTabMain.blogbanBoardIndexView.boardIndexControls.treeViewParts.Visible = true;
            MainFormConst.boardIndexTabMain.shizuBoardIndexView.boardIndexControls.treeViewParts.Visible = true;

            MainFormConst.boardIndexTabMain.vip2chBoardIndexView.boardIndexControls.treeViewParts.Visible = true;
            MainFormConst.boardIndexTabMain.machibbsBoardIndexView.boardIndexControls.treeViewParts.Visible = true;

            MainFormConst.boardIndexTabMain.favoriteBoardIndexView.boardIndexControls.treeViewParts.Visible = true;
        }

        public void FormResizeType3()
        {
            //ToolStrip
            toolStripParts.Size = new Size(mainSplitContainerType3Parts.Size.Width - 200, toolStripTextBoxParts.Size.Height);
            //toolStripTextBoxParts.Size = new Size(mainSplitContainerType2Parts.Size.Width - 250, toolStripTextBoxParts.Size.Height);

            //解除しないとループになる処理郡
            mainSplitContainerType3Parts.Size = new Size(Const.MainFormType3Size.Width - Scale.GetMainSplitContainerMinusSize().Width,
                Const.MainFormType3Size.Height - Scale.GetMainSplitContainerMinusSize().Height);

            //del 3/3
            //mainSplitContainerType2Parts.SplitterDistance = (Const.MainFormType2Size.Width) / 2 - 6;

            subMainSplitContainerType3Parts.Size = new Size(mainSplitContainerType3Parts.SplitterDistance - 2,
                mainSplitContainerType3Parts.Size.Height);
        }
    }
}
