From 037dc4ff7e58e980d2bebd04b111874c07c898cc Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 8 Jun 2018 16:20:57 -0700 Subject: [PATCH 1/5] Simplify --- DesignTools/PublicPropertyEditor.cs | 86 +++++++++++------------------ 1 file changed, 32 insertions(+), 54 deletions(-) diff --git a/DesignTools/PublicPropertyEditor.cs b/DesignTools/PublicPropertyEditor.cs index 78b5fbe39..cca07241e 100644 --- a/DesignTools/PublicPropertyEditor.cs +++ b/DesignTools/PublicPropertyEditor.cs @@ -124,9 +124,16 @@ namespace MatterHackers.MatterControl.DesignTools return mainContainer; } - private static FlowLayoutWidget CreateSettingsRow(EditableProperty property) + private static FlowLayoutWidget CreateSettingsRow(EditableProperty property, GuiWidget widget = null) { - return CreateSettingsRow(property.DisplayName.Localize(), property.Description.Localize()); + var row = CreateSettingsRow(property.DisplayName.Localize(), property.Description.Localize()); + + if (widget != null) + { + row.AddChild(widget); + } + + return row; } private static FlowLayoutWidget CreateSettingsRow(string labelText, string toolTipText = null) @@ -227,8 +234,6 @@ namespace MatterHackers.MatterControl.DesignTools // create a double editor if (property.Value is double doubleValue) { - rowContainer = CreateSettingsRow(property); - var field = new DoubleField(); field.Initialize(0); field.DoubleValue = doubleValue; @@ -239,13 +244,10 @@ namespace MatterHackers.MatterControl.DesignTools propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, field.Content); } else if (property.Value is Vector2 vector2) { - rowContainer = CreateSettingsRow(property); - var field = new Vector2Field(); field.Initialize(0); field.Vector2 = vector2; @@ -256,13 +258,10 @@ namespace MatterHackers.MatterControl.DesignTools propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, field.Content); } else if (property.Value is Vector3 vector3) { - rowContainer = CreateSettingsRow(property); - var field = new Vector3Field(); field.Initialize(0); field.Vector3 = vector3; @@ -273,24 +272,19 @@ namespace MatterHackers.MatterControl.DesignTools propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, field.Content); } else if (property.Value is DirectionVector directionVector) { bool simpleEdit = true; if (simpleEdit) { - rowContainer = CreateSettingsRow(property); - var dropDownList = new DropDownList("Name".Localize(), theme.Colors.PrimaryTextColor, Direction.Down, pointSize: theme.DefaultFontSize) { BorderColor = theme.GetBorderColor(75) }; - var orderedItems = new string[] { "Right", "Back", "Up" }; - - foreach (var orderItem in orderedItems) + foreach (var orderItem in new string[] { "Right", "Back", "Up" }) { MenuItem newItem = dropDownList.AddItem(orderItem); @@ -316,13 +310,12 @@ namespace MatterHackers.MatterControl.DesignTools } dropDownList.SelectedLabel = "Right"; - rowContainer.AddChild(dropDownList); - editControlsContainer.AddChild(rowContainer); + + rowContainer = CreateSettingsRow(property, dropDownList); + } else // edit the vector { - rowContainer = CreateSettingsRow(property); - var field = new Vector3Field(); field.Initialize(0); field.Vector3 = directionVector.Normal; @@ -333,42 +326,35 @@ namespace MatterHackers.MatterControl.DesignTools propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, field.Content); } } else if (property.Value is DirectionAxis directionAxis) { bool simpleAxis = true; - if (simpleAxis) { // the direction axis // the distance from the center of the part // create a double editor - rowContainer = CreateSettingsRow(property); - var field = new DoubleField(); field.Initialize(0); field.DoubleValue = directionAxis.Origin.X - property.Item.Children.First().GetAxisAlignedBoundingBox().Center.X; field.ValueChanged += (s, e) => { property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] + { + new DirectionAxis() { - new DirectionAxis() - { - Normal = Vector3.UnitZ, Origin = property.Item.Children.First().GetAxisAlignedBoundingBox().Center + new Vector3(field.DoubleValue, 0, 0) - } - }); + Normal = Vector3.UnitZ, Origin = property.Item.Children.First().GetAxisAlignedBoundingBox().Center + new Vector3(field.DoubleValue, 0, 0) + } + }); rebuildable?.Rebuild(undoBuffer); propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); - // update tihs when changed - EventHandler< InvalidateArgs> updateData = (s, e) => + EventHandler updateData = (s, e) => { field.DoubleValue = ((DirectionAxis)property.PropertyInfo.GetGetMethod().Invoke(property.Item, null)).Origin.X - property.Item.Children.First().GetAxisAlignedBoundingBox().Center.X; }; @@ -377,6 +363,8 @@ namespace MatterHackers.MatterControl.DesignTools { property.Item.Invalidated -= updateData; }; + + rowContainer = CreateSettingsRow(property, field.Content); } else { @@ -430,13 +418,10 @@ namespace MatterHackers.MatterControl.DesignTools { rowContainer = CreateSettingsColumn(property); rowContainer.AddChild(CreateSelector(childSelector, property.Item, theme)); - editControlsContainer.AddChild(rowContainer); } // create a int editor else if (property.Value is int intValue) { - rowContainer = CreateSettingsRow(property); - var field = new IntField(); field.Initialize(0); field.IntValue = intValue; @@ -447,14 +432,11 @@ namespace MatterHackers.MatterControl.DesignTools propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, field.Content); } // create a bool editor else if (property.Value is bool boolValue) { - rowContainer = CreateSettingsRow(property); - var field = new ToggleboxField(theme); field.Initialize(0); field.Checked = boolValue; @@ -465,13 +447,11 @@ namespace MatterHackers.MatterControl.DesignTools propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(field.Content); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, field.Content); } // create a string editor else if (property.Value is string stringValue) { - rowContainer = CreateSettingsRow(property); var textEditWidget = new MHTextEditWidget(stringValue, pixelWidth: 150 * GuiWidget.DeviceScale) { SelectAllOnFocus = true, @@ -483,13 +463,12 @@ namespace MatterHackers.MatterControl.DesignTools rebuildable?.Rebuild(undoBuffer); propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(textEditWidget); - editControlsContainer.AddChild(rowContainer); + + rowContainer = CreateSettingsRow(property, textEditWidget); } // create a char editor else if (property.Value is char charValue) { - rowContainer = CreateSettingsRow(property); var textEditWidget = new MHTextEditWidget(charValue.ToString(), pixelWidth: 150 * GuiWidget.DeviceScale) { SelectAllOnFocus = true, @@ -509,8 +488,7 @@ namespace MatterHackers.MatterControl.DesignTools rebuildable?.Rebuild(undoBuffer); propertyGridModifier?.UpdateControls(context); }; - rowContainer.AddChild(textEditWidget); - editControlsContainer.AddChild(rowContainer); + rowContainer = CreateSettingsRow(property, textEditWidget); } // create an enum editor else if (property.PropertyType.IsEnum) @@ -518,16 +496,16 @@ namespace MatterHackers.MatterControl.DesignTools rowContainer = CreateEnumEditor(context, rebuildable, property, property.PropertyType, property.Value, property.DisplayName, theme, undoBuffer); - editControlsContainer.AddChild(rowContainer); } // Use known IObject3D editors else if (property.Value is IObject3D object3D && ApplicationController.Instance.GetEditorsForType(property.PropertyType)?.FirstOrDefault() is IObject3DEditor editor) { rowContainer = editor.Create(object3D, view3DWidget, theme); - editControlsContainer.AddChild(rowContainer); } + editControlsContainer.AddChild(rowContainer); + // remember the row name and widget context.editRows.Add(property.PropertyInfo.Name, rowContainer); } From c090928e82f398add44d9bcf3c34b89e2338ed3a Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 8 Jun 2018 16:25:35 -0700 Subject: [PATCH 2/5] Remove unused original editors --- DesignTools/PublicPropertyEditor.cs | 168 ++++++++-------------------- 1 file changed, 49 insertions(+), 119 deletions(-) diff --git a/DesignTools/PublicPropertyEditor.cs b/DesignTools/PublicPropertyEditor.cs index cca07241e..d6976d403 100644 --- a/DesignTools/PublicPropertyEditor.cs +++ b/DesignTools/PublicPropertyEditor.cs @@ -276,143 +276,73 @@ namespace MatterHackers.MatterControl.DesignTools } else if (property.Value is DirectionVector directionVector) { - bool simpleEdit = true; - if (simpleEdit) + var dropDownList = new DropDownList("Name".Localize(), theme.Colors.PrimaryTextColor, Direction.Down, pointSize: theme.DefaultFontSize) { - var dropDownList = new DropDownList("Name".Localize(), theme.Colors.PrimaryTextColor, Direction.Down, pointSize: theme.DefaultFontSize) - { - BorderColor = theme.GetBorderColor(75) - }; + BorderColor = theme.GetBorderColor(75) + }; - foreach (var orderItem in new string[] { "Right", "Back", "Up" }) - { - MenuItem newItem = dropDownList.AddItem(orderItem); + foreach (var orderItem in new string[] { "Right", "Back", "Up" }) + { + MenuItem newItem = dropDownList.AddItem(orderItem); - var localOredrItem = orderItem; - newItem.Selected += (sender, e) => + var localOredrItem = orderItem; + newItem.Selected += (sender, e) => + { + switch (dropDownList.SelectedValue) { - switch (dropDownList.SelectedValue) - { - case "Right": - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = Vector3.UnitX } }); - break; - case "Back": - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = Vector3.UnitY } }); - break; - case "Up": - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = Vector3.UnitZ } }); - break; - } + case "Right": + property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = Vector3.UnitX } }); + break; + case "Back": + property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = Vector3.UnitY } }); + break; + case "Up": + property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = Vector3.UnitZ } }); + break; + } - rebuildable?.Rebuild(undoBuffer); - propertyGridModifier?.UpdateControls(context); - }; - } - - dropDownList.SelectedLabel = "Right"; - - rowContainer = CreateSettingsRow(property, dropDownList); - - } - else // edit the vector - { - var field = new Vector3Field(); - field.Initialize(0); - field.Vector3 = directionVector.Normal; - field.ValueChanged += (s, e) => - { - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionVector() { Normal = field.Vector3 } }); rebuildable?.Rebuild(undoBuffer); propertyGridModifier?.UpdateControls(context); }; - - rowContainer = CreateSettingsRow(property, field.Content); } + + dropDownList.SelectedLabel = "Right"; + + rowContainer = CreateSettingsRow(property, dropDownList); } else if (property.Value is DirectionAxis directionAxis) { - bool simpleAxis = true; - if (simpleAxis) + // the direction axis + // the distance from the center of the part + // create a double editor + var field = new DoubleField(); + field.Initialize(0); + field.DoubleValue = directionAxis.Origin.X - property.Item.Children.First().GetAxisAlignedBoundingBox().Center.X; + field.ValueChanged += (s, e) => { - // the direction axis - // the distance from the center of the part - // create a double editor - var field = new DoubleField(); - field.Initialize(0); - field.DoubleValue = directionAxis.Origin.X - property.Item.Children.First().GetAxisAlignedBoundingBox().Center.X; - field.ValueChanged += (s, e) => + property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] + new DirectionAxis() { - new DirectionAxis() - { - Normal = Vector3.UnitZ, Origin = property.Item.Children.First().GetAxisAlignedBoundingBox().Center + new Vector3(field.DoubleValue, 0, 0) - } - }); - rebuildable?.Rebuild(undoBuffer); - propertyGridModifier?.UpdateControls(context); - }; + Normal = Vector3.UnitZ, Origin = property.Item.Children.First().GetAxisAlignedBoundingBox().Center + new Vector3(field.DoubleValue, 0, 0) + } + }); + rebuildable?.Rebuild(undoBuffer); + propertyGridModifier?.UpdateControls(context); + }; - // update tihs when changed - EventHandler updateData = (s, e) => - { - field.DoubleValue = ((DirectionAxis)property.PropertyInfo.GetGetMethod().Invoke(property.Item, null)).Origin.X - property.Item.Children.First().GetAxisAlignedBoundingBox().Center.X; - }; - property.Item.Invalidated += updateData; - editControlsContainer.Closed += (s, e) => - { - property.Item.Invalidated -= updateData; - }; - - rowContainer = CreateSettingsRow(property, field.Content); - } - else + // update tihs when changed + EventHandler updateData = (s, e) => { - // add in the position - FlowLayoutWidget originRowContainer = CreateSettingsRow(property); + field.DoubleValue = ((DirectionAxis)property.PropertyInfo.GetGetMethod().Invoke(property.Item, null)).Origin.X - property.Item.Children.First().GetAxisAlignedBoundingBox().Center.X; + }; + property.Item.Invalidated += updateData; + editControlsContainer.Closed += (s, e) => + { + property.Item.Invalidated -= updateData; + }; - var originField = new Vector3Field(); - originField.Initialize(0); - originField.Vector3 = directionAxis.Origin; - - var normalField = new Vector3Field(); - normalField.Initialize(0); - normalField.Vector3 = directionAxis.Normal; - - originField.ValueChanged += (s, e) => - { - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionAxis() { Origin = originField.Vector3, Normal = normalField.Vector3 } }); - rebuildable?.Rebuild(undoBuffer); - propertyGridModifier?.UpdateControls(context); - }; - - originRowContainer.AddChild(originField.Content); - editControlsContainer.AddChild(originRowContainer); - - // add in the direction - FlowLayoutWidget directionRowContainer = CreateSettingsRow(property); - - normalField.ValueChanged += (s, e) => - { - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { new DirectionAxis() { Origin = originField.Vector3, Normal = normalField.Vector3 } }); - rebuildable?.Rebuild(undoBuffer); - propertyGridModifier?.UpdateControls(context); - }; - - directionRowContainer.AddChild(normalField.Content); - editControlsContainer.AddChild(directionRowContainer); - - // update tihs when changed - EventHandler updateData = (s, e) => - { - originField.Vector3 = ((DirectionAxis)property.PropertyInfo.GetGetMethod().Invoke(property.Item, null)).Origin; - }; - property.Item.Invalidated += updateData; - editControlsContainer.Closed += (s, e) => - { - property.Item.Invalidated -= updateData; - }; - } + rowContainer = CreateSettingsRow(property, field.Content); } else if (property.Value is ChildrenSelector childSelector) { From f00638eab480d76875fd49d6bc47091db6790559 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 8 Jun 2018 16:48:50 -0700 Subject: [PATCH 3/5] Use TextField for string content --- DesignTools/PublicPropertyEditor.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/DesignTools/PublicPropertyEditor.cs b/DesignTools/PublicPropertyEditor.cs index d6976d403..a39136f19 100644 --- a/DesignTools/PublicPropertyEditor.cs +++ b/DesignTools/PublicPropertyEditor.cs @@ -382,19 +382,17 @@ namespace MatterHackers.MatterControl.DesignTools // create a string editor else if (property.Value is string stringValue) { - var textEditWidget = new MHTextEditWidget(stringValue, pixelWidth: 150 * GuiWidget.DeviceScale) + var field = new TextField(); + field.Initialize(0); + field.SetValue(stringValue, false); + field.ValueChanged += (s, e) => { - SelectAllOnFocus = true, - VAnchor = VAnchor.Center - }; - textEditWidget.ActualTextEditWidget.EditComplete += (s, e) => - { - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { textEditWidget.Text }); + property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { field.Value }); rebuildable?.Rebuild(undoBuffer); propertyGridModifier?.UpdateControls(context); }; - rowContainer = CreateSettingsRow(property, textEditWidget); + rowContainer = CreateSettingsRow(property, field.Content); } // create a char editor else if (property.Value is char charValue) From 4e56bb984bb8c471b937921404419e63f414347c Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 8 Jun 2018 18:19:06 -0700 Subject: [PATCH 4/5] Create new CharField for char content --- DesignTools/PublicPropertyEditor.cs | 23 ++---- MatterControl.csproj | 1 + SlicerConfiguration/UIFields/CharField.cs | 90 ++++++++++++++++++++++ SlicerConfiguration/UIFields/TextField.cs | 5 +- TextCreator/Braille/BrailleCardObject3D.cs | 8 -- 5 files changed, 99 insertions(+), 28 deletions(-) create mode 100644 SlicerConfiguration/UIFields/CharField.cs diff --git a/DesignTools/PublicPropertyEditor.cs b/DesignTools/PublicPropertyEditor.cs index a39136f19..353252143 100644 --- a/DesignTools/PublicPropertyEditor.cs +++ b/DesignTools/PublicPropertyEditor.cs @@ -397,26 +397,17 @@ namespace MatterHackers.MatterControl.DesignTools // create a char editor else if (property.Value is char charValue) { - var textEditWidget = new MHTextEditWidget(charValue.ToString(), pixelWidth: 150 * GuiWidget.DeviceScale) + var field = new CharField(); + field.Initialize(0); + field.SetValue(charValue.ToString(), false); + field.ValueChanged += (s, e) => { - SelectAllOnFocus = true, - VAnchor = VAnchor.Center - }; - textEditWidget.ActualTextEditWidget.EditComplete += (s, e) => - { - if (textEditWidget.Text.Length < 1) - { - textEditWidget.Text = "a"; - } - if (textEditWidget.Text.Length > 1) - { - textEditWidget.Text = textEditWidget.Text.Substring(0, 1); - } - property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { textEditWidget.Text[0] }); + property.PropertyInfo.GetSetMethod().Invoke(property.Item, new Object[] { Convert.ToChar(field.Value) }); rebuildable?.Rebuild(undoBuffer); propertyGridModifier?.UpdateControls(context); }; - rowContainer = CreateSettingsRow(property, textEditWidget); + + rowContainer = CreateSettingsRow(property, field.Content); } // create an enum editor else if (property.PropertyType.IsEnum) diff --git a/MatterControl.csproj b/MatterControl.csproj index 6b313b13a..ac77583c5 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -255,6 +255,7 @@ + diff --git a/SlicerConfiguration/UIFields/CharField.cs b/SlicerConfiguration/UIFields/CharField.cs new file mode 100644 index 000000000..e97512f42 --- /dev/null +++ b/SlicerConfiguration/UIFields/CharField.cs @@ -0,0 +1,90 @@ +/* +Copyright (c) 2018, Lars Brubaker, John Lewin +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using System.Linq; +using MatterHackers.Agg.UI; + +namespace MatterHackers.MatterControl.SlicerConfiguration +{ + public class CharField : UIField + { + protected MHTextEditWidget textEditWidget; + + public override void Initialize(int tabIndex) + { + textEditWidget = new MHTextEditWidget("", pixelWidth: ControlWidth, tabIndex: tabIndex) + { + ToolTipText = this.HelpText, + SelectAllOnFocus = true, + Name = this.Name, + }; + + textEditWidget.ActualTextEditWidget.InternalTextEditWidget.KeyPressed += (s, e) => + { + string keyChar = e.KeyChar.ToString(); + if (this.Value != keyChar) + { + this.SetValue( + keyChar, + userInitiated: true); + } + + e.Handled = true; + }; + + textEditWidget.ActualTextEditWidget.KeyUp += (s, e) => + { + switch(e.KeyCode) + { + case Keys.Back: + this.SetValue(" ", true); + break; + } + }; + + this.Content = textEditWidget; + } + + protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs) + { + if (this.Value != textEditWidget.Text) + { + textEditWidget.Text = this.Value; + } + + base.OnValueChanged(fieldChangedEventArgs); + } + + //protected override string ConvertValue(string newValue) + //{ + // var lastChar = newValue?.ToCharArray().LastOrDefault(); + // return lastChar.ToString(); + //} + } +} diff --git a/SlicerConfiguration/UIFields/TextField.cs b/SlicerConfiguration/UIFields/TextField.cs index 225abfcc4..93eca95dd 100644 --- a/SlicerConfiguration/UIFields/TextField.cs +++ b/SlicerConfiguration/UIFields/TextField.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2017, Lars Brubaker, John Lewin +Copyright (c) 2018, Lars Brubaker, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without @@ -27,8 +27,6 @@ of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ -using MatterHackers.Agg.UI; - namespace MatterHackers.MatterControl.SlicerConfiguration { public class TextField : UIField @@ -56,7 +54,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.Content = textEditWidget; } - protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs) { if (this.Value != textEditWidget.Text) diff --git a/TextCreator/Braille/BrailleCardObject3D.cs b/TextCreator/Braille/BrailleCardObject3D.cs index fc51a5204..ba382abd0 100644 --- a/TextCreator/Braille/BrailleCardObject3D.cs +++ b/TextCreator/Braille/BrailleCardObject3D.cs @@ -27,20 +27,12 @@ of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ -using System.ComponentModel; -using System.IO; using MatterHackers.Agg; -using MatterHackers.Agg.Font; -using MatterHackers.Agg.Platform; -using MatterHackers.Agg.Transform; using MatterHackers.Agg.UI; using MatterHackers.Agg.VertexSource; using MatterHackers.DataConverters3D; using MatterHackers.MatterControl.DesignTools.Operations; -using MatterHackers.MatterControl.Plugins.BrailleBuilder; using MatterHackers.VectorMath; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace MatterHackers.MatterControl.DesignTools { From 097b1d2a357e5199d10dc2254e2702c3a707b0c3 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 8 Jun 2018 19:05:53 -0700 Subject: [PATCH 5/5] Add test stub required by convention --- .../MatterControl/SliceSettingsFieldTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs b/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs index f16e38a3a..7db355cf8 100644 --- a/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs @@ -337,6 +337,13 @@ namespace MatterControl.Tests.MatterControl Assert.Fail(); } + [Test, Ignore("Not Implemented")] + public void CharFieldTest() + { + //var field = new BoundDoubleField(); + Assert.Fail(); + } + public class ValueMap { [DebuggerStepThrough]