From 56c299b6d981979628ffd31ab4ea904ac5c4996f Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Tue, 22 Feb 2022 18:14:26 +0100 Subject: Moves ProxyResponder button to a new class --- .../Controls/Custom/FocusableBooleanButton.cs | 22 ------------------ .../Controls/Custom/ProxyResponderButton.cs | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs index bf43bb5..8548985 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs @@ -3,28 +3,6 @@ using AppKit; namespace Xamarin.PropertyEditing.Mac { - internal class ProxyResponderButton : NSButton - { - public RowProxyResponder ProxyResponder { get; set; } - - public override void KeyDown (NSEvent theEvent) - { - switch (theEvent.KeyCode) { - case (int)NSKey.Tab: - if (ProxyResponder != null) { - if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { - ProxyResponder.PreviousResponder (); - } else { - ProxyResponder.NextResponder (); - } - return; - } - break; - } - base.KeyDown (theEvent); - } - } - internal class FocusableBooleanButton : ProxyResponderButton { public override bool CanBecomeKeyView { get { return Enabled; } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs new file mode 100644 index 0000000..8182fbb --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs @@ -0,0 +1,26 @@ +using AppKit; + +namespace Xamarin.PropertyEditing.Mac +{ + internal class ProxyResponderButton : NSButton + { + public RowProxyResponder ProxyResponder { get; set; } + + public override void KeyDown (NSEvent theEvent) + { + switch (theEvent.KeyCode) { + case (int)NSKey.Tab: + if (ProxyResponder != null) { + if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { + ProxyResponder.PreviousResponder (); + } else { + ProxyResponder.NextResponder (); + } + return; + } + break; + } + base.KeyDown (theEvent); + } + } +} -- cgit v1.2.3