Miguel de Icaza 7 rokov pred
rodič
commit
c5325c5527
4 zmenil súbory, kde vykonal 31 pridanie a 5 odobranie
  1. 2 2
      README.md
  2. 5 1
      Terminal.Gui/Core.cs
  3. 7 2
      Terminal.Gui/Driver.cs
  4. 17 0
      Terminal.Gui/Views/ListView.cs

+ 2 - 2
README.md

@@ -3,8 +3,8 @@
 This is a simple UI toolkit for .NET.
 This is a simple UI toolkit for .NET.
 
 
 It is an updated version of
 It is an updated version of
-[gui.cs](https://github.com/mono/mono-curses/blob/master/gui.cs) that
-I wrote for [mono-curses](https://github.com/mono/mono-curses).
+[gui.cs](http://tirania.org/blog/archive/2007/Apr-16.html) that
+I wrote for [mono-curses](https://github.com/mono/mono-curses) in 2007.
 
 
 The toolkit contains various controls (labesl, text entry, buttons,
 The toolkit contains various controls (labesl, text entry, buttons,
 radio buttons, checkboxes, dialog boxes, windows, menus) for building
 radio buttons, checkboxes, dialog boxes, windows, menus) for building

+ 5 - 1
Terminal.Gui/Core.cs

@@ -106,7 +106,11 @@ namespace Terminal.Gui {
 			return false;
 			return false;
 		}
 		}
 
 
-		// Mouse events
+		/// <summary>
+		/// Method invoked when a mouse event is generated
+		/// </summary>
+		/// <returns><c>true</c>, if the event was handled, <c>false</c> otherwise.</returns>
+		/// <param name="me">Me.</param>
 		public virtual bool MouseEvent (MouseEvent me)
 		public virtual bool MouseEvent (MouseEvent me)
 		{
 		{
 			return false;
 			return false;

+ 7 - 2
Terminal.Gui/Driver.cs

@@ -93,9 +93,14 @@ namespace Terminal.Gui {
 	/// </remarks>
 	/// </remarks>
 	public struct Attribute {
 	public struct Attribute {
 		internal int value;
 		internal int value;
-		public Attribute (int v)
+
+		/// <summary>
+		/// Initializes a new instance of the <see cref="T:Terminal.Gui.Attribute"/> struct.
+		/// </summary>
+		/// <param name="value">Value.</param>
+		public Attribute (int value)
 		{
 		{
-			value = v;
+			this.value = value;
 		}
 		}
 
 
 		public static implicit operator int (Attribute c) => c.value;
 		public static implicit operator int (Attribute c) => c.value;

+ 17 - 0
Terminal.Gui/Views/ListView.cs

@@ -256,6 +256,10 @@ namespace Terminal.Gui {
 			CanFocus = true;
 			CanFocus = true;
 		}
 		}
 
 
+		/// <summary>
+		/// Redraws the ListView
+		/// </summary>
+		/// <param name="region">Region.</param>
 		public override void Redraw(Rect region)
 		public override void Redraw(Rect region)
 		{
 		{
 			var current = ColorScheme.Focus;
 			var current = ColorScheme.Focus;
@@ -287,6 +291,11 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		public event Action SelectedChanged;
 		public event Action SelectedChanged;
 
 
+		/// <summary>
+		/// Handles cursor movement for this view, passes all other events.
+		/// </summary>
+		/// <returns><c>true</c>, if key was processed, <c>false</c> otherwise.</returns>
+		/// <param name="kb">Keyboard event.</param>
 		public override bool ProcessKey (KeyEvent kb)
 		public override bool ProcessKey (KeyEvent kb)
 		{
 		{
 			switch (kb.Key) {
 			switch (kb.Key) {
@@ -346,5 +355,13 @@ namespace Terminal.Gui {
 			}
 			}
 			return base.ProcessKey (kb);
 			return base.ProcessKey (kb);
 		}
 		}
+
+		/// <summary>
+		/// Positions the cursor in this view
+		/// </summary>
+		public override void PositionCursor()
+		{
+			Driver.Move (0, selected);
+		}
 	}
 	}
 }
 }