Skip to content

Commit df9549e

Browse files
authored
Tons of V2 API doc fixes (#3932)
* Tons of API doc updates * tweaked scenario * try to fix unit test crash in ubuntu action * try to fix unit test crash in ubuntu action2
1 parent c00de4a commit df9549e

31 files changed

+164
-887
lines changed

Terminal.Gui/Application/Application.Mouse.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -254,20 +254,20 @@ internal static void RaiseMouseEvent (MouseEventArgs mouseEvent)
254254

255255
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
256256
/// <summary>
257-
/// Raised when a mouse event occurs. Can be cancelled by setting <see cref="MouseEventArgs.Handled"/> to <see langword="true"/>.
257+
/// Raised when a mouse event occurs. Can be cancelled by setting <see cref="HandledEventArgs.Handled"/> to <see langword="true"/>.
258258
/// </summary>
259259
/// <remarks>
260260
/// <para>
261261
/// <see cref="MouseEventArgs.ScreenPosition"/> coordinates are screen-relative.
262262
/// </para>
263263
/// <para>
264-
/// <see cref="MouseEventArgs.View"/> will be the deepest view under the under the mouse.
264+
/// <see cref="MouseEventArgs.View"/> will be the deepest view under the mouse.
265265
/// </para>
266266
/// <para>
267267
/// <see cref="MouseEventArgs.Position"/> coordinates are view-relative. Only valid if <see cref="MouseEventArgs.View"/> is set.
268268
/// </para>
269269
/// <para>
270-
/// Use this evento to handle mouse events at the application level, before View-specific handling.
270+
/// Use this even to handle mouse events at the application level, before View-specific handling.
271271
/// </para>
272272
/// </remarks>
273273
public static event EventHandler<MouseEventArgs>? MouseEvent;

Terminal.Gui/Drawing/Glyphs.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
namespace Terminal.Gui;
1+
#nullable enable
2+
namespace Terminal.Gui;
23

34
/// <summary>Defines the standard set of glyphs used to draw checkboxes, lines, borders, etc...</summary>
45
/// <remarks>
56
/// <para>
6-
/// Access with <see cref="CM.Glyphs"/> (which is a global using alias for
7-
/// <see cref="ConfigurationManager.Glyphs"/>).
7+
/// Access with <see cref="Glyphs"/> (which is a global using alias for
8+
/// <see cref="Glyphs"/>).
89
/// </para>
910
/// <para>
10-
/// The default glyphs can be changed via the <see cref="ConfigurationManager"/>. Within a <c>config.json</c>
11+
/// The default glyphs can be changed per-<see cref="ThemeScope"/> in <see cref="ConfigurationManager"/>. Within a <c>config.json</c>
1112
/// file the Json property name is the property name prefixed with "Glyphs.".
1213
/// </para>
1314
/// <para>

Terminal.Gui/Drawing/Region.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#nullable enable
22

3+
namespace Terminal.Gui;
4+
35
using System.Buffers;
46

57
/// <summary>
@@ -96,7 +98,7 @@ public void Intersect (Region region)
9698
{
9799
foreach (Rectangle rect2 in region._rectangles)
98100
{
99-
Rectangle intersected = Rectangle.Intersect (rect1, rect2);
101+
Rectangle intersected = Rectangle.Intersect (rect1, rect2);
100102

101103
if (!intersected.IsEmpty)
102104
{

Terminal.Gui/Input/CommandContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Terminal.Gui;
55
/// <summary>
66
/// Provides context for a <see cref="Command"/> invocation.
77
/// </summary>
8-
/// <seealso cref="View.Invoke(Command)"/>.
8+
/// <seealso cref="View.InvokeCommand"/>.
99
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
1010
public record struct CommandContext<TBinding> : ICommandContext
1111
{

Terminal.Gui/View/Adornment/Adornment.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#nullable enable
2-
using Terminal.Gui;
3-
using Attribute = Terminal.Gui.Attribute;
2+
namespace Terminal.Gui;
3+
44

55
/// <summary>
66
/// Adornments are a special form of <see cref="View"/> that appear outside the <see cref="View.Viewport"/>:

Terminal.Gui/View/Adornment/Border.cs

+42-44
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,24 @@ namespace Terminal.Gui;
1212
/// <para>
1313
/// The <see cref="View.Title"/> of <see cref="Adornment.Parent"/> will be drawn based on the value of
1414
/// <see cref="Thickness.Top"/>:
15+
/// <example>
16+
/// // If Thickness.Top is 1:
17+
/// ┌┤1234├──┐
18+
/// │ │
19+
/// └────────┘
20+
/// // If Thickness.Top is 2:
21+
/// ┌────┐
22+
/// ┌┤1234├──┐
23+
/// │ │
24+
/// └────────┘
25+
/// If Thickness.Top is 3:
26+
/// ┌────┐
27+
/// ┌┤1234├──┐
28+
/// │└────┘ │
29+
/// │ │
30+
/// └────────┘
31+
/// </example>
1532
/// </para>
16-
/// <para>
17-
/// If <c>1</c>:
18-
/// <code>
19-
/// ┌┤1234├──┐
20-
/// │ │
21-
/// └────────┘
22-
/// </code>
23-
/// </para>
24-
/// <para>
25-
/// If <c>2</c>:
26-
/// <code>
27-
/// ┌────┐
28-
/// ┌┤1234├──┐
29-
/// │ │
30-
/// └────────┘
31-
/// </code>
32-
/// </para>
33-
/// <para>
34-
/// If <c>3</c>:
35-
/// <code>
36-
/// ┌────┐
37-
/// ┌┤1234├──┐
38-
/// │└────┘ │
39-
/// │ │
40-
/// └────────┘
41-
/// </code>
42-
/// </para>
43-
/// <para/>
44-
/// <para>See the <see cref="Adornment"/> class.</para>
4533
/// </remarks>
4634
public class Border : Adornment
4735
{
@@ -77,13 +65,14 @@ private void OnThicknessChanged (object? sender, EventArgs e)
7765
ShowHideDrawIndicator ();
7866
}
7967
}
68+
8069
private void ShowHideDrawIndicator ()
8170
{
8271
if (View.Diagnostics.HasFlag (ViewDiagnosticFlags.DrawIndicator) && Thickness != Thickness.Empty)
8372
{
8473
if (DrawIndicator is null)
8574
{
86-
DrawIndicator = new SpinnerView ()
75+
DrawIndicator = new()
8776
{
8877
Id = "DrawIndicator",
8978
X = 1,
@@ -282,7 +271,6 @@ private void Border_Highlight (object? sender, CancelEventArgs<HighlightStyle> e
282271
ColorScheme = cs;
283272
}
284273

285-
286274
if (e.NewValue == HighlightStyle.None && _savedForeColor.HasValue)
287275
{
288276
var cs = new ColorScheme (ColorScheme)
@@ -304,9 +292,10 @@ protected override bool OnMouseEvent (MouseEventArgs mouseEvent)
304292
{
305293
// BUGBUG: See https://github.com/gui-cs/Terminal.Gui/issues/3312
306294
if (!_dragPosition.HasValue && mouseEvent.Flags.HasFlag (MouseFlags.Button1Pressed)
307-
// HACK: Prevents Window from being draggable if it's Top
308-
//&& Parent is Toplevel { Modal: true }
309-
)
295+
296+
// HACK: Prevents Window from being draggable if it's Top
297+
//&& Parent is Toplevel { Modal: true }
298+
)
310299
{
311300
Parent!.SetFocus ();
312301

@@ -501,8 +490,9 @@ protected override bool OnMouseEvent (MouseEventArgs mouseEvent)
501490
parentLoc.Y - _startGrabPoint.Y,
502491
out int nx,
503492
out int ny
504-
//,
505-
// out _
493+
494+
//,
495+
// out _
506496
);
507497

508498
Parent.X = parentLoc.X - _startGrabPoint.X;
@@ -712,7 +702,12 @@ protected override bool OnDrawingContent ()
712702
}
713703
}
714704

715-
if (Parent is { } && canDrawBorder && Thickness.Top > 0 && maxTitleWidth > 0 && Settings.FastHasFlags (BorderSettings.Title) && !string.IsNullOrEmpty (Parent?.Title))
705+
if (Parent is { }
706+
&& canDrawBorder
707+
&& Thickness.Top > 0
708+
&& maxTitleWidth > 0
709+
&& Settings.FastHasFlags (BorderSettings.Title)
710+
&& !string.IsNullOrEmpty (Parent?.Title))
716711
{
717712
Attribute focus = Parent.GetNormalColor ();
718713

@@ -723,11 +718,12 @@ protected override bool OnDrawingContent ()
723718
}
724719

725720
Rectangle titleRect = new (borderBounds.X + 2, titleY, maxTitleWidth, 1);
726-
Parent.TitleTextFormatter.Draw (titleRect
727-
,
721+
722+
Parent.TitleTextFormatter.Draw (
723+
titleRect,
728724
Parent.HasFocus ? focus : GetNormalColor (),
729725
Parent.HasFocus ? focus : GetHotNormalColor ());
730-
Parent?.LineCanvas.Exclude(new(titleRect));
726+
Parent?.LineCanvas.Exclude (new (titleRect));
731727
}
732728

733729
if (canDrawBorder && LineStyle != LineStyle.None)
@@ -944,13 +940,15 @@ protected override bool OnDrawingContent ()
944940
}
945941
}
946942

947-
return true; ;
943+
return true;
944+
945+
;
948946
}
949947

950948
/// <summary>
951949
/// Gets the subview used to render <see cref="ViewDiagnosticFlags.DrawIndicator"/>.
952950
/// </summary>
953-
public SpinnerView? DrawIndicator { get; private set; } = null;
951+
public SpinnerView? DrawIndicator { get; private set; }
954952

955953
private void SetupGradientLineCanvas (LineCanvas lc, Rectangle rect)
956954
{
@@ -1392,13 +1390,13 @@ private void AddArrangeModeKeyBindings ()
13921390

13931391
HotKeyBindings.Add (Key.Esc, Command.Quit);
13941392
HotKeyBindings.Add (Application.ArrangeKey, Command.Quit);
1395-
HotKeyBindings.Add (Key.CursorUp, Command.Up);
1393+
HotKeyBindings.Add (Key.CursorUp, Command.Up);
13961394
HotKeyBindings.Add (Key.CursorDown, Command.Down);
13971395
HotKeyBindings.Add (Key.CursorLeft, Command.Left);
13981396
HotKeyBindings.Add (Key.CursorRight, Command.Right);
13991397

14001398
HotKeyBindings.Add (Key.Tab, Command.Tab);
1401-
HotKeyBindings.Add (Key.Tab.WithShift, Command.BackTab);
1399+
HotKeyBindings.Add (Key.Tab.WithShift, Command.BackTab);
14021400
}
14031401

14041402
private void ApplicationOnMouseEvent (object? sender, MouseEventArgs e)

Terminal.Gui/View/View.Drawing.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,12 @@ private void DoDrawText ()
398398
protected virtual bool OnDrawingText () { return false; }
399399

400400

401-
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
402401
/// <summary>Raised when the <see cref="Text"/> of the View is to be drawn.</summary>
403402
/// <returns>
404-
/// Set <see cref="DrawEventArgs.Cancel"/> to <see langword="true"/> to stop further drawing of
403+
/// Set <see cref="CancelEventArgs.Cancel"/> to <see langword="true"/> to stop further drawing of
405404
/// <see cref="Text"/>.
406405
/// </returns>
407406
public event EventHandler<DrawEventArgs>? DrawingText;
408-
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
409407

410408
/// <summary>
411409
/// Draws the <see cref="Text"/> of the View using the <see cref="TextFormatter"/>.
@@ -503,16 +501,14 @@ private void DoDrawSubviews ()
503501
protected virtual bool OnDrawingSubviews () { return false; }
504502

505503

506-
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
507504
/// <summary>Raised when the <see cref="Subviews"/> are to be drawn.</summary>
508505
/// <remarks>
509506
/// </remarks>
510507
/// <returns>
511-
/// Set <see cref="DrawEventArgs.Cancel"/> to <see langword="true"/> to stop further drawing of
508+
/// Set <see cref="CancelEventArgs.Cancel"/> to <see langword="true"/> to stop further drawing of
512509
/// <see cref="Subviews"/>.
513510
/// </returns>
514511
public event EventHandler<DrawEventArgs>? DrawingSubviews;
515-
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
516512

517513
/// <summary>
518514
/// Draws the <see cref="Subviews"/>.

0 commit comments

Comments
 (0)