Skip to content

Commit de9301d

Browse files
authored
Merge pull request #5354 from gui-cs/release/v2.2.2
2 parents 06c0a9e + e956484 commit de9301d

61 files changed

Lines changed: 1775 additions & 3594 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Implementing `IValue<T>` requires `ValueChanging`, `ValueChanged`, and `ValueCha
385385
|Button|Class|Text,Accept event,IsDefault
386386
|Label|Class|Text display,TextAlignment
387387
|TextField|Class|Single-line input,Text,Secret
388-
|TextView|Class|Multi-line editor,Text,ReadOnly
388+
|Editor|Class|Multi-line editor,Text,ReadOnly
389389
|CheckBox|Class|CheckedState,AllowCheckStateNone
390390
|DropDownList|Class|Dropdown,Source,SelectedItem
391391
|ProgressBar|Class|Fraction,BidirectionalMarquee

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<PackageVersion Include="System.IO.Abstractions" Version="22.1.1" />
2727
<PackageVersion Include="System.CommandLine" Version="2.0.7" />
2828
<PackageVersion Include="Wcwidth" Version="4.0.1" />
29+
<PackageVersion Include="Terminal.Gui.Editor" Version="2.2.1-develop.133" />
2930
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.4" />
3031
<PackageVersion Include="AnsiConsoleToHtml" Version="0.2.0" />
3132
<PackageVersion Include="ColorHelper" Version="1.8.1" />

Examples/NativeAot/NativeAot.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<ProjectReference Include="..\..\Terminal.Gui\Terminal.Gui.csproj" />
1212
</ItemGroup>
1313

14+
<ItemGroup>
15+
<PackageReference Include="Terminal.Gui.Editor" />
16+
</ItemGroup>
17+
1418
<!-- Link AOT-safe editor files from UICatalog (no reflection, no heavy deps) -->
1519
<ItemGroup>
1620
<Compile Include="..\UICatalog\Scenarios\EditorsAndHelpers\ExpanderButton.cs" Link="Editors\ExpanderButton.cs" />

Examples/NativeAot/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Diagnostics.CodeAnalysis;
1313
using System.Globalization;
1414
using Terminal.Gui.Configuration;
15+
using Terminal.Gui.Editor;
1516
using UICatalog.Scenarios;
1617

1718
namespace NativeAot;
@@ -192,7 +193,7 @@ public AotAllViewsWindow ()
192193
yield return Design (new Tabs ());
193194
yield return Design (new TextField ());
194195
yield return Design (new TextValidateField ());
195-
yield return Design (new TextView ());
196+
yield return Design (new Editor ());
196197
yield return Design (new TreeView ());
197198

198199
// ── Views without IDesignable (still AOT-relevant as config hosts or common views) ──

Examples/NativeAot/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ infrastructure is also AOT-safe.
1818
Views tested: `Button`, `CheckBox`, `ColorPicker`, `DatePicker`, `DropDownList`,
1919
`FlagSelector`, `GraphView`, `HexView`, `Label`, `Line`, `Link`, `ListView`,
2020
`NumericUpDown`, `OptionSelector`, `ProgressBar`, `ScrollBar`, `Shortcut`, `SpinnerView`,
21-
`Tabs`, `TextField`, `TextValidateField`, `TextView`, `TreeView`, `CharMap`, `FrameView`,
21+
`Tabs`, `TextField`, `TextValidateField`, `Editor`, `TreeView`, `CharMap`, `FrameView`,
2222
`MenuBar`, `Menu`, `StatusBar`, `MessageBox` (via dialog), `Dialog` (via `Wizard` base).
2323

2424
## Publishing

Examples/PromptExample/Program.cs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Terminal.Gui.Configuration;
88
using Terminal.Gui.Drawing;
99
using Terminal.Gui.Drivers;
10+
using Terminal.Gui.Editor;
1011
using Terminal.Gui.Resources;
1112
using Terminal.Gui.ViewBase;
1213
using Terminal.Gui.Views;
@@ -60,31 +61,29 @@
6061
mainWindow.Add (textFieldButton);
6162

6263
// Example 1: TextField with string result using auto-Text extraction
63-
Button textViewButton = new () { Title = "TextView (Auto-Text)", X = Pos.Center (), Y = buttonY++ };
64+
Button editorButton = new () { Title = "Editor (Auto-Text)", X = Pos.Center (), Y = buttonY++ };
6465

65-
textViewButton.Accepting += (_, _) =>
66-
{
67-
string? result = mainWindow.Prompt<TextView, string> (beginInitHandler: prompt =>
68-
{
69-
prompt.Title = textViewButton.Title;
66+
editorButton.Accepting += (_, _) =>
67+
{
68+
string? result = mainWindow.Prompt<Editor, string> (beginInitHandler: prompt =>
69+
{
70+
prompt.Title = editorButton.Title;
7071

71-
prompt.GetWrappedView ().Text =
72-
"Some text\nis nice.";
73-
prompt.GetWrappedView ().Width = Dim.Fill (0, 40);
74-
prompt.GetWrappedView ().Height = Dim.Fill (0, 8);
72+
prompt.GetWrappedView ().Text = "Some text\nis nice.";
73+
prompt.GetWrappedView ().Width = Dim.Fill (0, 40);
74+
prompt.GetWrappedView ().Height = Dim.Fill (0, 8);
7575

76-
if (!string.IsNullOrEmpty (initialValueField.Text))
77-
{
78-
((IValue)prompt.GetWrappedView ())
79-
.TrySetValueFromString (initialValueField
80-
.Text);
81-
}
82-
});
76+
if (!string.IsNullOrEmpty (initialValueField.Text))
77+
{
78+
((IValue)prompt.GetWrappedView ())
79+
.TrySetValueFromString (initialValueField.Text);
80+
}
81+
});
8382

84-
MessageBox.Query (app, textViewButton.Title, result is { } ? $"You entered: {result}" : "Canceled", Strings.btnOk);
85-
};
83+
MessageBox.Query (app, editorButton.Title, result is { } ? $"You entered: {result}" : "Canceled", Strings.btnOk);
84+
};
8685

87-
mainWindow.Add (textViewButton);
86+
mainWindow.Add (editorButton);
8887

8988
// Example 2: DatePicker with DateTime result
9089
Button datePickerButton = new () { Title = "DatePicker (Typed Result)", X = Pos.Center (), Y = buttonY++ };
@@ -297,7 +296,7 @@ FormData ExtractFormData (View form)
297296
// Result type for custom form
298297
internal record FormData
299298
{
300-
public string Name { get; init; } = string.Empty;
301299
public int Age { get; init; }
302300
public bool Agreed { get; init; }
301+
public string Name { get; init; } = string.Empty;
303302
}

Examples/PromptExample/PromptExample.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
<ProjectReference Include="..\..\Terminal.Gui\Terminal.Gui.csproj" />
1313
</ItemGroup>
1414

15+
<ItemGroup>
16+
<PackageReference Include="Terminal.Gui.Editor" />
17+
</ItemGroup>
18+
1519
</Project>

Examples/UICatalog/Scenarios/Adornments.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#nullable enable
2+
using Terminal.Gui.Editor;
23

34
// ReSharper disable AccessToDisposedClosure
45

@@ -78,16 +79,16 @@ public override void Main ()
7879

7980
button.Accepting += (_, _) => MessageBox.Query (appWindow.App!, "Hi", $"Am I a {window.GetType ().Name}?", Strings.btnNo, Strings.btnYes);
8081

81-
TextView label = new ()
82+
Editor editor = new ()
8283
{
8384
X = Pos.Center (),
8485
Y = Pos.Bottom (button),
8586
Title = "Title",
86-
Text = "I have a 3 row top border.\nMy border inherits from the SuperView.",
8787
Width = 40,
8888
Height = 6 // TODO: Use Dim.Auto
8989
};
90-
label.Border.Thickness = new Thickness (1, 3, 1, 1);
90+
editor.Text = "I have a 3 row top border.\nMy border inherits from the SuperView.";
91+
editor.Border.Thickness = new Thickness (1, 3, 1, 1);
9192

9293
Button btnButtonInWindow = new () { X = Pos.AnchorEnd (), Y = Pos.AnchorEnd (), Text = "Button" };
9394

@@ -106,10 +107,10 @@ public override void Main ()
106107

107108
window.Border.GetOrCreateView ();
108109

109-
//window.Border.View.Text = "Border Text";
110+
// window.Border.View.Text = "Border Text";
110111
window.Border.Thickness = new Thickness (3);
111112

112-
//window.Border.View?.SetScheme (SchemeManager.GetScheme (Schemes.Dialog));
113+
// window.Border.View?.SetScheme (SchemeManager.GetScheme (Schemes.Dialog));
113114

114115
window.Border.Settings = BorderSettings.Tab | BorderSettings.Title;
115116
window.BorderStyle = LineStyle.Rounded;
@@ -183,7 +184,7 @@ public override void Main ()
183184

184185
Label longLabel = new () { X = 40, Y = 5, Title = "This is long text (in a label) that should clip." };
185186
longLabel.TextFormatter.WordWrap = true;
186-
window.Add (tf1, color, button, label, btnButtonInWindow, labelAnchorEnd, longLabel);
187+
window.Add (tf1, color, button, editor, btnButtonInWindow, labelAnchorEnd, longLabel);
187188

188189
window.Initialized += (_, _) =>
189190
{

0 commit comments

Comments
 (0)