Explorar o código

Added Caption property

Thomas %!s(int64=2) %!d(string=hai) anos
pai
achega
61ca3a49ed
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      Terminal.Gui/Views/TextField.cs

+ 13 - 0
Terminal.Gui/Views/TextField.cs

@@ -29,6 +29,19 @@ namespace Terminal.Gui {
 		HistoryText historyText = new HistoryText ();
 		CultureInfo currentCulture;
 
+		/// <summary>
+		/// Gets or sets the text to render in control when no value has 
+		/// been entered yet and the <see cref="View"/> does not yet have
+		/// input focus.
+		/// </summary>
+		public string Caption {get;set;}
+
+		/// <summary>
+		/// Gets or sets the foreground <see cref="Color"/> to use when 
+		/// rendering <see cref="Caption"/>.
+		/// </summary>
+		public Color CaptionColor {get;set;} = Color.DarkGray;
+
 		/// <summary>
 		/// Tracks whether the text field should be considered "used", that is, that the user has moved in the entry, so new input should be appended at the cursor position, rather than clearing the entry
 		/// </summary>