private void PreferencesAction(object sender, EventArgs e) { PrefWin Pref = new PrefWin(); Pref.DebugFile = DebugFile; Pref.PipeFont = (Font)PipeTextBox.Font.Clone(); Pref.TextFont = (Font)InputTextBox.Font.Clone(); Pref.ErrorsFont = (Font)ErrorsTextBox.Font.Clone(); Pref.TextWrapping = InputTextBox.WordWrap; Pref.CommandAutoCompletion = commandAutoCompletion; if (Pref.ShowDialog() == DialogResult.OK) { DebugFile = Pref.DebugFile; PipeTextBox.Font = Pref.PipeFont; ArgsTextBox.Font = Pref.PipeFont; // shares same font InputTextBox.Font = Pref.TextFont; OutputTextBox.Font = Pref.TextFont; ErrorsTextBox.Font = Pref.ErrorsFont; InputTextBox.WordWrap = Pref.TextWrapping; if (Pref.TextWrapping) { InputTextBox.ScrollBars = ScrollBars.Vertical; } else { InputTextBox.ScrollBars = ScrollBars.Both; } OutputTextBox.WordWrap = Pref.TextWrapping; if (Pref.TextWrapping) { OutputTextBox.ScrollBars = ScrollBars.Vertical; } else { OutputTextBox.ScrollBars = ScrollBars.Both; } commandAutoCompletion = Pref.CommandAutoCompletion; SaveConfiguration(); } }
protected virtual void Preferences_OnActivated(object sender, System.EventArgs e) { PrefWin Pref = new PrefWin(); Pref.DebugFile = DebugFile; Pref.PipeFont = PipeTextView.Style.FontDescription.ToString(); Pref.TextFont = InputTextView.Style.FontDescription.ToString(); Pref.ErrorsFont = ErrorsTextView.Style.FontDescription.ToString(); Pref.WrapText = InputTextView.WrapMode != WrapMode.None; Pref.CommandAutoCompletion = commandAutoCompletion; try { if (Pref.Run() == (int) ResponseType.Ok) { DebugFile = Pref.DebugFile; PipeTextView.ModifyFont(Pango.FontDescription.FromString(Pref.PipeFont)); ArgsEntry.ModifyFont(Pango.FontDescription.FromString(Pref.PipeFont)); InputTextView.ModifyFont(Pango.FontDescription.FromString(Pref.TextFont)); OutputTextView.ModifyFont(Pango.FontDescription.FromString(Pref.TextFont)); ErrorsTextView.ModifyFont(Pango.FontDescription.FromString(Pref.ErrorsFont)); if (Pref.WrapText) { InputTextView.WrapMode = WrapMode.Word; OutputTextView.WrapMode = WrapMode.Word; } else { InputTextView.WrapMode = WrapMode.None; OutputTextView.WrapMode = WrapMode.None; } commandAutoCompletion = Pref.CommandAutoCompletion; SaveConfiguration(); } } finally { Pref.Destroy(); } }
private void PreferencesAction(object sender, EventArgs e) { PrefWin Pref = new PrefWin(); Pref.DebugFile = DebugFile; Pref.PipeFont = (Font) PipeTextBox.Font.Clone(); Pref.TextFont = (Font) InputTextBox.Font.Clone(); Pref.ErrorsFont = (Font) ErrorsTextBox.Font.Clone(); Pref.TextWrapping = InputTextBox.WordWrap; Pref.CommandAutoCompletion = commandAutoCompletion; if (Pref.ShowDialog() == DialogResult.OK) { DebugFile = Pref.DebugFile; PipeTextBox.Font = Pref.PipeFont; ArgsTextBox.Font = Pref.PipeFont; // shares same font InputTextBox.Font = Pref.TextFont; OutputTextBox.Font = Pref.TextFont; ErrorsTextBox.Font = Pref.ErrorsFont; InputTextBox.WordWrap = Pref.TextWrapping; if (Pref.TextWrapping) InputTextBox.ScrollBars = ScrollBars.Vertical; else InputTextBox.ScrollBars = ScrollBars.Both; OutputTextBox.WordWrap = Pref.TextWrapping; if (Pref.TextWrapping) OutputTextBox.ScrollBars = ScrollBars.Vertical; else OutputTextBox.ScrollBars = ScrollBars.Both; commandAutoCompletion = Pref.CommandAutoCompletion; SaveConfiguration(); } }