Made the drop list name update interactively.
This commit is contained in:
parent
b18f8fc889
commit
e4a10442c2
2 changed files with 23 additions and 10 deletions
|
|
@ -56,6 +56,16 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public PresetSelectorWidget(string label, RGBA_Bytes accentColor, NamedSettingsLayers layerType, int extruderIndex)
|
||||
: base(FlowDirection.TopToBottom)
|
||||
{
|
||||
SliceSettingsWidget.SettingChanged.RegisterEvent((s, e) =>
|
||||
{
|
||||
StringEventArgs stringEvent = e as StringEventArgs;
|
||||
if (stringEvent != null
|
||||
&& stringEvent.Data == SettingsKey.layer_name)
|
||||
{
|
||||
RebuildDropDownList();
|
||||
}
|
||||
}, ref unregisterEvents);
|
||||
|
||||
this.extruderIndex = extruderIndex;
|
||||
this.layerType = layerType;
|
||||
|
||||
|
|
@ -320,6 +330,17 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return dropDownList;
|
||||
}
|
||||
|
||||
private event EventHandler unregisterEvents;
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
if (unregisterEvents != null)
|
||||
{
|
||||
unregisterEvents(this, null);
|
||||
}
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void SettingsLayers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
RebuildDropDownList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue