/// <summary> /// メニュー - 編集設定 - Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void menuEditSettings_Click(object sender, EventArgs e) { EditSettingsForm dialog = new EditSettingsForm(); EditSettingsFormResult dr = dialog.ShowDialog(this); if (dr == EditSettingsFormResult.Cancel) { return; } else if (dr == EditSettingsFormResult.Ok) { this.textBoxMailBody.ColumnLine = DataBags.Config.MaxBodyCols; this.textBoxMailBody.Invalidate(); // 絵文字一覧を初期設定する this.emojiList.InitializeEmojiList(); this.emojiList.ShowFirstGroupFirstEmoji(); if (this.lastActiveEmojiTextBox == null) { this.lastActiveEmojiTextBox = this.textBoxMailBody; } this.emojiList.PlaybackFocusTextBox = this.lastActiveEmojiTextBox; this.lastActiveEmojiTextBox.Focus(); } }
/// <summary> /// Form - KeyPress /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditSettingsForm_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Escape) { this.formResult = EditSettingsFormResult.Cancel; this.Close(); } else if (e.KeyChar == (char)Keys.Enter) { this.CloseIfValid(); } }
/// <summary> /// チェックして閉じる /// </summary> private void CloseIfValid() { this.formResult = EditSettingsFormResult.Ok; // NOTE: 値の範囲は NumericUpDown コントロール側で補正されるためチェックしていない // チェックボックスも同じ DataBags.Config.MaxBodyCols = (int)this.numericUpDownBodyCols.Value; DataBags.Config.MaxEmojiListCols = (int)this.numericUpDownEmojiListCols.Value; this.Close(); }
/// <summary> /// キャンセルボタン - Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonCancel_Click(object sender, EventArgs e) { this.formResult = EditSettingsFormResult.Cancel; this.Close(); }