diff options
author | Dominique Louis <savagesoftware@gmail.com> | 2017-07-14 13:03:48 +0300 |
---|---|---|
committer | Dominique Louis <savagesoftware@gmail.com> | 2017-07-14 13:03:48 +0300 |
commit | ed9838efa770c933301ad628f6cc3b95686348fa (patch) | |
tree | 5d189133312b12ef724678c6e6eb904234892b09 /Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs | |
parent | 38f8db47f3383736a2085277e17c55d852f84bcf (diff) |
Added .NET Point, Size and Rectangle editors.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs new file mode 100644 index 0000000..5bd51ec --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs @@ -0,0 +1,33 @@ +using System; +using System.Drawing; +using CoreGraphics; + +namespace Xamarin.PropertyEditing.Mac +{ + internal class PointEditorControl : BasePointEditorControl<Point> + { + public PointEditorControl () + { + XLabel.Frame = new CGRect (0, 0, 25, 24); + XLabel.StringValue = "X:"; // TODO Localise + + XEditor.Frame = new CGRect (25, 0, 50, 20); + + YLabel.Frame = new CGRect (85, 0, 25, 24); + YLabel.StringValue = "Y:"; // TODO Localise + + YEditor.Frame = new CGRect (110, 0, 50, 20); + } + + protected override void UpdateValue () + { + XEditor.StringValue = ViewModel.Value.X.ToString (); + YEditor.StringValue = ViewModel.Value.Y.ToString (); + } + + protected override void OnInputUpdated (object sender, EventArgs e) + { + ViewModel.Value = new Point (XEditor.IntValue, YEditor.IntValue); + } + } +} |