예제 #1
0
        private void AddInHelpText(FlowLayoutWidget topToBottomSettings, OrganizerSettingsData settingInfo)
        {
            FlowLayoutWidget allText         = new FlowLayoutWidget(FlowDirection.TopToBottom);
            double           textRegionWidth = 380;

            allText.Margin          = new BorderDouble(3);
            allText.Padding         = new BorderDouble(5);
            allText.BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay;

            double helpPointSize = 10;

            EnglishTextWrapping wrapper = new EnglishTextWrapping(helpPointSize);

            string[] wrappedText = wrapper.WrapText(settingInfo.HelpText, textRegionWidth - allText.Padding.Width);
            foreach (string line in wrappedText)
            {
                GuiWidget helpWidget = new TextWidget(line, pointSize: helpPointSize, textColor: RGBA_Bytes.White);
                helpWidget.Margin  = new BorderDouble(5, 0, 0, 0);
                helpWidget.HAnchor = HAnchor.ParentLeft;
                allText.AddChild(helpWidget);
            }

            allText.MinimumSize = new Vector2(textRegionWidth, allText.MinimumSize.y);
            if (wrappedText.Length > 0)
            {
                topToBottomSettings.AddChild(allText);
            }
        }
예제 #2
0
        public static bool ShowMessageBox(string message, string caption, GuiWidget[] extraWidgetsToAdd, MessageType messageType)
        {
            EnglishTextWrapping wrapper     = new EnglishTextWrapping(12);
            string           wrappedMessage = wrapper.InsertCRs(message, 300);
            StyledMessageBox messageBox     = new StyledMessageBox(wrappedMessage, caption, messageType, extraWidgetsToAdd, 400, 300);
            bool             okClicked      = false;

            messageBox.ClickedOk += (sender, e) => { okClicked = true; };
            messageBox.ShowAsSystemWindow();
            return(okClicked);
        }
 private void AdjustTextWrap()
 {
     if (messageContainer != null)
     {
         double wrappingSize = contentRow.Width - (contentRow.Padding.Width + messageContainer.Margin.Width);
         if (wrappingSize > 0)
         {
             var wrapper = new EnglishTextWrapping(12 * GuiWidget.DeviceScale);
             messageContainer.Text = wrapper.InsertCRs(unwrappedMessage, wrappingSize);
         }
     }
 }
예제 #4
0
 private void AdjustTextWrap()
 {
     if (textWidget != null)
     {
         if (Width > 0)
         {
             EnglishTextWrapping wrapper = new EnglishTextWrapping(textWidget.Printer.TypeFaceStyle.EmSizeInPoints);
             string wrappedMessage       = wrapper.InsertCRs(unwrappedText, Width);
             textWidget.Text = wrappedMessage;
         }
     }
 }
예제 #5
0
 private void AdjustTextWrap()
 {
     if (messageContainer != null)
     {
         double wrappingSize = this.Width - this.Padding.Width;
         if (wrappingSize > 0)
         {
             EnglishTextWrapping wrapper = new EnglishTextWrapping(messageContainer.Printer.TypeFaceStyle.EmSizeInPoints);
             string wrappedMessage       = wrapper.InsertCRs(unwrappedMessage, wrappingSize);
             messageContainer.Text = wrappedMessage;
         }
     }
 }
 private void AdjustTextWrap()
 {
     if (messageContainer != null)
     {
         double wrappingSize = middleRowContainer.Width - (middleRowContainer.Padding.Width + messageContainer.Margin.Width);
         if (wrappingSize > 0)
         {
             EnglishTextWrapping wrapper = new EnglishTextWrapping(12);
             string wrappedMessage       = wrapper.InsertCRs(unwrappedMessage, wrappingSize);
             messageContainer.Text = wrappedMessage;
         }
     }
 }
예제 #7
0
        public void AddTextField(string instructionsText, int pixelsFromLast)
        {
            GuiWidget spacer = new GuiWidget(10, pixelsFromLast);

            topToBottomControls.AddChild(spacer);

            EnglishTextWrapping wrapper                = new EnglishTextWrapping(12);
            string     wrappedInstructions             = wrapper.InsertCRs(instructionsText, 400);
            string     wrappedInstructionsTabsToSpaces = wrappedInstructions.Replace("\t", "    ");
            TextWidget instructionsWidget              = new TextWidget(wrappedInstructionsTabsToSpaces, textColor: ActiveTheme.Instance.PrimaryTextColor);

            instructionsWidget.HAnchor = Agg.UI.HAnchor.ParentCenter;
            topToBottomControls.AddChild(instructionsWidget);
        }
        private FlowLayoutWidget GetHelpTextWidget()
        {
            FlowLayoutWidget allText         = new FlowLayoutWidget(FlowDirection.TopToBottom);
            double           textRegionWidth = 260 * TextWidget.GlobalPointSizeScaleRatio;

            allText.Margin          = new BorderDouble(3) * TextWidget.GlobalPointSizeScaleRatio;
            allText.Padding         = new BorderDouble(3) * TextWidget.GlobalPointSizeScaleRatio;
            allText.HAnchor         = HAnchor.ParentLeftRight;
            allText.BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay;

            double helpPointSize        = 10;
            EnglishTextWrapping wrapper = new EnglishTextWrapping(helpPointSize);

            string[] wrappedText = wrapper.WrapText(HelpText, textRegionWidth - allText.Padding.Width);
            foreach (string line in wrappedText)
            {
                GuiWidget helpWidget = new TextWidget(line, pointSize: helpPointSize, textColor: RGBA_Bytes.White);
                allText.AddChild(helpWidget);
            }

            allText.MinimumSize = new Vector2(textRegionWidth, allText.MinimumSize.y);
            allText.Visible     = false;
            return(allText);
        }