Use TextField for string content
This commit is contained in:
parent
c090928e82
commit
f00638eab4
1 changed files with 6 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue