浏览代码

Added Caption property

Thomas 2 年之前
父节点
当前提交
61ca3a49ed
共有 1 个文件被更改,包括 13 次插入0 次删除
  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 ();
 		HistoryText historyText = new HistoryText ();
 		CultureInfo currentCulture;
 		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>
 		/// <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
 		/// 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>
 		/// </summary>