Kaynağa Gözat

Added Caption property

Thomas 2 yıl önce
ebeveyn
işleme
61ca3a49ed
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  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>