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.ParentLeft;
			topToBottomControls.AddChild(instructionsWidget);
		}
Ejemplo n.º 2
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;
				}
			}
		}
		private void AdjustTextWrap()
		{
			if (messageContainer != null)
			{
				double wrappingSize = middleRowContainer.Width - (middleRowContainer.Padding.Width + messageContainer.Margin.Width);
				if (wrappingSize > 0)
				{
					EnglishTextWrapping wrapper = new EnglishTextWrapping(12 * extraTextScaling * GuiWidget.DeviceScale);
					string wrappedMessage = wrapper.InsertCRs(unwrappedMessage, wrappingSize);
					messageContainer.Text = wrappedMessage;
				}
			}
		}
Ejemplo n.º 4
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;
					}
				}
			}