public InfoForm()
        {
            InitializeComponent();

            dAndDSizeChanger = new DAndDSizeChanger(this, this, DAndDArea.All, 4);

            foreach (Control ctrl in this.Controls)
            {
                SetDAndDSizeChanger(ctrl);
            }
            UpdateInfos();
        }
        /// <summary>
        /// フォームがロードされた
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RankingForm_Load(object sender, EventArgs e)
        {
            dAndDSizeChanger = new DAndDSizeChanger(this, this, DAndDArea.All, 4);

            foreach (DataGridViewColumn col in dPSReportDataGridView.Columns)
            {
                col.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                col.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            foreach (DataGridViewRow row in dPSReportDataGridView.Rows)
            {
                row.DefaultCellStyle = dPSReportDataGridView.DefaultCellStyle;
            }
            dPSReportBindingSource.DataSource = report.FF14FastReportDS;
            dPSReportBindingSource.Sort = "Category, Name";
            Write();

            //自動調整
            幅自動調整ToolStripMenuItem.Checked = AutoSizeWidth;
            高さ自動調整ToolStripMenuItem.Checked = AutoSizeHeight;

            toolStripMenuItem1.Checked = ViewLog;
            pT表示ToolStripMenuItem.Checked = ViewPTMember;
            enemy表示ToolStripMenuItem.Checked = ViewEnemy;

            FitHeight();
            FitWidth();

            timer1.Start();
        }
Exemplo n.º 3
0
        // 起動時にまず実行する内容
        private void Form1_Load(object sender, EventArgs e)
        {
            // 設定パネルから直接Form1のコントロールの値を変更するための準備
            Form1.Form1Instance = this;

            // Form端をドラッグ&ドロップでサイズ変更可能にする
            sizeChanger = new DAndDSizeChanger(this, this, DAndDArea.All, 8);

            // TextBoxの内容が変化した時のイベントをここでOFFにする
            textBox1.TextChanged -= textBox1_TextChanged;

            // 前回終了時のウインドウ位置とサイズを取得する
            if (Properties.Settings.Default.FormSize.Width == 0 || Properties.Settings.Default.FormSize.Height == 0)
            {
                // 初回起動時にはデザイナーウインドウで指定されている大きさになる

                //既定値に戻す
                Properties.Settings.Default.Reset();
                // フォント周りの変数の初期化
                fstyLB = listBox1.Font;
                fcolLB = listBox1.ForeColor;
                fstyTB = textBox1.Font;
                fcolTB = textBox1.ForeColor;
                // パネルのアクセントカラーの初期化
                pcol1 = panelLabel1.BackColor;
                pcol2 = panelLabel2.BackColor;
                // 右端で折り返す設定を前回終了時の設定に復元
                wwrapDo = Properties.Settings.Default.wwrap;
                // オートセーブ周りの設定を前回終了時の設定に復元
                autoSaveDo     = Properties.Settings.Default.autoSave;
                deactiveSaveDo = Properties.Settings.Default.deactiveSave;
                autoSaveTickId = Properties.Settings.Default.autoSaveTId;
                autoSaveTick   = Properties.Settings.Default.autoSaveT;
            }
            else
            {
                // 前回終了時のウインドウ位置とサイズに復元
                this.Location = Properties.Settings.Default.FormLocation;
                this.Size     = Properties.Settings.Default.FormSize;

                // ListBoxとTextBoxのフォント設定を前回終了時の設定に復元
                this.listBox1.Font      = Properties.Settings.Default.listBoxFStyle;
                this.listBox1.ForeColor = Properties.Settings.Default.listBoxFColor;
                this.textBox1.Font      = Properties.Settings.Default.textBoxFStyle;
                this.textBox1.ForeColor = Properties.Settings.Default.textBoxFColor;
                // パネルのアクセントカラー設定を前回終了時の設定に復元
                this.panelLabel1.BackColor = Properties.Settings.Default.panelColor1;
                this.panelLabel2.BackColor = Properties.Settings.Default.panelColor2;
                this.panelLabel3.BackColor = Properties.Settings.Default.panelColor1;

                // フォント周りの変数の初期化
                fstyLB = listBox1.Font;
                fcolLB = listBox1.ForeColor;
                fstyTB = textBox1.Font;
                fcolTB = textBox1.ForeColor;
                // パネルのアクセントカラーの初期化
                pcol1 = panelLabel1.BackColor;
                pcol2 = panelLabel2.BackColor;

                // 右端で折り返す設定を前回終了時の設定に復元
                wwrapDo = Properties.Settings.Default.wwrap;
                // SplitContainerの分割する距離を前回終了時の設定に復元
                this.splitContainer1.SplitterDistance = Properties.Settings.Default.splitDist;
                // オートセーブ周りの設定を前回終了時の設定に復元
                autoSaveDo     = Properties.Settings.Default.autoSave;
                deactiveSaveDo = Properties.Settings.Default.deactiveSave;
                autoSaveTickId = Properties.Settings.Default.autoSaveTId;
                autoSaveTick   = Properties.Settings.Default.autoSaveT;

                if (autoSaveTick == 0)
                {
                    //既定値に戻す
                    Properties.Settings.Default.Reset();
                    // フォント周りの変数の初期化
                    fstyLB = listBox1.Font;
                    fcolLB = listBox1.ForeColor;
                    fstyTB = textBox1.Font;
                    fcolTB = textBox1.ForeColor;
                    // パネルのアクセントカラーの初期化
                    pcol1 = panelLabel1.BackColor;
                    pcol2 = panelLabel2.BackColor;
                    // 右端で折り返す設定を前回終了時の設定に復元
                    wwrapDo = Properties.Settings.Default.wwrap;
                    // オートセーブ周りの設定を前回終了時の設定に復元
                    autoSaveDo     = Properties.Settings.Default.autoSave;
                    deactiveSaveDo = Properties.Settings.Default.deactiveSave;
                    autoSaveTickId = Properties.Settings.Default.autoSaveTId;
                    autoSaveTick   = Properties.Settings.Default.autoSaveT;
                }
            }

            // 右端で折り返す設定を反映
            textBox1.WordWrap = wwrapDo;

            // テキストファイルの保存フォルダがある場合
            if (Directory.Exists(TEXTFLD))
            {
                // ListBoxのアイテム名を保存したファイルがある場合
                if (File.Exists(LISTDATA))
                {
                    // アイテム名を保持したテキストファイルを読み込む
                    StreamReader sr1 = new StreamReader(
                        LISTDATA,
                        ENCODE);
                    // 1行ずつListに格納
                    string line = "";
                    while ((line = sr1.ReadLine()) != null)
                    {
                        listAllName.Add(line);
                    }
                    sr1.Close();

                    // TextBoxに表示するテキストファイルをListに読み込む
                    for (int i = 0; i < listAllName.Count; i++)
                    {
                        StreamReader sr2 = new StreamReader(
                            TEXTFLD + @"/" + i.ToString() + @".txt",
                            ENCODE);
                        listAllText.Add(sr2.ReadToEnd());
                        sr2.Close();
                    }

                    // 読み込んだ内容をListBoxに追加
                    for (int i = 0; i < listAllName.Count; i++)
                    {
                        string ln = listAllName[i];
                        string td = listAllText[i];
                        // 付箋クラスのオブジェクトを生成
                        FusenData fdata = new FusenData(ln, td);
                        listBox1.Items.Add(fdata);
                    }
                }
                // ListBoxの項目を保存したファイルが無い場合
                else
                {
                    // ファイルを作成する
                    var sw = new StreamWriter(
                        LISTDATA,
                        false,
                        ENCODE);
                    sw.WriteLine(NEWTITLE);
                    sw.Close();

                    // ListBoxの新規アイテムを追加
                    ListAdd();
                }
            }
            // テキストファイルの保存フォルダが無い場合
            else
            {
                // フォルダを作成する
                DirectoryInfo di = Directory.CreateDirectory(TEXTFLD);

                // ファイルを作成する
                var sw = new StreamWriter(
                    LISTDATA,
                    false,
                    ENCODE);
                sw.WriteLine(NEWTITLE);
                sw.Close();

                // ListBoxの新規アイテムを追加
                ListAdd();
            }

            SelTop();                   // 先頭のアイテムを選択
            ShowTextData();             // 選択アイテムの中身をTextBoxに表示

            //カレット位置を末尾に移動
            textBox1.SelectionStart = 0;
            //テキストボックスにフォーカスを移動
            textBox1.Focus();
            //カレット位置までスクロール
            textBox1.ScrollToCaret();

            // ListBoxの選択Indexが変化した時のイベントをここでONにする
            listBox1.SelectedIndexChanged += listBox1_SelectedIndexChanged;

            // オートセーブ用のタイマーを開始
            timer          = new Timer();
            timer.Tick    += new EventHandler(doSave);
            timer.Interval = autoSaveTick;    // 実行間隔
            timer.Enabled  = true;            // timer.Start()と同じ
        }
Exemplo n.º 4
0
        // 起動時にまず実行する内容
        private void Form1_Load(object sender, EventArgs e)
        {
            // Form端をドラッグ&ドロップでサイズ変更可能にする
            DAndDSizeChanger sizeChanger = new DAndDSizeChanger(this, this, DAndDArea.All, 8);

            // 設定ファイルの読み込み
            if (Settings.LoadSettings() != true)
            {
                // 設定の初期化
                Settings.Initialize();
            }
            else
            {
                // メインウインドウの位置とサイズの復元
                this.Left   = Settings.winPosX;
                this.Top    = Settings.winPosY;
                this.Width  = Settings.winSizeX;
                this.Height = Settings.winSizeY;

                // SplitContainerの位置の復元
                this.splitContainer1.SplitterDistance = Settings.splitDistance;

                // メインカラーの復元
                panelLabel1.BackColor = Settings.mainColor;
                panelLabel2.BackColor = Settings.mainColor;
                panelLabel3.BackColor = Settings.mainColor;

                // フォントの種類・カラーの復元
                textBox1.Font       = Properties.Settings.Default.FontTB;
                treeView1.Font      = Properties.Settings.Default.FontTV;
                textBox1.ForeColor  = Settings.fontColorTB;
                treeView1.ForeColor = Settings.fontColorTV;

                // 最前面表示設定の復元
                if (Settings.frontView == true)
                {
                    buttonFront.BackgroundImage = Properties.Resources.icon_pin_on;
                    this.TopMost = true;
                }

                // ツールチップ表示設定の復元
                toolTip1.Active = Settings.toolTip;

                // テキスト折り返し設定の復元
                if (Settings.wordWrap == true)
                {
                    textBox1.WordWrap = true;
                }
                else
                {
                    textBox1.WordWrap = false;
                }
            }

            // TextBoxの内容が変化した時のイベントをここでOFFにする(Dirtyマーク用)
            textBox1.TextChanged -= TextBox1_TextChanged;

            // XMLファイルの読み込み
            try
            {
                XmlLoad();

                // 前回終了時に選択していたノードを選択する
                try
                {
                    SetSelNodeIndex();
                }
                catch (Exception)
                {
                    // TreeViewにフォーカスする
                    treeView1.Focus();
                }
            }
            catch (Exception)
            {
                // メッセージフォーム
                var form = new FormMessageBox();
                // 画面の真ん中に表示
                form.StartPosition = FormStartPosition.CenterScreen;

                // メッセージフォームをタスクバーに表示しない
                form.ShowInTaskbar = false;

                // 画像を非表示
                form.pictureBox1.Enabled = false;
                form.pictureBox1.Visible = false;
                // メッセージテキストを差し替え
                form.label1.Text    = "ListFusen2 にようこそ!";
                form.label2.Enabled = false;
                form.label2.Visible = false;
                // フォームサイズを小さく
                form.Width  = 300;
                form.Height = 100;
                // ボタンのアレンジ
                form.btnOK.Enabled  = false;
                form.btnOK.Visible  = false;
                form.btnCancel.Text = "OK";

                // メッセージフォームをモーダルで開く
                form.ShowDialog();

                // Disposeでフォームを解放
                form.Dispose();

                // 親ノードを1つ追加
                AddMemParent();
            }

            // オートセーブ用のタイマーを開始
            timerAutoSave          = new Timer();
            timerAutoSave.Tick    += new EventHandler(doSave);                  // イベントを設定
            timerAutoSave.Interval = 60 * 60000;                                // 実行間隔 60分
            timerAutoSave.Enabled  = false;                                     // timer.Stop()と同じ

            // オートバックアップ用のタイマーを開始
            timerAutoBackup          = new Timer();
            timerAutoBackup.Tick    += new EventHandler(doBackup);          // イベントを設定
            timerAutoBackup.Interval = 60 * 60000;                          // 実行間隔 60分
            timerAutoBackup.Enabled  = true;                                // timer.Start()と同じ
        }
        private void TargetInfoWindowForm_Load(object sender, EventArgs e)
        {
            dAndDSizeChanger = new DAndDSizeChanger(this, this, DAndDArea.All, 4);

            Write();
            timer1.Start();
        }
        public FastReportForm()
        {
            InitializeComponent();
            ar = new FF14LogParser();

            dAndDSizeChanger = new DAndDSizeChanger(this, this, DAndDArea.All, 4);

            foreach(Control ctrl in this.Controls)
            {
                SetDAndDSizeChanger(ctrl);
            }


        }