Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed May 29, 2024
2 parents 5ec744f + 85a759c commit d774f62
Show file tree
Hide file tree
Showing 23 changed files with 129 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
continue-on-error: false

- name: Setup Pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
fetch-depth: 0 # fetch-depth is needed for GitVersion

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
uses: gittools/actions/gitversion/setup@v1
with:
versionSpec: '5.x'
includePrerelease: true

- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
uses: gittools/actions/gitversion/execute@v1
with:
useConfigFile: true
#additionalArguments: /b develop
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0
dotnet-version: 8.0
dotnet-quality: 'ga'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion Example/Example.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<!-- Version numbers are automatically updated by gitversion when a release is released -->
<!-- Do not modify these. -->
<FileVersion>1.0.0.0</FileVersion>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dotnet run

_The Documentation matches the most recent Nuget release from the `main` branch ([![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui))_

See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured. The [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/articles/index.html) provides insight into core concepts.
See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured. The [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/docs/index.html) provides insight into core concepts.

## Features

Expand Down
4 changes: 2 additions & 2 deletions ReactiveExample/ReactiveExample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<!-- Version numbers are automatically updated by gitversion when a release is released -->
<!-- Do not modify these. -->
<!--<AssemblyVersion>1.14.0.0</AssemblyVersion>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="ReactiveUI" Version="19.5.41" />
<PackageReference Include="ReactiveUI" Version="20.1.1" />
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions Showcase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
![PoshDotnetDumpAnalyzerViewer.png](docfx/images/PoshDotnetDumpAnalyzerViewer.png)
* **[TerminalGuiDesigner](https://github.com/tznind/TerminalGuiDesigner)** - Cross platform view designer for building Terminal.Gui applications.
![TerminalGuiDesigner.gif](docfx/images/TerminalGuiDesigner.gif)
![TerminalGuiDesigner.gif](docfx/images/TerminalGuiDesigner.gif)

* **[Capital and Cargo](https://github.com/dhorions/Capital-and-Cargo)** - A retro console game where you buy, sell, produce and transport goods built with Terminal.Gui
![image](https://github.com/gui-cs/Terminal.Gui/assets/1682004/ed89f3d6-020f-4a8a-ae18-e057514f4c43)


# Examples #

* **[C# Example](https://github.com/gui-cs/Terminal.Gui/tree/master/Example)** - Run `dotnet run` in the `Example` directory to run the C# Example.
* **[F# Example](https://github.com/gui-cs/Terminal.Gui/tree/master/FSharpExample)** - An example showing how to build a Terminal.Gui app using F#.
* **[Reactive Example](https://github.com/gui-cs/Terminal.Gui/tree/master/ReactiveExample)** - A sample app that shows how to use `System.Reactive` and `ReactiveUI` with `Terminal.Gui`. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUI `WhenAnyValue` syntax and [Pharmacist](https://github.com/reactiveui/pharmacist) — a tool that converts all events in a NuGet package into observable wrappers.
* **[Reactive Example](https://github.com/gui-cs/Terminal.Gui/tree/master/ReactiveExample)** - A sample app that shows how to use `System.Reactive` and `ReactiveUI` with `Terminal.Gui`. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUI `WhenAnyValue` syntax and [Pharmacist](https://github.com/reactiveui/pharmacist) — a tool that converts all events in a NuGet package into observable wrappers.
1 change: 1 addition & 0 deletions Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ void ProcessInput ()
keyHandler (key);
} else {
k = Key.Esc;
keyDownHandler (new KeyEvent (k, MapKeyModifiers (k)));
keyHandler (new KeyEvent (k, MapKeyModifiers (k)));
}
} else if (wch == Curses.KeyTab) {
Expand Down
4 changes: 1 addition & 3 deletions Terminal.Gui/Core/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,7 @@ public static RunState Begin (Toplevel toplevel)
if (refreshDriver) {
MdiTop?.OnChildLoaded (toplevel);
toplevel.OnLoaded ();
Redraw (toplevel);
toplevel.PositionCursor ();
Driver.Refresh ();
Refresh ();
}

NotifyNewRunState?.Invoke (rs);
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/Core/Clipboard/Clipboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public static ustring Contents {
Application.Driver.Clipboard.SetClipboardData (value.ToString ());
}
contents = value;
} catch (NotSupportedException e) {
throw e;
} catch (NotSupportedException) {
throw;
} catch (Exception) {
contents = value;
}
Expand Down
8 changes: 4 additions & 4 deletions Terminal.Gui/Core/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,13 @@ public enum MouseFlags {
/// </summary>
WheeledDown = unchecked((int)0x20000000),
/// <summary>
/// Vertical button wheeled up while pressing ButtonShift.
/// Vertical button wheeled up while pressing ButtonCtrl.
/// </summary>
WheeledLeft = ButtonShift | WheeledUp,
WheeledLeft = ButtonCtrl | WheeledUp,
/// <summary>
/// Vertical button wheeled down while pressing ButtonShift.
/// Vertical button wheeled down while pressing ButtonCtrl.
/// </summary>
WheeledRight = ButtonShift | WheeledDown,
WheeledRight = ButtonCtrl | WheeledDown,
/// <summary>
/// Mask that captures all the events.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Core/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public int TabIndex {
} else if (SuperView?.tabIndexes == null || SuperView?.tabIndexes.Count == 1) {
tabIndex = 0;
return;
} else if (tabIndex == value) {
} else if (tabIndex == value && TabIndexes.IndexOf (this) == value) {
return;
}
tabIndex = value > SuperView.tabIndexes.Count - 1 ? SuperView.tabIndexes.Count - 1 : value < 0 ? 0 : value;
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Terminal.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.1;net7.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0;netstandard2.1;net7.0;net8.0</TargetFrameworks>
<RootNamespace>Terminal.Gui</RootNamespace>
<AssemblyName>Terminal.Gui</AssemblyName>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/ComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ private void Reset (bool keepSearchText = false)
listview.SetSource (searchset);
listview.Height = CalculatetHeight ();

if (Subviews.Count > 0) {
if (HasFocus && Subviews.Count > 0) {
search.SetFocus ();
}
}
Expand Down
5 changes: 3 additions & 2 deletions Terminal.Gui/Views/ListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,8 @@ int GetMaxLengthItem ()

void RenderUstr (ConsoleDriver driver, ustring ustr, int col, int line, int width, int start = 0)
{
var u = TextFormatter.ClipAndJustify (ustr, width + start, TextAlignment.Left);
ustring str = start > ustr.ConsoleWidth ? string.Empty : ustr.Substring (Math.Min (start, ustr.ToRunes ().Length - 1));
ustring u = TextFormatter.ClipAndJustify (str, width, TextAlignment.Left);
driver.AddStr (u);
width -= TextFormatter.GetTextWidth (u);
while (width-- + start > 0) {
Expand All @@ -876,7 +877,7 @@ void RenderUstr (ConsoleDriver driver, ustring ustr, int col, int line, int widt
public void Render (ListView container, ConsoleDriver driver, bool marked, int item, int col, int line, int width, int start = 0)
{
var savedClip = container.ClipToBounds ();
container.Move (col - start, line);
container.Move (Math.Max (col - start, 0), line);
var t = src? [item];
if (t == null) {
RenderUstr (driver, ustring.Make (""), col, line, width);
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/ScrollView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public override void Redraw (Rect region)
{
Driver.SetAttribute (GetNormalColor ());
SetViewsNeedsDisplay ();
//Clear ();
Clear ();

var savedClip = ClipToBounds ();
OnDrawContent (new Rect (ContentOffset,
Expand Down
4 changes: 4 additions & 0 deletions Terminal.Gui/Windows/Wizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,10 @@ public bool GoToStep (WizardStep newStep)
var oldStep = currentStep;
currentStep = newStep;

if (currentStep is null) {
return false;
}

UpdateButtonsAndTitle ();

// Set focus to the nav buttons
Expand Down
6 changes: 5 additions & 1 deletion Terminal.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=669e5282_002Dfb4b_002D4e90_002D91e7_002D07d269d04b60/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=CAF4ECB3AC41AE43BD233D613AC1562C/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=CAF4ECB3AC41AE43BD233D613AC1562C/AbsolutePath/@EntryValue">Terminal.sln.DotSettings</s:String>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=CAF4ECB3AC41AE43BD233D613AC1562C/RelativePath/@EntryValue"></s:String>
Expand All @@ -125,4 +128,5 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 1 addition & 1 deletion UICatalog/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ENV LANG=en_US.UTF-8 \
DISPLAY=:0
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["Terminal.Gui/Directory.Build.props", "Terminal.Gui/"]
COPY ["UICatalog/UICatalog.csproj", "UICatalog/"]
Expand Down
4 changes: 2 additions & 2 deletions UICatalog/Scenarios/ListViewWithSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public override void Setup ()
};

_listView.DrawContent += (e) => {
_scrollBar.Size = _listView.Source.Count - 1;
_scrollBar.Size = _listView.Source.Count;
_scrollBar.Position = _listView.TopItem;
_scrollBar.OtherScrollBarView.Size = _listView.Maxlength - 1;
_scrollBar.OtherScrollBarView.Size = _listView.Maxlength;
_scrollBar.OtherScrollBarView.Position = _listView.LeftItem;
_scrollBar.Refresh ();
};
Expand Down
8 changes: 4 additions & 4 deletions UICatalog/UICatalog.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<StartupObject>UICatalog.UICatalogApp</StartupObject>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand All @@ -20,9 +20,9 @@
<None Update="./Scenarios/Spinning_globe_dark_small.gif" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="CsvHelper" Version="31.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
</ItemGroup>
<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<!-- https://stackoverflow.com/questions/294216/why-does-c-sharp-forbid-generic-attribute-types -->
<!-- for AutoInitShutdown attribute -->
<LangVersion>Preview</LangVersion>
Expand All @@ -18,15 +18,15 @@
<DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="ReportGenerator" Version="5.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="ReportGenerator" Version="5.3.4" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
77 changes: 77 additions & 0 deletions UnitTests/Views/ViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,79 @@ public void TabIndex_Set_CanFocus_False_To_True ()
Assert.True (r.TabIndexes.IndexOf (v1) == 1);
}

[Fact]
public void TabIndex_Invert_Order ()
{
var r = new View ();
var v1 = new View () { Id = "1", CanFocus = true };
var v2 = new View () { Id = "2", CanFocus = true };
var v3 = new View () { Id = "3", CanFocus = true };

r.Add (v1, v2, v3);

v1.TabIndex = 2;
v2.TabIndex = 1;
v3.TabIndex = 0;
Assert.True (r.TabIndexes.IndexOf (v1) == 2);
Assert.True (r.TabIndexes.IndexOf (v2) == 1);
Assert.True (r.TabIndexes.IndexOf (v3) == 0);

Assert.True (r.Subviews.IndexOf (v1) == 0);
Assert.True (r.Subviews.IndexOf (v2) == 1);
Assert.True (r.Subviews.IndexOf (v3) == 2);
}

[Fact]
public void TabIndex_Invert_Order_Added_One_By_One_Does_Not_Do_What_Is_Expected ()
{
var r = new View ();
var v1 = new View () { Id = "1", CanFocus = true };
r.Add (v1);
v1.TabIndex = 2;
var v2 = new View () { Id = "2", CanFocus = true };
r.Add (v2);
v2.TabIndex = 1;
var v3 = new View () { Id = "3", CanFocus = true };
r.Add (v3);
v3.TabIndex = 0;

Assert.False (r.TabIndexes.IndexOf (v1) == 2);
Assert.True (r.TabIndexes.IndexOf (v1) == 1);
Assert.False (r.TabIndexes.IndexOf (v2) == 1);
Assert.True (r.TabIndexes.IndexOf (v2) == 2);
// Only the last is in the expected index
Assert.True (r.TabIndexes.IndexOf (v3) == 0);

Assert.True (r.Subviews.IndexOf (v1) == 0);
Assert.True (r.Subviews.IndexOf (v2) == 1);
Assert.True (r.Subviews.IndexOf (v3) == 2);
}

[Fact]
public void TabIndex_Invert_Order_Mixed ()
{
var r = new View ();
var vl1 = new View () { Id = "vl1" };
var v1 = new View () { Id = "v1", CanFocus = true };
var vl2 = new View () { Id = "vl2" };
var v2 = new View () { Id = "v2", CanFocus = true };
var vl3 = new View () { Id = "vl3" };
var v3 = new View () { Id = "v3", CanFocus = true };

r.Add (vl1, v1, vl2, v2, vl3, v3);

v1.TabIndex = 2;
v2.TabIndex = 1;
v3.TabIndex = 0;
Assert.True (r.TabIndexes.IndexOf (v1) == 4);
Assert.True (r.TabIndexes.IndexOf (v2) == 2);
Assert.True (r.TabIndexes.IndexOf (v3) == 0);

Assert.True (r.Subviews.IndexOf (v1) == 1);
Assert.True (r.Subviews.IndexOf (v2) == 3);
Assert.True (r.Subviews.IndexOf (v3) == 5);
}

[Fact]
public void TabStop_And_CanFocus_Are_All_True ()
{
Expand Down Expand Up @@ -1173,6 +1246,10 @@ public void KeyPress_Handled_To_True_Prevents_Changes ()

Application.Run ();

// Ensures cleaning any keystroke.
// This was conflicting with the TestVKPacket unit test
Console.MockKeyPresses.Clear ();

// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk":{
"version":"7.0.200",
"version":"8.0.204",
"rollForward":"latestMinor"
}
}

0 comments on commit d774f62

Please sign in to comment.