public static void Show() { if (editMacrosWindow == null) { editMacrosWindow = new EditMacrosWindow(); editMacrosWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editMacrosWindow = null; }; } else { editMacrosWindow.BringToFront(); } }
void AddChildElements() { Button editButton; GroupBox groupBox = new GroupBox(textImageButtonFactory.GenerateGroupBoxLableWithEdit(new LocalizedString("Macros").Translated, out editButton)); editButton.Click += (sender, e) => { if (editSettingsWindow == null) { editSettingsWindow = new EditMacrosWindow(GetMacros(), ReloadMacros); editSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editSettingsWindow = null; }; } else { editSettingsWindow.BringToFront(); } }; groupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; groupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; groupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; // make sure the client area will get smaller when the contents get smaller groupBox.ClientArea.VAnchor = Agg.UI.VAnchor.FitToChildren; FlowLayoutWidget controlRow = new FlowLayoutWidget(Agg.UI.FlowDirection.TopToBottom); controlRow.Margin = new BorderDouble(top: 5); controlRow.HAnchor |= HAnchor.ParentLeftRight; { { this.presetButtonsContainer = GetMacroButtonContainer(); controlRow.AddChild(this.presetButtonsContainer); } } groupBox.AddChild(controlRow); this.AddChild(groupBox); }