Add event, notify, rebuild on Macro changes
- Issue MatterHackers/MCCentral#4071 Changing name of G-Code macro does not update button in controls
This commit is contained in:
parent
fc7362d218
commit
312c11f01a
4 changed files with 22 additions and 7 deletions
|
|
@ -41,14 +41,19 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
public class MacroControls : FlowLeftRightWithWrapping
|
||||
{
|
||||
private EventHandler unregisterEvents;
|
||||
PrinterConfig printer;
|
||||
ThemeConfig theme;
|
||||
private PrinterConfig printer;
|
||||
private ThemeConfig theme;
|
||||
|
||||
private MacroControls(PrinterConfig printer, ThemeConfig theme)
|
||||
{
|
||||
this.printer = printer;
|
||||
this.theme = theme;
|
||||
Rebuild();
|
||||
this.Rebuild();
|
||||
|
||||
printer.Settings.MacrosChanged.RegisterEvent((s, e) =>
|
||||
{
|
||||
UiThread.RunOnIdle(() => Rebuild());
|
||||
}, ref unregisterEvents);
|
||||
|
||||
ActiveSliceSettings.ActiveProfileModified.RegisterEvent((s, e) =>
|
||||
{
|
||||
|
|
@ -62,7 +67,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
void Rebuild()
|
||||
private void Rebuild()
|
||||
{
|
||||
addedChildren.Clear();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue