diff options
author | Jose Medrano <jose.medrano@microsoft.com> | 2019-01-10 18:04:43 +0300 |
---|---|---|
committer | Jose Medrano <jose.medrano@microsoft.com> | 2019-01-11 12:09:59 +0300 |
commit | 11e7ed7be84ee38d3cc2aa17592e83cca0fe7721 (patch) | |
tree | ce98c15fbcf6c5cd1272891ab4a7f084f1fdc77a /main/src/addins/MonoDevelop.HexEditor | |
parent | 3cc0a0901f8c703f26c4e0578c2bdc4cb378f607 (diff) |
Fixes enable HexEditor signals when is ReadOnly
Sensitive property disables all signals, focus and accessibility from the Widget
Instead of this we avoid only the insertion of characters
Diffstat (limited to 'main/src/addins/MonoDevelop.HexEditor')
3 files changed, 7 insertions, 3 deletions
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs index bdea66542d..4689c2a2c9 100644 --- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs +++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs @@ -99,6 +99,8 @@ namespace Mono.MHex } } + public bool IsReadOnly { get; set; } + public HexEditor () { BackgroundColor = Color.FromBytes (0, 0, 0); diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/SimpleEditMode.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/SimpleEditMode.cs index 6b16f35e5b..29db8e9ab0 100644 --- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/SimpleEditMode.cs +++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/SimpleEditMode.cs @@ -184,8 +184,10 @@ namespace Mono.MHex keyBindings [keyCode] (HexEditorData); return; } - - InsertCharacter (unicodeChar); + + if (!Editor.IsReadOnly) { + InsertCharacter (unicodeChar); + } } void InsertCharacter (uint unicodeChar) diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs index 7897809fdd..40c0f444db 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs @@ -130,7 +130,7 @@ namespace MonoDevelop.HexEditor } hexEditor.HexEditorData.Buffer = buffer; - hexEditor.Editor.Sensitive = CanEdit (val); + hexEditor.Editor.IsReadOnly = !CanEdit (val); var xwtScrollView = new Xwt.ScrollView (hexEditor); var scrollWidget = (Widget) Xwt.Toolkit.CurrentEngine.GetNativeWidget (xwtScrollView); |