diff --git a/CodeLegacy/Forms/MessageForm.cs b/CodeLegacy/Forms/MessageForm.cs index e14a8d1..d829026 100644 --- a/CodeLegacy/Forms/MessageForm.cs +++ b/CodeLegacy/Forms/MessageForm.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace Flowframes.Forms @@ -15,14 +9,16 @@ namespace Flowframes.Forms private string _text = ""; private string _title = ""; private MessageBoxButtons _btns; + private bool _monospace; private bool _dialogResultSet = false; - public MessageForm(string text, string title, MessageBoxButtons buttons = MessageBoxButtons.OK) + public MessageForm(string text, string title, MessageBoxButtons buttons = MessageBoxButtons.OK, bool monospace = false) { _text = text; _title = title; _btns = buttons; + _monospace = monospace; InitializeComponent(); } @@ -32,6 +28,11 @@ namespace Flowframes.Forms Text = _title; textLabel.Text = _text; + if (_monospace) + { + textLabel.Font = new Font("Cascadia Code", textLabel.Font.Size, textLabel.Font.Style); + } + if(_btns == MessageBoxButtons.OK) { SetButtons(true, false, false); diff --git a/CodeLegacy/Ui/UiUtils.cs b/CodeLegacy/Ui/UiUtils.cs index 636cc72..09a8dc8 100644 --- a/CodeLegacy/Ui/UiUtils.cs +++ b/CodeLegacy/Ui/UiUtils.cs @@ -83,7 +83,7 @@ namespace Flowframes.Ui public enum MessageType { Message, Warning, Error }; - public static DialogResult ShowMessageBox(string text, MessageType type = MessageType.Message) + public static DialogResult ShowMessageBox(string text, MessageType type = MessageType.Message, bool monospace = false) { Logger.Log($"MessageBox: {text} ({type}){(BatchProcessing.busy ? "[Batch Mode - Will not display messagebox]" : "")}", true); @@ -100,8 +100,8 @@ namespace Flowframes.Ui if (type == MessageType.Warning) icon = MessageBoxIcon.Warning; else if (type == MessageType.Error) icon = MessageBoxIcon.Error; - MessageForm form = new MessageForm(text, type.ToString()) { TopMost = true }; - form.ShowDialog(); + var msgForm = new MessageForm(text, type.ToString(), monospace: monospace) { TopMost = true }; + Program.mainForm.Invoke(() => msgForm.ShowDialog()); return DialogResult.OK; }