diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs new file mode 100644 index 0000000..401c2ce --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs @@ -0,0 +1,32 @@ +using Foundation; +using AppKit; + +namespace Xamarin.PropertyEditing.Mac +{ + class FocusableComboBox : NSComboBox + { + public override bool ShouldBeginEditing (NSText textObject) + { + textObject.Delegate = new FocusableComboBoxDelegate (); + return false; + } + + public override void DidBeginEditing (NSNotification notification) + { + base.DidBeginEditing (notification); + } + + class FocusableComboBoxDelegate : NSTextDelegate + { + public override bool TextShouldEndEditing (NSText textObject) + { + return false; + } + + public override bool TextShouldBeginEditing (NSText textObject) + { + return false; + } + } + } +}
\ No newline at end of file |