Beispiel #1
0
        public MacroControlsWidget()
            : base(FlowDirection.TopToBottom)
        {
            this.textImageButtonFactory.normalFillColor   = RGBA_Bytes.White;
            this.textImageButtonFactory.FixedHeight       = 24 * GuiWidget.DeviceScale;
            this.textImageButtonFactory.fontSize          = 12;
            this.textImageButtonFactory.borderWidth       = 1;
            this.textImageButtonFactory.normalBorderColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 200);
            this.textImageButtonFactory.hoverBorderColor  = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 200);

            this.textImageButtonFactory.disabledTextColor = RGBA_Bytes.Gray;
            this.textImageButtonFactory.hoverTextColor    = ActiveTheme.Instance.PrimaryTextColor;
            this.textImageButtonFactory.normalTextColor   = RGBA_Bytes.Black;
            this.textImageButtonFactory.pressedTextColor  = ActiveTheme.Instance.PrimaryTextColor;

            this.HAnchor = HAnchor.ParentLeftRight;

            // add the widgets to this window
            Button      editButton;
            AltGroupBox groupBox = new AltGroupBox(textImageButtonFactory.GenerateGroupBoxLabelWithEdit(new TextWidget("Macros".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor), out editButton));

            editButton.Click += (sender, e) =>
            {
                EditMacrosWindow.Show();
            };

            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);
        }
Beispiel #2
0
        void AddChildElements()
        {
            Button      editButton;
            AltGroupBox groupBox = new AltGroupBox(textImageButtonFactory.GenerateGroupBoxLabelWithEdit(new TextWidget("Macros".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor), out editButton));

            editButton.Click += (sender, e) =>
            {
                if (editSettingsWindow == null)
                {
                    editSettingsWindow         = new EditMacrosWindow(ReloadMacros);
                    editSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editSettingsWindow = null; };
                }
                else
                {
                    editSettingsWindow.BringToFront();
                }
            };


            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);
        }
		private void AddChildElements()
		{
			Button editButton;
			AltGroupBox groupBox = new AltGroupBox(textImageButtonFactory.GenerateGroupBoxLabelWithEdit(new TextWidget("Macros".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor), out editButton));
			editButton.Click += (sender, e) =>
			{
				if (editSettingsWindow == null)
				{
					editSettingsWindow = new EditMacrosWindow(ReloadMacros);
					editSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editSettingsWindow = null; };
				}
				else
				{
					editSettingsWindow.BringToFront();
				}
			};

			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);
		}