2014-11-13 09:43:39 +00:00
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-04-25 22:58:42 +00:00
|
|
|
|
using System.Diagnostics;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
using System.Drawing;
|
2015-08-16 23:42:57 +00:00
|
|
|
|
using System.Globalization;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2015-09-16 12:10:43 +00:00
|
|
|
|
#if PROFILE
|
|
|
|
|
using JetBrains.Profiler.Core.Api;
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-11-13 09:43:39 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder
|
|
|
|
|
{
|
|
|
|
|
#region ================== Enums
|
|
|
|
|
|
|
|
|
|
[Flags]
|
|
|
|
|
public enum DebugMessageType
|
|
|
|
|
{
|
2014-12-03 23:15:26 +00:00
|
|
|
|
LOG = 1,
|
|
|
|
|
INFO = 2,
|
|
|
|
|
WARNING = 4,
|
|
|
|
|
ERROR = 8,
|
|
|
|
|
SPECIAL = 16,
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public partial class DebugConsole : UserControl
|
|
|
|
|
{
|
|
|
|
|
#region ================== Variables
|
|
|
|
|
|
2014-11-25 11:52:01 +00:00
|
|
|
|
private const int MAX_MESSAGES = 1024;
|
|
|
|
|
private static readonly List<KeyValuePair<DebugMessageType, string>> messages = new List<KeyValuePair<DebugMessageType, string>>(MAX_MESSAGES);
|
2014-11-13 09:43:39 +00:00
|
|
|
|
|
|
|
|
|
//Colors
|
|
|
|
|
private readonly Dictionary<DebugMessageType, Color> textcolors;
|
|
|
|
|
private readonly Dictionary<DebugMessageType, string> textheaders;
|
|
|
|
|
|
2014-11-25 11:52:01 +00:00
|
|
|
|
private DebugMessageType filters;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
private static long starttime = -1;
|
2016-04-08 14:02:08 +00:00
|
|
|
|
private static long storedtime;
|
Sectors, Linedefs, Things modes: optimized text label rendering.
Fixed, Things mode: in some cases selection labels were not updated after editing a thing.
Fixed, Things mode: selection labels were positioned incorrectly on things with FixedSize setting.
Fixed, Sectors mode: fixed a crash when selecting self-referencing sector when selection labels were enabled.
Fixed, Visual mode: in some cases Auto-align texture actions were not working when "use long texture names" Map Options setting was enabled.
Fixed, MD2/MD3 loader: available animation frames upper bound check was performed incorrectly, which would cause a crash in some very special cases.
Fixed, Game configurations: most Hexen/ZDoom teleport actions use TeleportDests as teleport targets, not MapSpots.
2016-04-05 22:24:36 +00:00
|
|
|
|
private static int counter;
|
2016-04-22 13:28:23 +00:00
|
|
|
|
private static string storedtext = string.Empty;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
private static DebugConsole me;
|
|
|
|
|
|
2019-12-28 19:37:05 +00:00
|
|
|
|
#endregion
|
2014-11-13 09:43:39 +00:00
|
|
|
|
|
2019-12-28 19:37:05 +00:00
|
|
|
|
#region ================== Properties
|
2014-11-13 09:43:39 +00:00
|
|
|
|
|
2019-12-28 19:37:05 +00:00
|
|
|
|
public bool AlwaysOnTop { get { return alwaysontop.Checked; } }
|
2016-05-12 22:35:11 +00:00
|
|
|
|
public static int Counter { get { return counter; } }
|
2014-11-13 09:43:39 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Constructor
|
|
|
|
|
|
|
|
|
|
public DebugConsole()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
me = this;
|
|
|
|
|
|
|
|
|
|
// Setup filters
|
2015-12-28 15:01:53 +00:00
|
|
|
|
foreach(ToolStripMenuItem item in filterselector.DropDownItems)
|
2014-11-13 09:43:39 +00:00
|
|
|
|
{
|
|
|
|
|
UpdateFilters(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Setup colors
|
|
|
|
|
textcolors = new Dictionary<DebugMessageType, Color> {
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{ DebugMessageType.LOG, SystemColors.WindowText },
|
|
|
|
|
{ DebugMessageType.INFO, Color.DarkGreen },
|
|
|
|
|
{ DebugMessageType.WARNING, Color.DarkOrange },
|
|
|
|
|
{ DebugMessageType.ERROR, Color.DarkRed },
|
|
|
|
|
{ DebugMessageType.SPECIAL, Color.DarkMagenta }
|
2014-11-13 09:43:39 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Setup headers
|
|
|
|
|
textheaders = new Dictionary<DebugMessageType, string> {
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{ DebugMessageType.LOG, string.Empty},
|
|
|
|
|
{ DebugMessageType.INFO, string.Empty},
|
|
|
|
|
{ DebugMessageType.WARNING, "Warning: "},
|
|
|
|
|
{ DebugMessageType.ERROR, "ERROR: "},
|
|
|
|
|
{ DebugMessageType.SPECIAL, string.Empty}
|
2014-11-13 09:43:39 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Word wrap?
|
|
|
|
|
wordwrap.Checked = console.WordWrap;
|
|
|
|
|
|
|
|
|
|
// Pending messages?
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(messages.Count > 0) UpdateMessages();
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Methods
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-22 13:28:23 +00:00
|
|
|
|
public static void StoreText(string text) { storedtext += text + Environment.NewLine; }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-22 13:28:23 +00:00
|
|
|
|
public static void SetStoredText() { Write(DebugMessageType.INFO, storedtext, false); storedtext = string.Empty; }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
public static void SetText(string text) { Write(DebugMessageType.INFO, text, false); } // Useful to display frequently updated text without flickering
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
public static void WriteLine(string text) { Write(DebugMessageType.INFO, text + Environment.NewLine, true); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
public static void WriteLine(DebugMessageType type, string text) { Write(type, text + Environment.NewLine, true); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
public static void Write(string text) { Write(DebugMessageType.INFO, text, true); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
public static void Write(DebugMessageType type, string text) { Write(type, text, true); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
public static void Write(DebugMessageType type, string text, bool append)
|
2014-11-13 09:43:39 +00:00
|
|
|
|
{
|
2019-12-28 19:37:05 +00:00
|
|
|
|
if (General.MainWindow == null)
|
|
|
|
|
return;
|
|
|
|
|
General.MainWindow.RunOnUIThread(() =>
|
|
|
|
|
{
|
|
|
|
|
if (messages.Count + 1 > MAX_MESSAGES) lock (messages) { messages.RemoveAt(0); }
|
|
|
|
|
messages.Add(new KeyValuePair<DebugMessageType, string>(type, text));
|
|
|
|
|
if (me != null && (me.filters & type) == type)
|
|
|
|
|
{
|
|
|
|
|
me.AddMessage(type, text, true, append);
|
|
|
|
|
}
|
|
|
|
|
});
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2014-11-13 09:43:39 +00:00
|
|
|
|
public static void Clear()
|
|
|
|
|
{
|
2019-12-28 19:37:05 +00:00
|
|
|
|
if (General.MainWindow == null)
|
|
|
|
|
return;
|
|
|
|
|
General.MainWindow.RunOnUIThread(() =>
|
|
|
|
|
{
|
|
|
|
|
if (me != null) me.console.Clear();
|
|
|
|
|
messages.Clear();
|
|
|
|
|
});
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2014-11-13 09:43:39 +00:00
|
|
|
|
public static void StartTimer()
|
|
|
|
|
{
|
2019-08-08 02:02:00 +00:00
|
|
|
|
starttime = Clock.Timer.ElapsedMilliseconds;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-08 14:02:08 +00:00
|
|
|
|
public static void PauseTimer()
|
|
|
|
|
{
|
|
|
|
|
if(starttime == -1) throw new InvalidOperationException("DebugConsole.StartTimer() must be called before DebugConsole.PauseTimer()!");
|
|
|
|
|
|
2019-08-08 02:02:00 +00:00
|
|
|
|
storedtime += Clock.Timer.ElapsedMilliseconds - starttime;
|
2016-04-08 14:02:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2014-11-13 09:43:39 +00:00
|
|
|
|
public static void StopTimer(string message)
|
|
|
|
|
{
|
2015-08-16 23:42:57 +00:00
|
|
|
|
if(starttime == -1) throw new InvalidOperationException("DebugConsole.StartTimer() must be called before DebugConsole.StopTimer()!");
|
|
|
|
|
|
2019-08-08 02:02:00 +00:00
|
|
|
|
long duration = Clock.Timer.ElapsedMilliseconds - starttime + storedtime;
|
2015-08-16 23:42:57 +00:00
|
|
|
|
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(message.Contains("%"))
|
2015-08-16 23:42:57 +00:00
|
|
|
|
message = message.Replace("%", duration.ToString(CultureInfo.InvariantCulture));
|
|
|
|
|
else
|
|
|
|
|
message = message.TrimEnd() + " " + duration + " ms.";
|
|
|
|
|
|
2016-05-29 00:38:55 +00:00
|
|
|
|
#if DEBUG
|
2015-08-16 23:42:57 +00:00
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, message);
|
2016-05-29 00:38:55 +00:00
|
|
|
|
#else
|
|
|
|
|
General.ShowErrorMessage(message, MessageBoxButtons.OK, false);
|
|
|
|
|
#endif
|
2014-11-13 09:43:39 +00:00
|
|
|
|
|
|
|
|
|
starttime = -1;
|
2016-04-08 14:02:08 +00:00
|
|
|
|
storedtime = 0;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
Sectors, Linedefs, Things modes: optimized text label rendering.
Fixed, Things mode: in some cases selection labels were not updated after editing a thing.
Fixed, Things mode: selection labels were positioned incorrectly on things with FixedSize setting.
Fixed, Sectors mode: fixed a crash when selecting self-referencing sector when selection labels were enabled.
Fixed, Visual mode: in some cases Auto-align texture actions were not working when "use long texture names" Map Options setting was enabled.
Fixed, MD2/MD3 loader: available animation frames upper bound check was performed incorrectly, which would cause a crash in some very special cases.
Fixed, Game configurations: most Hexen/ZDoom teleport actions use TeleportDests as teleport targets, not MapSpots.
2016-04-05 22:24:36 +00:00
|
|
|
|
public static void IncrementCounter() { IncrementCounter(1); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
Sectors, Linedefs, Things modes: optimized text label rendering.
Fixed, Things mode: in some cases selection labels were not updated after editing a thing.
Fixed, Things mode: selection labels were positioned incorrectly on things with FixedSize setting.
Fixed, Sectors mode: fixed a crash when selecting self-referencing sector when selection labels were enabled.
Fixed, Visual mode: in some cases Auto-align texture actions were not working when "use long texture names" Map Options setting was enabled.
Fixed, MD2/MD3 loader: available animation frames upper bound check was performed incorrectly, which would cause a crash in some very special cases.
Fixed, Game configurations: most Hexen/ZDoom teleport actions use TeleportDests as teleport targets, not MapSpots.
2016-04-05 22:24:36 +00:00
|
|
|
|
public static void IncrementCounter(int incrementby)
|
|
|
|
|
{
|
|
|
|
|
counter += incrementby;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2016-06-02 09:55:01 +00:00
|
|
|
|
public static void ResetCounter() { ResetCounter(string.Empty); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("DEBUG")]
|
Sectors, Linedefs, Things modes: optimized text label rendering.
Fixed, Things mode: in some cases selection labels were not updated after editing a thing.
Fixed, Things mode: selection labels were positioned incorrectly on things with FixedSize setting.
Fixed, Sectors mode: fixed a crash when selecting self-referencing sector when selection labels were enabled.
Fixed, Visual mode: in some cases Auto-align texture actions were not working when "use long texture names" Map Options setting was enabled.
Fixed, MD2/MD3 loader: available animation frames upper bound check was performed incorrectly, which would cause a crash in some very special cases.
Fixed, Game configurations: most Hexen/ZDoom teleport actions use TeleportDests as teleport targets, not MapSpots.
2016-04-05 22:24:36 +00:00
|
|
|
|
public static void ResetCounter(string message)
|
|
|
|
|
{
|
2016-06-02 09:55:01 +00:00
|
|
|
|
if(!string.IsNullOrEmpty(message))
|
|
|
|
|
{
|
|
|
|
|
if(message.Contains("%"))
|
|
|
|
|
message = message.Replace("%", counter.ToString());
|
|
|
|
|
else
|
|
|
|
|
message = message.TrimEnd() + ": " + counter;
|
Sectors, Linedefs, Things modes: optimized text label rendering.
Fixed, Things mode: in some cases selection labels were not updated after editing a thing.
Fixed, Things mode: selection labels were positioned incorrectly on things with FixedSize setting.
Fixed, Sectors mode: fixed a crash when selecting self-referencing sector when selection labels were enabled.
Fixed, Visual mode: in some cases Auto-align texture actions were not working when "use long texture names" Map Options setting was enabled.
Fixed, MD2/MD3 loader: available animation frames upper bound check was performed incorrectly, which would cause a crash in some very special cases.
Fixed, Game configurations: most Hexen/ZDoom teleport actions use TeleportDests as teleport targets, not MapSpots.
2016-04-05 22:24:36 +00:00
|
|
|
|
|
2016-06-02 09:55:01 +00:00
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, message);
|
|
|
|
|
}
|
Sectors, Linedefs, Things modes: optimized text label rendering.
Fixed, Things mode: in some cases selection labels were not updated after editing a thing.
Fixed, Things mode: selection labels were positioned incorrectly on things with FixedSize setting.
Fixed, Sectors mode: fixed a crash when selecting self-referencing sector when selection labels were enabled.
Fixed, Visual mode: in some cases Auto-align texture actions were not working when "use long texture names" Map Options setting was enabled.
Fixed, MD2/MD3 loader: available animation frames upper bound check was performed incorrectly, which would cause a crash in some very special cases.
Fixed, Game configurations: most Hexen/ZDoom teleport actions use TeleportDests as teleport targets, not MapSpots.
2016-04-05 22:24:36 +00:00
|
|
|
|
|
|
|
|
|
counter = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("PROFILE")]
|
2015-09-16 12:10:43 +00:00
|
|
|
|
public static void StartProfiler()
|
|
|
|
|
{
|
|
|
|
|
#if PROFILE
|
|
|
|
|
if(PerformanceProfiler.IsActive)
|
|
|
|
|
{
|
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, "Starting the Profiler...");
|
|
|
|
|
PerformanceProfiler.Begin();
|
|
|
|
|
PerformanceProfiler.Start();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, "Unable to start the Profiler...");
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, "Unable to start the Profiler: incorrect build configuration selected!");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("PROFILE")]
|
2015-09-16 12:10:43 +00:00
|
|
|
|
public static void StopProfiler() { StopProfiler(true); }
|
2020-04-25 22:58:42 +00:00
|
|
|
|
|
|
|
|
|
[Conditional("PROFILE")]
|
2015-09-16 12:10:43 +00:00
|
|
|
|
public static void StopProfiler(bool savesnapshot)
|
|
|
|
|
{
|
|
|
|
|
#if PROFILE
|
|
|
|
|
if(PerformanceProfiler.IsActive)
|
|
|
|
|
{
|
|
|
|
|
PerformanceProfiler.Stop();
|
|
|
|
|
if(savesnapshot) PerformanceProfiler.EndSave();
|
|
|
|
|
else PerformanceProfiler.EndDrop();
|
|
|
|
|
|
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, "Profiler Stopped...");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, "Unable to stop the Profiler...");
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
WriteLine(DebugMessageType.SPECIAL, "Unable to stop the Profiler: incorrect build configuration selected!");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2016-04-11 23:05:16 +00:00
|
|
|
|
private void AddMessage(DebugMessageType type, string text, bool scroll, bool append)
|
2014-11-13 09:43:39 +00:00
|
|
|
|
{
|
|
|
|
|
text = textheaders[type] + text;
|
2016-04-22 13:28:23 +00:00
|
|
|
|
if(append)
|
|
|
|
|
{
|
|
|
|
|
console.SelectionStart = console.TextLength;
|
|
|
|
|
console.SelectionColor = textcolors[type];
|
|
|
|
|
console.AppendText(text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
console.SuspendLayout();
|
|
|
|
|
console.Text = text;
|
|
|
|
|
console.SelectAll();
|
|
|
|
|
console.SelectionColor = textcolors[type];
|
|
|
|
|
console.Select(0, 0);
|
|
|
|
|
console.ResumeLayout();
|
|
|
|
|
}
|
2014-11-13 09:43:39 +00:00
|
|
|
|
if(scroll && autoscroll.Checked) console.ScrollToCaret();
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2014-11-13 09:43:39 +00:00
|
|
|
|
private void UpdateFilters(ToolStripMenuItem item)
|
|
|
|
|
{
|
|
|
|
|
DebugMessageType flag = (DebugMessageType)(int)item.Tag;
|
|
|
|
|
if(item.Checked)
|
|
|
|
|
{
|
|
|
|
|
filters |= flag;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
filters &= ~flag;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-25 22:58:42 +00:00
|
|
|
|
[Conditional("DEBUG")]
|
2014-11-13 09:43:39 +00:00
|
|
|
|
private void UpdateMessages()
|
|
|
|
|
{
|
|
|
|
|
console.Clear();
|
|
|
|
|
|
|
|
|
|
console.SuspendLayout();
|
2015-12-28 15:01:53 +00:00
|
|
|
|
foreach(KeyValuePair<DebugMessageType, string> pair in messages)
|
2014-11-13 09:43:39 +00:00
|
|
|
|
{
|
|
|
|
|
if((filters & pair.Key) == pair.Key && CheckTextFilter(pair.Value, searchbox.Text))
|
|
|
|
|
{
|
2016-04-11 23:05:16 +00:00
|
|
|
|
AddMessage(pair.Key, pair.Value, false, true);
|
2014-11-13 09:43:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.ResumeLayout();
|
|
|
|
|
console.ScrollToCaret();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Should we display this message?
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private static bool CheckTextFilter(string text, string filter)
|
2014-11-13 09:43:39 +00:00
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(string.IsNullOrEmpty(filter) || filter.Length < 3) return true;
|
2014-11-13 09:43:39 +00:00
|
|
|
|
return text.ToUpperInvariant().Contains(filter.ToUpperInvariant());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Events
|
|
|
|
|
|
|
|
|
|
private void clearall_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void filters_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
UpdateFilters(sender as ToolStripMenuItem);
|
|
|
|
|
UpdateMessages();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void wordwrap_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
console.WordWrap = wordwrap.Checked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Search events
|
|
|
|
|
|
|
|
|
|
private void searchclear_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
searchbox.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void searchbox_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if(string.IsNullOrEmpty(searchbox.Text) || searchbox.Text.Length > 2) UpdateMessages();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|