private void AddChildElements()
        {
            EnhancedSettingsControlBar topRow = new EnhancedSettingsControlBar();

            //this.AddChild(bottomRow);
            this.AddChild(topRow);
        }
		private void AddChildElements()
		{
			EnhancedSettingsControlBar topRow = new EnhancedSettingsControlBar();
			//this.AddChild(bottomRow);
			this.AddChild(topRow);
		}
Example #3
0
        void AddChildElements()
        {
            EnhancedSettingsControlBar topRow    = new EnhancedSettingsControlBar();
            FlowLayoutWidget           bottomRow = new FlowLayoutWidget();

            bottomRow.HAnchor = HAnchor.ParentLeftRight;
            bottomRow.Margin  = new BorderDouble(bottom: 4);

            FlowLayoutWidget settingsStatusLabelContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);

            settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop;
            settingsStatusLabelContainer.Margin   = new BorderDouble(0);
            {
                string activeSettingsLabelText     = LocalizedString.Get("Active Settings").ToUpper();
                string activeSettingsLabelTextFull = string.Format("{0}:", activeSettingsLabelText);

                TextWidget settingsStatusLabel = new TextWidget(string.Format(activeSettingsLabelTextFull), pointSize: 10);
                settingsStatusLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;

                settingsStatusDescription        = new TextWidget("", pointSize: 14);
                settingsStatusDescription.Margin = new BorderDouble(top: 4);
                settingsStatusDescription.AutoExpandBoundsToText = true;
                settingsStatusDescription.TextColor = ActiveTheme.Instance.PrimaryTextColor;

                string unsavedChangesTxtBeg  = LocalizedString.Get("unsaved changes");
                string unsavedChangesTxtFull = string.Format("({0})", unsavedChangesTxtBeg);
                unsavedChangesIndicator = new TextWidget(unsavedChangesTxtFull, pointSize: 10);
                unsavedChangesIndicator.AutoExpandBoundsToText = true;
                unsavedChangesIndicator.Visible   = false;
                unsavedChangesIndicator.Margin    = new BorderDouble(left: 4);
                unsavedChangesIndicator.TextColor = ActiveTheme.Instance.PrimaryTextColor;

                settingsStatusLabelContainer.AddChild(settingsStatusLabel);
                settingsStatusLabelContainer.AddChild(settingsStatusDescription);
                settingsStatusLabelContainer.AddChild(unsavedChangesIndicator);
            }

            saveButton         = textImageButtonFactory.Generate(LocalizedString.Get("Save"));
            saveButton.VAnchor = VAnchor.ParentTop;
            saveButton.Visible = false;
            saveButton.Margin  = new BorderDouble(0, 0, 0, 10);
            saveButton.Click  += new ButtonBase.ButtonEventHandler(saveButton_Click);

            revertbutton         = textImageButtonFactory.Generate(LocalizedString.Get("Revert"));
            revertbutton.VAnchor = VAnchor.ParentTop;
            revertbutton.Visible = false;
            revertbutton.Margin  = new BorderDouble(0, 0, 0, 10);
            revertbutton.Click  += new ButtonBase.ButtonEventHandler(revertbutton_Click);

            bottomRow.AddChild(settingsStatusLabelContainer);

            GuiWidget spacer = new GuiWidget(HAnchor.ParentLeftRight);

            bottomRow.AddChild(spacer);

            bottomRow.AddChild(saveButton);
            bottomRow.AddChild(revertbutton);
            bottomRow.AddChild(GetSliceOptionsMenuDropList());

            this.AddChild(bottomRow);
            this.AddChild(topRow);

            SetStatusDisplay();
        }
        void AddChildElements()
        {
            EnhancedSettingsControlBar topRow = new EnhancedSettingsControlBar();
            FlowLayoutWidget bottomRow = new FlowLayoutWidget();

            bottomRow.HAnchor = HAnchor.ParentLeftRight;
            bottomRow.Margin = new BorderDouble(bottom:4);

            FlowLayoutWidget settingsStatusLabelContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
            settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop;
            settingsStatusLabelContainer.Margin = new BorderDouble(0);
            {   
                string activeSettingsLabelText = LocalizedString.Get ("Active Settings").ToUpper();
				string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText);

				TextWidget settingsStatusLabel = new TextWidget(string.Format(activeSettingsLabelTextFull), pointSize: 10);
                settingsStatusLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;

                settingsStatusDescription = new TextWidget("", pointSize: 14);
                settingsStatusDescription.Margin = new BorderDouble(top: 4);
                settingsStatusDescription.AutoExpandBoundsToText = true;
                settingsStatusDescription.TextColor = ActiveTheme.Instance.PrimaryTextColor;

                string unsavedChangesTxtBeg = LocalizedString.Get("unsaved changes");
				string unsavedChangesTxtFull = string.Format ("({0})", unsavedChangesTxtBeg);
				unsavedChangesIndicator = new TextWidget(unsavedChangesTxtFull, pointSize: 10);
                unsavedChangesIndicator.AutoExpandBoundsToText = true;
                unsavedChangesIndicator.Visible = false;
                unsavedChangesIndicator.Margin = new BorderDouble(left: 4);
                unsavedChangesIndicator.TextColor = ActiveTheme.Instance.PrimaryTextColor;

                settingsStatusLabelContainer.AddChild(settingsStatusLabel);
                settingsStatusLabelContainer.AddChild(settingsStatusDescription);
                settingsStatusLabelContainer.AddChild(unsavedChangesIndicator);
            }

			saveButton = textImageButtonFactory.Generate(LocalizedString.Get("Save"));
            saveButton.VAnchor = VAnchor.ParentTop;
            saveButton.Visible = false;
            saveButton.Margin = new BorderDouble(0, 0, 0, 10);
			saveButton.Click += new ButtonBase.ButtonEventHandler(saveButton_Click);

			revertbutton = textImageButtonFactory.Generate(LocalizedString.Get("Revert"));
            revertbutton.VAnchor = VAnchor.ParentTop;
            revertbutton.Visible = false;
            revertbutton.Margin = new BorderDouble(0,0,0,10);
            revertbutton.Click += new ButtonBase.ButtonEventHandler(revertbutton_Click);		
            
            bottomRow.AddChild(settingsStatusLabelContainer);

            GuiWidget spacer = new GuiWidget(HAnchor.ParentLeftRight);
            bottomRow.AddChild(spacer);

            bottomRow.AddChild(saveButton);
            bottomRow.AddChild(revertbutton);
            bottomRow.AddChild(GetSliceOptionsMenuDropList());

            this.AddChild(bottomRow);
            this.AddChild(topRow);

            SetStatusDisplay();
        }