diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-04-09 04:51:37 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-04-09 04:51:37 +0200 |
| commit | 2b6d20f81ec25698e39f2b1efac2574340aafcdd (patch) | |
| tree | 821a44ace4d045f77733402bb1867b47b677c396 /Samples/DebugLogAnalyzer | |
| parent | 1a2d73613006acc5d519bac9b86d8c0c79ae9d46 (diff) | |
TG recursive lock check, IObsList clear evt, sample Editor xml syntax, command IList, CommandBase class
Diffstat (limited to 'Samples/DebugLogAnalyzer')
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DebugInterface.cs | 6 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs | 31 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/Editor.cs | 44 |
3 files changed, 29 insertions, 52 deletions
diff --git a/Samples/DebugLogAnalyzer/src/DebugInterface.cs b/Samples/DebugLogAnalyzer/src/DebugInterface.cs index c0615321..8300abb2 100644 --- a/Samples/DebugLogAnalyzer/src/DebugInterface.cs +++ b/Samples/DebugLogAnalyzer/src/DebugInterface.cs @@ -41,11 +41,11 @@ namespace Crow } catch (System.Exception ex) { - if (Monitor.IsEntered(LayoutMutex)) + while (Monitor.IsEntered(LayoutMutex)) Monitor.Exit (LayoutMutex); - if (Monitor.IsEntered(UpdateMutex)) + while (Monitor.IsEntered(UpdateMutex)) Monitor.Exit (UpdateMutex); - if (Monitor.IsEntered(ClippingMutex)) + while (Monitor.IsEntered(ClippingMutex)) Monitor.Exit (ClippingMutex); delSetCurrentException (ex); ClearInterface(); diff --git a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs index 3f331cf2..ee30d5ed 100644 --- a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs +++ b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs @@ -216,9 +216,16 @@ namespace Crow public override void onMouseMove(object sender, MouseMoveEventArgs e) { - if (initialized) { - Point m = ScreenPointToLocal (e.Position); - delMouseMove (m.X, m.Y); + if (initialized) { + try + { + Point m = ScreenPointToLocal (e.Position); + delMouseMove (m.X, m.Y); + } + catch (System.Exception ex) + { + Console.WriteLine($"[Error][DebugIFace mouse move]{ex}"); + } e.Handled = true; } base.onMouseMove(sender, e); @@ -226,7 +233,14 @@ namespace Crow public override void onMouseDown(object sender, MouseButtonEventArgs e) { if (initialized) { - delMouseDown (e.Button); + try + { + delMouseDown (e.Button); + } + catch (System.Exception ex) + { + Console.WriteLine($"[Error][DebugIFace mouse down]{ex}"); + } e.Handled=true; } base.onMouseDown (sender, e); @@ -234,7 +248,14 @@ namespace Crow public override void onMouseUp(object sender, MouseButtonEventArgs e) { if (initialized) { - delMouseUp (e.Button); + try + { + delMouseUp (e.Button); + } + catch (System.Exception ex) + { + Console.WriteLine($"[Error][DebugIFace mouse up]{ex}"); + } e.Handled=true; } base.onMouseUp (sender, e); diff --git a/Samples/DebugLogAnalyzer/src/Editor.cs b/Samples/DebugLogAnalyzer/src/Editor.cs deleted file mode 100644 index 315a5a9d..00000000 --- a/Samples/DebugLogAnalyzer/src/Editor.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2013-2019 Bruyère Jean-Philippe <jp_bruyere@hotmail.com> -// -// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) - -using System; -using Glfw; -using Crow.Text; - -namespace Crow -{ - public class Editor : TextBox { - public override void onKeyDown(object sender, KeyEventArgs e) - { - TextSpan selection = Selection; - if (e.Key == Key.Tab && !selection.IsEmpty) { - int lineStart = lines.GetLocation (selection.Start).Line; - int lineEnd = lines.GetLocation (selection.End).Line; - - if (IFace.Shift) { - for (int l = lineStart; l <= lineEnd; l++) { - if (Text[lines[l].Start] == '\t') - update (new TextChange (lines[l].Start, 1, "")); - else if (Char.IsWhiteSpace (Text[lines[l].Start])) { - int i = 1; - while (i < lines[l].Length && i < Interface.TAB_SIZE && Char.IsWhiteSpace (Text[i])) - i++; - update (new TextChange (lines[l].Start, i, "")); - } - } - - }else{ - for (int l = lineStart; l <= lineEnd; l++) - update (new TextChange (lines[l].Start, 0, "\t")); - } - - selectionStart = new CharLocation (lineStart, 0); - CurrentLoc = new CharLocation (lineEnd, lines[lineEnd].Length); - - return; - } - base.onKeyDown(sender, e); - } - } -}
\ No newline at end of file |