Skip to content
32 changes: 27 additions & 5 deletions Terminal.Gui/ViewBase/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

namespace Terminal.Gui.ViewBase;

#region API Docs

/// <summary>
/// View is the base class all visible elements. View can render itself and
/// View is the base class for all visible elements. View can render itself and
/// contains zero or more nested views, called SubViews. View provides basic functionality for layout, arrangement, and
/// drawing. In addition, View provides keyboard and mouse event handling.
/// <para>
Expand All @@ -19,9 +18,32 @@ namespace Terminal.Gui.ViewBase;
/// for more.
/// </para>
/// </summary>

#endregion API Docs

/// <remarks>
/// <para>Default key bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Space</term> <description>Activates the view (<see cref="Command.Activate"/>).</description>
/// </item>
/// <item>
/// <term>Enter</term> <description>Accepts the view (<see cref="Command.Accept"/>).</description>
/// </item>
/// </list>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left Button Released</term> <description>Activates the view (<see cref="Command.Activate"/>).</description>
/// </item>
/// <item>
/// <term>Ctrl+Left Button Released</term> <description>Opens the context menu (<see cref="Command.Context"/>).</description>
/// </item>
/// </list>
/// </remarks>
public partial class View : IDisposable, ISupportInitializeNotification
{
private bool _disposedValue;
Expand Down
22 changes: 22 additions & 0 deletions Terminal.Gui/Views/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@
/// <para>
/// Button does not raise <see cref="View.Activating"/> events.
/// </para>
/// <para>Default key bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Space</term> <description>Accepts the button (<see cref="Command.Accept"/>).</description>
/// </item>
/// <item>
/// <term>Enter</term> <description>Accepts the button (<see cref="Command.Accept"/>).</description>
/// </item>
/// </list>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Click / Double-Click / Triple-Click</term>
/// <description>Accepts the button (<see cref="Command.Accept"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class Button : View, IDesignable, IAcceptTarget
{
Expand Down
38 changes: 38 additions & 0 deletions Terminal.Gui/Views/CharMap/CharMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,44 @@ namespace Terminal.Gui.Views;
/// <summary>
/// A scrollable map of the Unicode codepoints.
/// </summary>
/// <remarks>
/// <para>Default key bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left / Right</term> <description>Moves one codepoint left or right.</description>
/// </item>
/// <item>
/// <term>Up / Down</term> <description>Moves one row up or down.</description>
/// </item>
/// <item>
/// <term>PageUp / PageDown</term> <description>Moves one page up or down.</description>
/// </item>
/// <item>
/// <term>Home / End</term> <description>Moves to the first or last codepoint.</description>
/// </item>
/// </list>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Click</term> <description>Selects the clicked codepoint (<see cref="Command.Activate"/>).</description>
/// </item>
/// <item>
/// <term>Double-Click</term> <description>Accepts the clicked codepoint (<see cref="Command.Accept"/>).</description>
/// </item>
/// <item>
/// <term>Right-Click / Ctrl+Click</term> <description>Opens the context menu.</description>
/// </item>
/// <item>
/// <term>Wheel Up / Down / Left / Right</term> <description>Scrolls the map.</description>
/// </item>
/// </list>
/// </remarks>
public class CharMap : View, IDesignable, IValue<Rune>
{
/// <summary>
Expand Down
12 changes: 12 additions & 0 deletions Terminal.Gui/Views/CheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ namespace Terminal.Gui.Views;
/// <para>
/// <see cref="RadioStyle"/> is used to display radio button style glyphs (●) instead of checkbox style glyphs (☑).
/// </para>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Click</term> <description>Toggles the checked state (<see cref="Command.Activate"/>).</description>
/// </item>
/// <item>
/// <term>Double-Click</term> <description>Accepts the checkbox (<see cref="Command.Accept"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class CheckBox : View, IValue<CheckState>
{
Expand Down
25 changes: 24 additions & 1 deletion Terminal.Gui/Views/Color/ColorPicker.16.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
namespace Terminal.Gui.Views;

/// <summary>A sinple color picker that supports the legacy 16 ANSI colors</summary>
/// <summary>A simple color picker that supports the legacy 16 ANSI colors.</summary>
/// <remarks>
/// <para>Default key bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left / Right</term> <description>Moves the selection left or right.</description>
/// </item>
/// <item>
/// <term>Up / Down</term> <description>Moves the selection up or down.</description>
/// </item>
/// </list>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Double-Click</term> <description>Accepts the selected color (<see cref="Command.Accept"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class ColorPicker16 : View, IValue<ColorName16>
{
/// <summary>Columns of color boxes</summary>
Expand Down
11 changes: 11 additions & 0 deletions Terminal.Gui/Views/Color/ColorPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ namespace Terminal.Gui.Views;
/// Color Picker supporting RGB, HSL, and HSV color models. Supports choosing colors with
/// sliders and color names from the <see cref="IColorNameResolver"/>.
/// </summary>
/// <remarks>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Double-Click</term> <description>Accepts the selected color (<see cref="Command.Accept"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class ColorPicker : View, IValue<Color?>, IDesignable
{
/// <summary>
Expand Down
21 changes: 21 additions & 0 deletions Terminal.Gui/Views/DropDownList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@ namespace Terminal.Gui.Views;
/// };
/// dropdown.ValueChanged += (s, e) => MessageBox.Query ("Selected", dropdown.Text, "Ok");
/// </code>
/// <para>Default key bindings (in addition to <see cref="TextField"/> bindings):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>F4</term> <description>Toggles the dropdown list open or closed.</description>
/// </item>
/// <item>
/// <term>Alt+Down</term> <description>Toggles the dropdown list open or closed.</description>
/// </item>
/// </list>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Click</term> <description>Activates the dropdown (<see cref="Command.Activate"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class DropDownList : TextField
{
Expand Down
16 changes: 15 additions & 1 deletion Terminal.Gui/Views/GraphView/GraphView.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
namespace Terminal.Gui.Views;

/// <summary>Displays graphs (bar, scatter, etc...) with flexible labels, scaling, and scrolling</summary>
/// <summary>Displays graphs (bar, scatter, etc...) with flexible labels, scaling, and scrolling.</summary>
/// <remarks>
/// <para>Default key bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left / Right</term> <description>Scrolls the graph left or right.</description>
/// </item>
/// <item>
/// <term>Up / Down</term> <description>Scrolls the graph up or down.</description>
/// </item>
/// </list>
/// </remarks>
public class GraphView : View, IDesignable
{
/// <summary>Creates a new graph with a 1 to 1 graph space with absolute layout.</summary>
Expand Down
45 changes: 45 additions & 0 deletions Terminal.Gui/Views/HexView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,51 @@ namespace Terminal.Gui.Views;
/// Control the byte at the caret for editing by setting the <see cref="Address"/> property to an offset in the
/// stream.
/// </para>
/// <para>Default key bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left / Right</term> <description>Moves the cursor one nibble/byte.</description>
/// </item>
/// <item>
/// <term>Up / Down</term> <description>Moves the cursor one row up or down.</description>
/// </item>
/// <item>
/// <term>PageUp / PageDown</term> <description>Moves one page up or down.</description>
/// </item>
/// <item>
/// <term>Home / End</term> <description>Moves to the first or last byte in the stream.</description>
/// </item>
/// <item>
/// <term>Ctrl+Left / Ctrl+Right</term> <description>Moves to the start or end of the current row.</description>
/// </item>
/// <item>
/// <term>Ctrl+Up / Ctrl+Down</term> <description>Moves to the start or end of the current page.</description>
/// </item>
/// <item>
/// <term>Backspace</term> <description>Deletes the byte before the cursor.</description>
/// </item>
/// <item>
/// <term>Delete</term> <description>Deletes the byte at the cursor.</description>
/// </item>
/// <item>
/// <term>Insert</term> <description>Toggles insert mode.</description>
/// </item>
/// </list>
/// <para>Default mouse bindings:</para>
/// <list type="table">
/// <listheader>
/// <term>Mouse Event</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Click / Double-Click</term> <description>Positions the cursor at the clicked byte.</description>
/// </item>
/// <item>
/// <term>Wheel Up / Down</term> <description>Scrolls the view.</description>
/// </item>
/// </list>
/// </remarks>
public class HexView : View, IDesignable
{
Expand Down
87 changes: 84 additions & 3 deletions Terminal.Gui/Views/LinearRange/LinearRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@ namespace Terminal.Gui.Views;
/// Provides a linear range control letting the user navigate from a set of typed options in a linear manner using the
/// keyboard or mouse.
/// </summary>
/// <remarks>
/// <para>Default key bindings (when <see cref="Orientation"/> is <see cref="Orientation.Horizontal"/>):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left / Right</term> <description>Moves to the previous or next option.</description>
/// </item>
/// <item>
/// <term>Ctrl+Left / Ctrl+Right</term> <description>Moves by a larger step.</description>
/// </item>
/// </list>
/// <para>Default key bindings (when <see cref="Orientation"/> is <see cref="Orientation.Vertical"/>):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Up / Down</term> <description>Moves to the previous or next option.</description>
/// </item>
/// <item>
/// <term>Ctrl+Up / Ctrl+Down</term> <description>Moves by a larger step.</description>
/// </item>
/// </list>
/// <para>Common key bindings (both orientations):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Home / End</term> <description>Moves to the first or last option.</description>
/// </item>
/// <item>
/// <term>Enter</term> <description>Accepts the current selection (<see cref="Command.Accept"/>).</description>
/// </item>
/// <item>
/// <term>Space</term> <description>Activates the current selection (<see cref="Command.Activate"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class LinearRange : LinearRange<object>
{
/// <summary>
Expand All @@ -23,10 +64,50 @@ public LinearRange (List<object> options, Orientation orientation = Orientation.

/// <summary>
/// Provides a type-safe linear range control letting the user navigate from a set of typed options in a linear manner
/// using the
/// keyboard or mouse.
/// using the keyboard or mouse.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="T">The type of the options.</typeparam>
/// <remarks>
/// <para>Default key bindings (when <see cref="Orientation"/> is <see cref="Orientation.Horizontal"/>):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Left / Right</term> <description>Moves to the previous or next option.</description>
/// </item>
/// <item>
/// <term>Ctrl+Left / Ctrl+Right</term> <description>Moves by a larger step.</description>
/// </item>
/// </list>
/// <para>Default key bindings (when <see cref="Orientation"/> is <see cref="Orientation.Vertical"/>):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Up / Down</term> <description>Moves to the previous or next option.</description>
/// </item>
/// <item>
/// <term>Ctrl+Up / Ctrl+Down</term> <description>Moves by a larger step.</description>
/// </item>
/// </list>
/// <para>Common key bindings (both orientations):</para>
/// <list type="table">
/// <listheader>
/// <term>Key</term> <description>Action</description>
/// </listheader>
/// <item>
/// <term>Home / End</term> <description>Moves to the first or last option.</description>
/// </item>
/// <item>
/// <term>Enter</term> <description>Accepts the current selection (<see cref="Command.Accept"/>).</description>
/// </item>
/// <item>
/// <term>Space</term> <description>Activates the current selection (<see cref="Command.Activate"/>).</description>
/// </item>
/// </list>
/// </remarks>
public class LinearRange<T> : View, IOrientation
{
private readonly LinearRangeConfiguration _config = new ();
Expand Down
Loading
Loading