Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Louis <savagesoftware@gmail.com>2017-07-06 22:38:48 +0300
committerDominique Louis <savagesoftware@gmail.com>2017-07-07 19:18:55 +0300
commita0e25ba4c99303143365f3ebcfc1ba194f4b96ab (patch)
treedfd6daf26fccdddcab1a8ce283e7cb08f4ed9236 /Xamarin.PropertyEditing.Mac/Controls
parent3393680c6b4aceac7d7b7b7d4d36f91d225e3a9e (diff)
Make UnfocusableTextView an UnfocusableTextField to appease the layering gods.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs16
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs8
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs4
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs9
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextField.cs (renamed from Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextView.cs)9
5 files changed, 24 insertions, 22 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
index a8a6b0a..d21b2d1 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
@@ -11,13 +11,13 @@ namespace Xamarin.PropertyEditing.Mac
internal abstract class BaseRectangleEditorControl<T> : PropertyEditorControl
where T : struct
{
- protected UnfocusableTextView XLabel { get; set; }
+ protected UnfocusableTextField XLabel { get; set; }
protected NSTextField XEditor { get; set; }
- protected UnfocusableTextView YLabel { get; set; }
+ protected UnfocusableTextField YLabel { get; set; }
protected NSTextField YEditor { get; set; }
- protected UnfocusableTextView WidthLabel { get; set; }
+ protected UnfocusableTextField WidthLabel { get; set; }
protected NSTextField WidthEditor { get; set; }
- protected UnfocusableTextView HeightLabel { get; set; }
+ protected UnfocusableTextField HeightLabel { get; set; }
protected NSTextField HeightEditor { get; set; }
public override NSView FirstKeyView => XEditor;
@@ -30,28 +30,28 @@ namespace Xamarin.PropertyEditing.Mac
public BaseRectangleEditorControl ()
{
- XLabel = new UnfocusableTextView ();
+ XLabel = new UnfocusableTextField ();
XEditor = new NSTextField ();
XEditor.BackgroundColor = NSColor.Clear;
XEditor.StringValue = string.Empty;
XEditor.Activated += OnInputUpdated;
XEditor.EditingEnded += OnInputUpdated;
- YLabel = new UnfocusableTextView ();
+ YLabel = new UnfocusableTextField ();
YEditor = new NSTextField ();
YEditor.BackgroundColor = NSColor.Clear;
YEditor.StringValue = string.Empty;
YEditor.Activated += OnInputUpdated;
YEditor.EditingEnded += OnInputUpdated;
- WidthLabel = new UnfocusableTextView ();
+ WidthLabel = new UnfocusableTextField ();
WidthEditor = new NSTextField ();
WidthEditor.BackgroundColor = NSColor.Clear;
WidthEditor.StringValue = string.Empty;
WidthEditor.Activated += OnInputUpdated;
WidthEditor.EditingEnded += OnInputUpdated;
- HeightLabel = new UnfocusableTextView ();
+ HeightLabel = new UnfocusableTextField ();
HeightEditor = new NSTextField ();
HeightEditor.BackgroundColor = NSColor.Clear;
HeightEditor.StringValue = string.Empty;
diff --git a/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs
index e9d9891..3dc9b58 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs
@@ -10,22 +10,22 @@ namespace Xamarin.PropertyEditing.Mac
{
// TODO localize
XLabel.Frame = new CGRect (0, -5, 25, 20);
- XLabel.Value = "X:";
+ XLabel.StringValue = "X:";
XEditor.Frame = new CGRect (25, 0, 50, 20);
YLabel.Frame = new CGRect (85, -5, 25, 20);
- YLabel.Value = "Y:";
+ YLabel.StringValue = "Y:";
YEditor.Frame = new CGRect (105, 0, 50, 20);
WidthLabel.Frame = new CGRect (160, -5, 45, 20);
- WidthLabel.Value = "Width:";
+ WidthLabel.StringValue = "Width:";
WidthEditor.Frame = new CGRect (205, 0, 50, 20);
HeightLabel.Frame = new CGRect (260, -5, 45, 20);
- HeightLabel.Value = "Height:";
+ HeightLabel.StringValue = "Height:";
HeightEditor.Frame = new CGRect (305, 0, 50, 20);
}
diff --git a/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs
index 6d9e7af..b38e385 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs
@@ -24,7 +24,7 @@ namespace Xamarin.PropertyEditing.Mac
public PointEditorControl ()
{
- var xLabel = new UnfocusableTextView (new CGRect (0, -5, 25, 20), "X:");
+ var xLabel = new UnfocusableTextField (new CGRect (0, -5, 25, 20), "X:");
XEditor = new NSTextField (new CGRect (25, 0, 50, 20));
XEditor.BackgroundColor = NSColor.Clear;
@@ -33,7 +33,7 @@ namespace Xamarin.PropertyEditing.Mac
ViewModel.Value = new CGPoint (XEditor.IntValue, YEditor.IntValue);
};
- var yLabel = new UnfocusableTextView (new CGRect (85, -5, 25, 20), "Y:");
+ var yLabel = new UnfocusableTextField (new CGRect (85, -5, 25, 20), "Y:");
YEditor = new NSTextField (new CGRect (110, 0, 50, 20));
YEditor.BackgroundColor = NSColor.Clear;
diff --git a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs
index 3970ee0..781c31e 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs
@@ -11,10 +11,11 @@ namespace Xamarin.PropertyEditing.Mac
{
public StringEditorControl ()
{
- StringEditor = new NSTextField (new CGRect (0, 0, 240, 20));
- StringEditor.TranslatesAutoresizingMaskIntoConstraints = false;
- StringEditor.BackgroundColor = NSColor.Clear;
- StringEditor.StringValue = string.Empty;
+ StringEditor = new NSTextField {
+ TranslatesAutoresizingMaskIntoConstraints = false,
+ BackgroundColor = NSColor.Clear,
+ StringValue = string.Empty,
+ };
// update the value on keypress
StringEditor.Changed += (sender, e) => {
diff --git a/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextView.cs b/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextField.cs
index 9dc19e3..71d531e 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextView.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextField.cs
@@ -4,21 +4,22 @@ using CoreGraphics;
namespace Xamarin.PropertyEditing.Mac
{
- class UnfocusableTextView : NSTextView
+ class UnfocusableTextField : NSTextField
{
- public UnfocusableTextView () : base ()
+ public UnfocusableTextField () : base ()
{
SetDefaultProperties ();
}
- public UnfocusableTextView (CGRect frameRect, string text) : base (frameRect)
+ public UnfocusableTextField (CGRect frameRect, string text) : base (frameRect)
{
- Value = text;
+ StringValue = text;
SetDefaultProperties ();
}
void SetDefaultProperties ()
{
+ Bordered = false;
Editable = false;
Selectable = false;
}