From 5bbe8d577617b6f6f0eaac3f06aebfba1a4553b0 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Fri, 25 Feb 2022 06:15:16 +0100 Subject: Renames RowProxyResponder to ProxyResponder --- .../Controls/BasePathEditorControl.cs | 6 ++-- .../Controls/BasePointEditorControl.cs | 4 +-- .../Controls/BaseRectangleEditorControl.cs | 4 +-- .../Controls/BooleanEditorControl.cs | 2 +- .../Controls/BrushEditorControl.cs | 2 +- .../Controls/CharEditorControl.cs | 2 +- .../Controls/CollectionInlineEditorControl.cs | 2 +- .../Controls/CombinablePropertyEditor.cs | 6 ++-- .../Controls/Custom/FocusableComboBox.cs | 2 +- .../Controls/Custom/FocusablePopupButton.cs | 2 +- .../Controls/Custom/NumericSpinEditor.cs | 2 +- .../Controls/Custom/NumericTextField.cs | 4 +-- .../Controls/Custom/ProxyResponderButton.cs | 2 +- .../Controls/EntryPropertyEditor.cs | 39 +++++++++++----------- .../Controls/NumericEditorControl.cs | 6 ++-- .../Controls/PredefinedValuesEditor.cs | 8 ++--- .../Controls/ProxyRowResponder.cs | 4 +-- .../Controls/RatioEditorControl.cs | 2 +- .../Controls/StringEditorControl.cs | 2 +- .../Controls/TimeSpanEditorControl.cs | 2 +- .../Controls/TypeEditorControl.cs | 2 +- 21 files changed, 53 insertions(+), 52 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs index 12235ca..f7f0d39 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs @@ -23,9 +23,9 @@ namespace Xamarin.PropertyEditing.Mac private readonly NSObject[] objects; public override NSObject[] AccessibilityChildren { get => this.objects; } - private readonly TextNextResponderDelegate textNextResponderDelegate; + private readonly DelegatedRowTextFieldDelegate textNextResponderDelegate; - class BasePathEditorDelegate : TextNextResponderDelegate + class BasePathEditorDelegate : DelegatedRowTextFieldDelegate { WeakReference> weakView; @@ -49,7 +49,7 @@ namespace Xamarin.PropertyEditing.Mac this.textNextResponderDelegate = new BasePathEditorDelegate (this) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; this.currentTextField.Delegate = this.textNextResponderDelegate; AddSubview (this.currentTextField); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs index 7300ed1..7193566 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs @@ -28,7 +28,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - XEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); + XEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -40,7 +40,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - YEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + YEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); YEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs index 8e426ee..68406a1 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs @@ -33,7 +33,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - XEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); + XEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -64,7 +64,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - HeightEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + HeightEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); HeightEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs index a6196f2..b6c1ca5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs @@ -13,7 +13,7 @@ namespace Xamarin.PropertyEditing.Mac { BooleanEditor = new FocusableBooleanButton () { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; BooleanEditor.Title = string.Empty; diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index c8413ec..799a91d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -56,7 +56,7 @@ namespace Xamarin.PropertyEditing.Mac ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; this.popupButtonList = new NSMenu (); diff --git a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs index f6b22ff..e1eb1b6 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs @@ -15,7 +15,7 @@ namespace Xamarin.PropertyEditing.Mac { var charDelegate = new CharDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; return charDelegate; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs index 0c839a3..0bdcabb 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs @@ -24,7 +24,7 @@ namespace Xamarin.PropertyEditing.Mac Title = Properties.Resources.CollectionEditButton, BezelStyle = NSBezelStyle.Rounded, AccessibilityEnabled = true, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView), + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView), AccessibilityHelp = Properties.Resources.AccessibilityCollectionHelp }; diff --git a/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs index 7aeaaf3..c2ce8a5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs @@ -92,10 +92,10 @@ namespace Xamarin.PropertyEditing.Mac if (combinableList.Count > 0) { if (firstButton == lastButton) { - firstButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + firstButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); } else { - firstButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); - lastButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + firstButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); + lastButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs index af6bb82..b1f5eaa 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs @@ -5,7 +5,7 @@ namespace Xamarin.PropertyEditing.Mac { internal class FocusableComboBox : NSComboBox { - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public override void KeyDown (NSEvent theEvent) { diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs index b436445..7d1bc6c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs @@ -8,7 +8,7 @@ namespace Xamarin.PropertyEditing.Mac { public override bool CanBecomeKeyView { get { return Enabled; } } - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public FocusablePopUpButton () { diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs index d7d5253..9da66b9 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs @@ -172,7 +172,7 @@ namespace Xamarin.PropertyEditing.Mac set { this.numericEditor.AccessibilityTitle = value; } } - public RowProxyResponder ProxyResponder + public ProxyResponder ProxyResponder { get => this.numericEditor.ProxyResponder; set => this.numericEditor.ProxyResponder = value; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs index 75e0a08..1043286 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs @@ -51,7 +51,7 @@ namespace Xamarin.PropertyEditing.Mac Delegate = keyUpDownDelegate; } - public RowProxyResponder ProxyResponder + public ProxyResponder ProxyResponder { get { if (Delegate is KeyUpDownDelegate keydown) { @@ -172,7 +172,7 @@ namespace Xamarin.PropertyEditing.Mac } } - internal class KeyUpDownDelegate : TextNextResponderDelegate + internal class KeyUpDownDelegate : DelegatedRowTextFieldDelegate { public event EventHandler KeyArrowUp; public event EventHandler KeyArrowDown; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs index 8182fbb..a37479f 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs @@ -4,7 +4,7 @@ namespace Xamarin.PropertyEditing.Mac { internal class ProxyResponderButton : NSButton { - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public override void KeyDown (NSEvent theEvent) { diff --git a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs index 1017d99..d6d7e1d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs @@ -6,26 +6,27 @@ using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { - class TextNextResponderDelegate : NSTextFieldDelegate + class DelegatedRowTextFieldDelegate : NSTextFieldDelegate { - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector) { - switch (commandSelector.Name) { - case "insertTab:": - if (ProxyResponder?.NextResponder () ?? false) - { - return true; - } - break; - case "insertBacktab:": - if (ProxyResponder?.PreviousResponder () ?? false) - { - return true; + if (ProxyResponder != null) + { + switch (commandSelector.Name) { + case "insertTab:": + if (ProxyResponder.NextResponder ()) { + return true; + } + break; + case "insertBacktab:": + if (ProxyResponder.PreviousResponder ()) { + return true; + } + break; } - break; - } + } return false; } } @@ -44,9 +45,9 @@ namespace Xamarin.PropertyEditing.Mac }; AddSubview (Entry); - Entry.Delegate = new TextNextResponderDelegate () + Entry.Delegate = new DelegatedRowTextFieldDelegate () { - ProxyResponder = new RowProxyResponder(this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder(this, ProxyRowType.SingleView) }; RightEdgeConstraint = NSLayoutConstraint.Create (Entry, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, 0); @@ -93,7 +94,7 @@ namespace Xamarin.PropertyEditing.Mac { var propertyEditorDelegate = new EntryPropertyEditorDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; return propertyEditorDelegate; } @@ -105,7 +106,7 @@ namespace Xamarin.PropertyEditing.Mac } internal class EntryPropertyEditorDelegate - : TextNextResponderDelegate + : DelegatedRowTextFieldDelegate { public EntryPropertyEditorDelegate (PropertyViewModel viewModel) { diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index 4687e0c..3a00b28 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -18,7 +18,7 @@ namespace Xamarin.PropertyEditing.Mac NumericEditor = new NumericSpinEditor (hostResources) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; NumericEditor.ValueChanged += OnValueChanged; @@ -132,8 +132,8 @@ namespace Xamarin.PropertyEditing.Mac TranslatesAutoresizingMaskIntoConstraints = false, }; - this.NumericEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); - this.inputModePopup.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + this.NumericEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); + this.inputModePopup.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); this.inputModePopup.Activated += (o, e) => { var popupButton = o as NSPopUpButton; diff --git a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs index ae3d307..77f6edb 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs @@ -113,9 +113,9 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; - this.popupButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.popupButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.popupButtonList = new NSMenu (); this.popupButton.Menu = this.popupButtonList; this.popupButton.Activated += PopupButton_Activated; @@ -156,13 +156,13 @@ namespace Xamarin.PropertyEditing.Mac LineBreakMode = NSLineBreakMode.TruncatingTail, UsesSingleLineMode = true, }, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView), + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView), ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, }; - this.comboBox.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.comboBox.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.comboBox.SelectionChanged += ComboBox_SelectionChanged; AddSubview (this.comboBox); diff --git a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs index ca613d1..406bde4 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs @@ -9,13 +9,13 @@ namespace Xamarin.PropertyEditing.Mac LastView } - internal class RowProxyResponder + internal class ProxyResponder { protected WeakReference editorControl; readonly ProxyRowType rowType; - public RowProxyResponder (PropertyEditorControl editorControl, ProxyRowType rowType) + public ProxyResponder (PropertyEditorControl editorControl, ProxyRowType rowType) { this.rowType = rowType; this.editorControl = new WeakReference (editorControl); diff --git a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs index 872cce0..a5c8fdc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs @@ -16,7 +16,7 @@ namespace Xamarin.PropertyEditing.Mac base.TranslatesAutoresizingMaskIntoConstraints = false; this.ratioEditor = new RatioEditor (hostResources); - this.ratioEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.ratioEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.ratioEditor.SetFormatter (null); // update the value on keypress diff --git a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs index 80ff123..01a4af4 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs @@ -45,7 +45,7 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false }; - this.inputModePopup.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.inputModePopup.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.inputModePopup.Activated += (o, e) => { var popupButton = o as NSPopUpButton; ViewModel.InputMode = this.viewModelInputModes.FirstOrDefault (im => im.Identifier == popupButton.Title); diff --git a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs index 4755e15..d6c6361 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs @@ -14,7 +14,7 @@ namespace Xamarin.PropertyEditing.Mac protected override EntryPropertyEditorDelegate CreateDelegate (PropertyViewModel viewModel) { return new TimeSpanDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs index 381244a..0baee02 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs @@ -22,7 +22,7 @@ namespace Xamarin.PropertyEditing.Mac this.selectType = new FocusableButton { BezelStyle = NSBezelStyle.Rounded, Title = Properties.Resources.Select, - ProxyResponder = new RowProxyResponder(this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder(this, ProxyRowType.SingleView) }; this.selectType.Activated += OnSelectPressed; -- cgit v1.2.3