Rename type to match more general use case

This commit is contained in:
John Lewin 2018-08-03 07:38:47 -07:00
parent 0f88e7aab7
commit 2bfa6f2287
5 changed files with 14 additions and 14 deletions

View file

@ -38,12 +38,12 @@ namespace MatterHackers.MatterControl
public ConfigurePrinterWidget(SettingsContext settingsContext, PrinterConfig printer, ThemeConfig theme)
: base(FlowDirection.TopToBottom)
{
var inlineTitleEdit = new InlineTitleEdit(printer.Settings.GetValue(SettingsKey.printer_name), theme, "Printer Name", boldFont: true);
inlineTitleEdit.ValueChanged += (s, e) =>
var inlineNameEdit = new InlineStringEdit(printer.Settings.GetValue(SettingsKey.printer_name), theme, "Printer Name", boldFont: true);
inlineNameEdit.ValueChanged += (s, e) =>
{
printer.Settings.SetValue(SettingsKey.printer_name, inlineTitleEdit.Text);
printer.Settings.SetValue(SettingsKey.printer_name, inlineNameEdit.Text);
};
this.AddChild(inlineTitleEdit);
this.AddChild(inlineNameEdit);
this.AddChild(
new SliceSettingsTabView(

View file

@ -34,7 +34,7 @@ using MatterHackers.Localizations;
namespace MatterHackers.MatterControl.CustomWidgets
{
public class InlineListItemEdit : InlineTitleEdit
public class InlineListItemEdit : InlineStringEdit
{
public event EventHandler ItemDeleted;

View file

@ -38,7 +38,7 @@ using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl.CustomWidgets
{
public class InlineTitleEdit : Toolbar
public class InlineStringEdit : Toolbar
{
public event EventHandler ValueChanged;
@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
private GuiWidget saveButton;
private SearchInputBox searchPanel;
public InlineTitleEdit(string title, ThemeConfig theme, string automationName, bool boldFont = false)
public InlineStringEdit(string title, ThemeConfig theme, string automationName, bool boldFont = false)
: base(theme)
{
this.Padding = theme.ToolbarPadding;

View file

@ -86,6 +86,7 @@
<Compile Include="ConfigurationPage\PrintLeveling\LevelingWizard.cs" />
<Compile Include="CustomWidgets\HelpArticleHeader.cs" />
<Compile Include="CustomWidgets\InlineListItemEdit.cs" />
<Compile Include="CustomWidgets\InlineStringEdit.cs" />
<Compile Include="CustomWidgets\LinkLabel.cs" />
<Compile Include="CustomWidgets\ResizeContainer\BottomResizeContainer.cs" />
<Compile Include="CustomWidgets\ResizeContainer\LeftResizeContainer.cs" />
@ -201,7 +202,6 @@
<Compile Include="DesignTools\Attributes\UnlockLinkAttribute.cs" />
<Compile Include="Library\Providers\FileSystem\McxContainer.cs" />
<Compile Include="Library\Providers\GraphConfig.cs" />
<Compile Include="CustomWidgets\InlineTitleEdit.cs" />
<Compile Include="Library\DynamicContentStore.cs" />
<Compile Include="Library\InMemoryLibraryItem.cs" />
<Compile Include="DesignTools\LithophaneObject3D.cs" />

View file

@ -82,12 +82,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
contentRow.BackgroundColor = Color.Transparent;
var inlineTitleEdit = new InlineTitleEdit(presetsContext.PersistenceLayer.Name, theme, presetsContext.LayerType.ToString() + " Name", boldFont: true);
inlineTitleEdit.ValueChanged += (s, e) =>
var inlineNameEdit = new InlineStringEdit(presetsContext.PersistenceLayer.Name, theme, presetsContext.LayerType.ToString() + " Name", boldFont: true);
inlineNameEdit.ValueChanged += (s, e) =>
{
printer.Settings.SetValue(SettingsKey.layer_name, inlineTitleEdit.Text, presetsContext.PersistenceLayer);
printer.Settings.SetValue(SettingsKey.layer_name, inlineNameEdit.Text, presetsContext.PersistenceLayer);
};
contentRow.AddChild(inlineTitleEdit);
contentRow.AddChild(inlineNameEdit);
var sliceSettingsWidget = CreateSliceSettingsWidget(printer, presetsContext.PersistenceLayer);
contentRow.AddChild(sliceSettingsWidget);
@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
UiThread.RunOnIdle(() =>
{
string sanitizedName = numberMatch.Replace(inlineTitleEdit.Text, "").Trim();
string sanitizedName = numberMatch.Replace(inlineNameEdit.Text, "").Trim();
string newProfileName = agg_basics.GetNonCollidingName(sanitizedName, presetsContext.PresetLayers.Select(preset => preset.ValueOrDefault(SettingsKey.layer_name)));
var clonedLayer = presetsContext.PersistenceLayer.Clone();
@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
sliceSettingsWidget = CreateSliceSettingsWidget(printer, clonedLayer);
contentRow.AddChild(sliceSettingsWidget);
inlineTitleEdit.Text = newProfileName;
inlineNameEdit.Text = newProfileName;
});
};
this.AddPageAction(duplicateButton);