Added UiHints to controls

This commit is contained in:
LarsBrubaker 2021-06-06 09:07:18 -07:00
parent 082a8cdcc7
commit c01afb5542
17 changed files with 177 additions and 40 deletions

View file

@ -60,6 +60,7 @@ namespace MatterHackers.MatterControl.DesignTools
private static readonly Type[] AllowedTypes =
{
typeof(double), typeof(int), typeof(char), typeof(string), typeof(bool),
typeof(StringOrExpression),
typeof(DoubleOrExpression),
typeof(IntOrExpression),
typeof(Color),
@ -830,6 +831,22 @@ namespace MatterHackers.MatterControl.DesignTools
}
}
}
else if (propertyValue is StringOrExpression stringOrExpression)
{
// create a string editor
var field = new TextField(theme);
field.Initialize(0);
field.SetValue(stringOrExpression.Expression, false);
field.ClearUndoHistory();
field.Content.HAnchor = HAnchor.Stretch;
RegisterValueChanged(field,
(valueString) => new StringOrExpression(valueString),
(value) =>
{
return ((StringOrExpression)value).Expression;
});
rowContainer = CreateSettingsRow(property, field, theme, rows);
}
else if (propertyValue is char charValue)
{
// create a char editor