diff options
author | Jose Medrano <josmed@microsoft.com> | 2022-02-16 20:24:14 +0300 |
---|---|---|
committer | vs-mobiletools-engineering-service2 <valco@microsoft.com> | 2022-03-01 18:01:15 +0300 |
commit | 45147ddbe52f859ed2f7d3f28172ac6eea33bc7b (patch) | |
tree | 5433872f534abff36a6c368e956439d1fea6c8fd | |
parent | c90a281fa9a2e4131c851cc772f10c9c31a6092a (diff) |
Makes FocusablePopupButton a ProxyResponder class
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs index 988dc2b..7cdfcfc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs @@ -8,11 +8,29 @@ namespace Xamarin.PropertyEditing.Mac { public override bool CanBecomeKeyView { get { return Enabled; } } + public ProxyRowResponder ResponderProxy { get; set; } + public FocusablePopUpButton () { Cell.LineBreakMode = NSLineBreakMode.TruncatingMiddle; } + public override void KeyDown (NSEvent theEvent) + { + switch (theEvent.KeyCode) { + case (int)NSKey.Tab: + if (ResponderProxy != null) { + if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { + ResponderProxy.PreviousResponder (); + } else { + ResponderProxy.NextResponder (); + } + } + return; + } + base.KeyDown (theEvent); + } + public override bool BecomeFirstResponder () { var willBecomeFirstResponder = base.BecomeFirstResponder (); |