private FlowLayoutWidget GetHelpTextWidget() { FlowLayoutWidget allText = new FlowLayoutWidget(FlowDirection.TopToBottom); double textRegionWidth = 260; allText.Margin = new BorderDouble(3); allText.Padding = new BorderDouble(3); allText.HAnchor = HAnchor.ParentLeftRight; allText.BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay; double helpPointSize = 10; string[] wrappedText = TypeFacePrinter.WrapText(HelpText, textRegionWidth - allText.Padding.Width, helpPointSize); 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); }
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; string[] wrappedText = TypeFacePrinter.WrapText(settingInfo.HelpText, textRegionWidth - allText.Padding.Width, helpPointSize); 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); if (wrappedText.Length > 0) { topToBottomSettings.AddChild(allText); } }