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

using nispi.controlclass;
namespace nispi.OptionControl
{
    //タブのタブのテキストの色と背景色とフォント、フォームの背景色、テキストの色とフォント
    //リストビュー、インデックスの背景色、選択した色、フォント

    class OutWardList:OutWardListData
    {
        GroupBoxParts listViewGBoxParts;

        public SampleListViewParts sampleListViewParts;
        public ButtonParts lVFontButtonParts;
        public ButtonParts lVResetButtonParts;
        public ButtonParts lVOriginalFontButtonParts;
        public ButtonParts lVBackColorButtonParts;
        public ButtonParts lVBackColor2ButtonParts;
        public ButtonParts lVSelectBackColorButtonParts;
        public ButtonParts lVSelectForeColorButtonParts;
        public ButtonParts lVColmunBColorButtonParts;
        public ButtonParts lVColmunFColorButtonParts;

        public OptionMainForm optionTabMain;

        public OutWardOptionEventListView outWardOptionEventListView;

        public OutWardList(OptionMainForm optionTabMain)
        {
            this.optionTabMain = optionTabMain;
            float scaledFloat = Scale.GetScaledFloat(optionTabMain.fontSize);
            ////
            listViewGBoxParts = new GroupBoxParts();
            sampleListViewParts = new SampleListViewParts();

            lVFontButtonParts = new ButtonParts();
            lVResetButtonParts = new ButtonParts();
            lVOriginalFontButtonParts = new ButtonParts();

            lVBackColorButtonParts = new ButtonParts();
            lVBackColor2ButtonParts = new ButtonParts();

            lVSelectBackColorButtonParts = new ButtonParts();
            lVSelectForeColorButtonParts  = new ButtonParts();

            lVColmunBColorButtonParts = new ButtonParts();
            lVColmunFColorButtonParts = new ButtonParts();

            listViewGBoxParts.Location = new Point(10, 260);
            listViewGBoxParts.Size = new Size(optionTabMain.optionFormParts.ClientSize.Width - 24, 130);
            listViewGBoxParts.SetFont(optionTabMain.fontName, optionTabMain.fontSize);
            listViewGBoxParts.Text = "板のインデックスと板のリスト";

            sampleListViewParts.Location = new Point(20, 30);
            sampleListViewParts.Size = new Size(200,90);
            sampleListViewParts.WriteListView();


            lVFontButtonParts.Location = new Point(230, 30);
            lVFontButtonParts.Size = new Size(80, 25);
            lVFontButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVFontButtonParts.Text = "フォント";

            lVResetButtonParts.Location = new Point(optionTabMain.optionFormParts.ClientSize.Width - 130, 30);
            lVResetButtonParts.Size = new Size(100, 25);
            lVResetButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVResetButtonParts.Text = "元に戻す";

            lVOriginalFontButtonParts.Location = new Point(320, 30);
            lVOriginalFontButtonParts.Size = new Size(100, 25);
            lVOriginalFontButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVOriginalFontButtonParts.Text = "独自フォント";

            lVBackColorButtonParts.Location = new Point(230, 60);
            lVBackColorButtonParts.Size = new Size(90, 25);
            lVBackColorButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVBackColorButtonParts.Text = "ﾘｽﾄの背景色";

            lVBackColor2ButtonParts.Location = new Point(330, 60);
            lVBackColor2ButtonParts.Size = new Size(100, 25);
            lVBackColor2ButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVBackColor2ButtonParts.Text = "ﾘｽﾄの背景色2";

            lVSelectBackColorButtonParts.Location = new Point(440, 60);
            lVSelectBackColorButtonParts.Size = new Size(110, 25);
            lVSelectBackColorButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVSelectBackColorButtonParts.Text = "選択中の背景色";

            lVSelectForeColorButtonParts.Location = new Point(230, 90);
            lVSelectForeColorButtonParts.Size = new Size(110, 25);
            lVSelectForeColorButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVSelectForeColorButtonParts.Text = "選択中の文字色";

            lVColmunBColorButtonParts.Location = new Point(355, 90);
            lVColmunBColorButtonParts.Size = new Size(100, 25);
            lVColmunBColorButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVColmunBColorButtonParts.Text = "ｶﾗﾑの背景色";

            lVColmunFColorButtonParts.Location = new Point(460, 90);
            lVColmunFColorButtonParts.Size = new Size(90, 25);
            lVColmunFColorButtonParts.SetFont(optionTabMain.fontName, scaledFloat);
            lVColmunFColorButtonParts.Text = "ｶﾗﾑの文字色";

            this.optionTabMain.outWardForm.tabPageParts.AddControl(listViewGBoxParts);
            listViewGBoxParts.AddControl(sampleListViewParts);
            listViewGBoxParts.AddControl(lVFontButtonParts);
            listViewGBoxParts.AddControl(lVOriginalFontButtonParts);
            listViewGBoxParts.AddControl(lVResetButtonParts);
            listViewGBoxParts.AddControl(lVBackColorButtonParts);
            listViewGBoxParts.AddControl(lVBackColor2ButtonParts);
            listViewGBoxParts.AddControl(lVSelectBackColorButtonParts);
            listViewGBoxParts.AddControl(lVSelectForeColorButtonParts);
            listViewGBoxParts.AddControl(lVColmunBColorButtonParts);
            listViewGBoxParts.AddControl(lVColmunFColorButtonParts);

            this.outWardOptionEventListView = new OutWardOptionEventListView(this);
        }
        public void SetDataToGUI()
        {
            this.outWardOptionEventListView.ResetEvent();

            //////////////////////////////////////////////////
            //フォント
            this.sampleListViewParts.SetFont(this.LVFontName,this.LVFontSize);

            //////////////////////////////////////////////////
            //通常の文字色
            byte[] rgb = {LVForeColorRed,LVForeColorGreen,LVForeColorBlue};
            this.sampleListViewParts.SetItemForeColor(0, rgb);
            this.sampleListViewParts.SetItemForeColor(1, rgb);
            
            //////////////////////////////////////////////////
            //リストの背景色の一つおき
            rgb[0] = LVBackColorRed;
            rgb[1] = LVBackColorGreen;
            rgb[2] = LVBackColorBlue;
            this.sampleListViewParts.SetItemBackColor(0, rgb);

            //////////////////////////////////////////////////
            //リストの背景色の一つおき
            rgb[0] = LVBackColor2Red;
            rgb[1] = LVBackColor2Green;
            rgb[2] = LVBackColor2Blue;
            this.sampleListViewParts.SetItemBackColor(1,rgb);


            //////////////////////////////////////////////////
            //選択
            rgb[0] = LVSelectBackColorRed;
            rgb[1] = LVSelectBackColorGreen;
            rgb[2] = LVSelectBackColorBlue;
            this.sampleListViewParts.SetItemBackColor(2,rgb);
            //文字色
            rgb[0] = LVSelectForeColorRed;
            rgb[1] = LVSelectForeColorGreen;
            rgb[2] = LVSelectForeColorBlue;
            this.sampleListViewParts.SetItemForeColor(2, rgb);

            //////////////////////////////////////////////////
            //カラム
            rgb[0] = LVColmunForeColorRed;
            rgb[1] = LVColmunForeColorGreen;
            rgb[2] = LVColmunForeColorBlue;
            this.sampleListViewParts.SetColumnForeColor(rgb);
            //背景色
            rgb[0] = LVColmunBackColorRed;
            rgb[1] = LVColmunBackColorGreen;
            rgb[2] = LVColmunBackColorBlue;
            this.sampleListViewParts.SetColumnBackColor(rgb);



            this.outWardOptionEventListView.SetEvent();
        }
    }
}
