diff options
author | Jose Medrano <josmed@microsoft.com> | 2022-02-22 20:14:26 +0300 |
---|---|---|
committer | vs-mobiletools-engineering-service2 <valco@microsoft.com> | 2022-03-01 18:01:15 +0300 |
commit | 56c299b6d981979628ffd31ab4ea904ac5c4996f (patch) | |
tree | 5da538aab595bd1a8ecfc2707ddb08557ce2df83 | |
parent | bb6d3c9ed0ca2708021157f0de1cef73703abc1b (diff) |
Moves ProxyResponder button to a new class
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs | 22 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs | 26 |
2 files changed, 26 insertions, 22 deletions
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); + } + } +} |