Load and Unload Macros working better.

Fixed colors on redeem purchase disabled button
This commit is contained in:
Lars Brubaker 2016-11-29 14:17:37 -08:00
parent a241888635
commit 06b1512698
24 changed files with 87 additions and 72 deletions

View file

@ -135,7 +135,7 @@ namespace MatterHackers.MatterControl
//Add buttons to buttonContainer
footerRow.AddChild(nextButton);
footerRow.AddChild(hSpacer);
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
updateControls(true);
}

View file

@ -51,9 +51,9 @@ namespace MatterHackers.MatterControl
contentRow.AddChild(new SetupAccountView(this.textImageButtonFactory));
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
cancelButton.Text = "Back".Localize();
closeButton.Text = "Back".Localize();
}
}
@ -213,7 +213,7 @@ namespace MatterHackers.MatterControl
buttonContainer.AddChild(new HorizontalSpacer());
// the redeem design code button
textImageButtonFactory.disabledTextColor = RGBA_Bytes.DarkGray;
textImageButtonFactory.disabledTextColor = new RGBA_Bytes(textImageButtonFactory.normalTextColor, 100);
Button redeemPurchaseButton = textImageButtonFactory.Generate("Redeem Purchase".Localize());
redeemPurchaseButton.Enabled = true; // The library selector (the first library selected) is protected so we can't add to it.
redeemPurchaseButton.Name = "Redeem Code Button";

View file

@ -136,9 +136,9 @@ namespace MatterHackers.MatterControl
contentRow.AddChild(rememberChoice);
syncButton.Visible = true;
cancelButton.Visible = true;
closeButton.Visible = true;
cancelButton.Click += (s, e) => UiThread.RunOnIdle(() =>
closeButton.Click += (s, e) => UiThread.RunOnIdle(() =>
{
WizardWindow.Close();
if (rememberChoice.Checked)
@ -150,7 +150,7 @@ namespace MatterHackers.MatterControl
//Add buttons to buttonContainer
footerRow.AddChild(syncButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
footerRow.Visible = true;
}

View file

@ -61,9 +61,9 @@ namespace MatterHackers.MatterControl
contentRow.AddChild(SliceSettingsWidget.CreatePrinterExtraControls());
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
cancelButton.Text = "Back".Localize();
closeButton.Text = "Back".Localize();
// Close this form if the active printer changes
ActiveSliceSettings.ActivePrinterChanged.RegisterEvent((s, e) =>

View file

@ -100,12 +100,12 @@ namespace MatterHackers.MatterControl
exportButton.Click += (s, e) => UiThread.RunOnIdle(exportButton_Click);
exportButton.Visible = true;
cancelButton.Visible = true;
closeButton.Visible = true;
//Add buttons to buttonContainer
footerRow.AddChild(exportButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
}
private GuiWidget CreateDetailInfo(string detailText)

View file

@ -219,7 +219,7 @@ namespace MatterHackers.MatterControl
footerRow.AddChild(mergeButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
if (settingsToImport.QualityLayers.Count == 0 && settingsToImport.MaterialLayers.Count == 0)
{
@ -270,7 +270,7 @@ namespace MatterHackers.MatterControl
container.AddChild(successMessageWidget);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
}
}
@ -372,12 +372,12 @@ namespace MatterHackers.MatterControl
});
importButton.Visible = true;
cancelButton.Visible = true;
closeButton.Visible = true;
//Add buttons to buttonContainer
footerRow.AddChild(importButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
}
private GuiWidget CreateDetailInfo(string detailText)

View file

@ -64,15 +64,15 @@ public class LicenseAgreementPage : WizardPage
};
acceptButton.Visible = true;
cancelButton.Visible = true;
closeButton.Visible = true;
// Exit if EULA is not accepted
cancelButton.Click += (s, e) => UiThread.RunOnIdle(MatterControlApplication.Instance.Close);
closeButton.Click += (s, e) => UiThread.RunOnIdle(MatterControlApplication.Instance.Close);
//Add buttons to buttonContainer
footerRow.AddChild(acceptButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
footerRow.Visible = true;

View file

@ -34,7 +34,7 @@ namespace MatterHackers.MatterControl.SetupWizard
var revertButton = textImageButtonFactory.Generate("Restore");
footerRow.AddChild(revertButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
revertButton.Click += async (s, e) =>
{
int index = radioButtonList.IndexOf(radioButtonList.Where(r => r.Checked).FirstOrDefault());

View file

@ -43,8 +43,8 @@ namespace MatterHackers.MatterControl
RefreshStatus();
//Construct buttons
cancelButton = whiteImageButtonFactory.Generate("Cancel".Localize(), centerText:true);
cancelButton.Click += (s, e) => this.WizardWindow.ChangeToPage<AndroidConnectDevicePage>();
closeButton = whiteImageButtonFactory.Generate("Cancel".Localize(), centerText:true);
closeButton.Click += (s, e) => this.WizardWindow.ChangeToPage<AndroidConnectDevicePage>();
//Construct buttons
nextButton = textImageButtonFactory.Generate("Continue".Localize());
@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl
//Add buttons to buttonContainer
footerRow.AddChild(nextButton);
footerRow.AddChild(new GuiWidget() { HAnchor = HAnchor.ParentLeftRight });
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
// Register for connection notifications
PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(ConnectionStatusChanged, ref unregisterEvents);

View file

@ -81,7 +81,7 @@ namespace MatterHackers.MatterControl
//Add buttons to buttonContainer
footerRow.AddChild(nextButton);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
}
}
}

View file

@ -38,7 +38,7 @@ namespace MatterHackers.MatterControl.SetupWizard
UiThread.RunOnIdle(WizardWindow.Close);
});
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
footerRow.AddChild(closeButton);
}
private void ReportProgress(SyncReportType report)

View file

@ -12,7 +12,7 @@ namespace MatterHackers.MatterControl
protected FlowLayoutWidget footerRow;
protected TextWidget headerLabel;
protected Button cancelButton;
protected Button closeButton;
protected TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory() { fontSize = 16 };
protected TextImageButtonFactory whiteImageButtonFactory;
@ -64,9 +64,9 @@ namespace MatterHackers.MatterControl
this.AnchorAll();
cancelButton = textImageButtonFactory.Generate(unlocalizedTextForCancelButton.Localize());
cancelButton.Name = "Cancel Wizard Button";
cancelButton.Click += (s, e) =>
closeButton = textImageButtonFactory.Generate(unlocalizedTextForCancelButton.Localize());
closeButton.Name = "Cancel Wizard Button";
closeButton.Click += (s, e) =>
{
UiThread.RunOnIdle(() => WizardWindow?.Close());
};