Pārlūkot izejas kodu

Added Caption property

Thomas 2 gadi atpakaļ
vecāks
revīzija
61ca3a49ed
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  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>