Replies: 22 comments 19 replies
-
#2358 -
|
Beta Was this translation helpful? Give feedback.
-
#2431 - v1 incorrectly allowed views to reference subviews in
|
Beta Was this translation helpful? Give feedback.
-
#92 - Removed Dependency on
|
Beta Was this translation helpful? Give feedback.
-
#2406 Events now use
|
Beta Was this translation helpful? Give feedback.
-
#2259 FileDialog (and Open/Save) rewrite.SummaryThe following new features have been added (see below). These changes have made it necessary to change the method signatures for
How To FixThe breaking changes are:
Consider the following example usage: using Terminal.Gui;
Application.Init();
var dlg = new SaveDialog("Save my file",
- "Save your file my friend",
- new List<string> { ".csv" });
+ new List<IAllowedType> {
+ new AllowedType("Comma Separated File",".csv")
+ });
Application.Run(dlg);
if(!dlg.Canceled)
{
- MessageBox.Query("File Chosen", $"You chose {dlg.FilePath} or possibly {dlg.DirectoryPath}","Ok");
+ MessageBox.Query ("File Chosen", $"You chose {dlg.Path}", "Ok");
}
Application.Shutdown(); |
Beta Was this translation helpful? Give feedback.
-
#2581 / #2576 TableView data model now uses an interface
|
Beta Was this translation helpful? Give feedback.
-
#2577 ReDraw is now DrawSummaryThe draw events have been refactored. How To FixRename ReDraw to Draw and remove the - v.Redraw (v.Bounds);
+ v.Draw (); |
Beta Was this translation helpful? Give feedback.
-
#2595 Driver.HLine, Driver.VLine etc are now in ConfigurationManager.GlyphsSummaryAll character definitions are now in the This was done to support end user configuration of glyphs (for accessibility, font variation support etc). How To FixIf you access runes via - Driver.HLine
+ ConfigurationManager.Glyphs.HLine If you accessed via - Application.Driver.HLine
+ ConfigurationManager.Glyphs.HLine In the UICatalog demo application, ConfigurationManager is aliased as CM. You can do this by adding the following line to your code (see below). This allows you to access glyphs with global using CM = Terminal.Gui.ConfigurationManager; |
Beta Was this translation helpful? Give feedback.
-
#2620 ustring removed (now uses System.Text.Rune)SummaryUpstream library How To FixReplace - using NStack;
+ using System.Text; Anywhere you have an implicit cast from - myView.AddRune(col, row, '▄');
+ myView.AddRune(col, row, new Rune('▄')); When measuring the screen space taken up by a - Rune.ColumnWidth(rune);
+ rune.GetColumns(); When measuring the screen space taken up by a - myString.Sum(c=>Rune.ColumnWidth(c));
+ myString.GetColumns(); When creating |
Beta Was this translation helpful? Give feedback.
-
We should update the |
Beta Was this translation helpful? Give feedback.
-
#2664 No more nested classesSummaryAll public classes that were previously nested classes are now in the root namespace as their own classes. How To FixReplace references to to nested types with the new standalone version - var myTab = new TabView.Tab();
+ var myTab = new Tab(); |
Beta Was this translation helpful? Give feedback.
-
#2452 ListView now defaults to 'no selection'SummaryPreviously How To FixIf you are using the int selected = this.listView.SelectedItem;
- if ( selected >= this.collection.Count)
+ if (selected < 0 || selected >= this.collection.Count)
{
return null;
}
return this.collection[selected]; Additionally if you want the initial element to be selected upon focusing or opening the user interface you can manually set the this.listView.SelectedItem = 0; |
Beta Was this translation helpful? Give feedback.
-
Here is the breaking change template:
|
Beta Was this translation helpful? Give feedback.
-
'View' now supports 'Frames' with adornments; 'Bounds' no longer equals 'Frame'; 'Border' is completely changed.SummaryThe architecture of 'View' has been refactored. Apps will need to be updated to: How to fix
|
Beta Was this translation helpful? Give feedback.
-
Color (Attribute) changesSummarySome methods to do with How To FixStatic class Attribute.Make has been removed. Use constructor instead - var c = Attribute.Make(Color.BrightMagenta, Color.Blue);
+ var c = new Attribute(Color.BrightMagenta, Color.Blue) - var c = Color.Brown;
+ var c = Color.Yellow; |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Root Event ChangesSummaryGlobal event handlers for key/mouse no longer use the How To Fix- Application.RootKeyEvent += (k) =>
+ Application.KeyPressed += (s,k) =>
{
if (this.SomeCondition)
{
// Suppress
- return true;
+ k.Handled = true;
+ return;
}
... |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Just in case this thread is still being used: #3209 is going to result in many dozens of breaking changes, due to removal of many previously public methods and an overhaul of almost everything to do with events. |
Beta Was this translation helpful? Give feedback.
-
We should start putting these in https://gui-cs.github.io/Terminal.GuiV2Docs/docs/newinv2.html Found here: We should be doing this within PRs. |
Beta Was this translation helpful? Give feedback.
-
Any new breaking changes should be documented here as part of a PR: https://gui-cs.github.io/Terminal.GuiV2Docs/docs/migratingfromv1.html |
Beta Was this translation helpful? Give feedback.
-
Hello all - i am in the process of migrating my app from v1 to v2 and i wanted to add some things that could go in the Migration document.
If i come across any others i will update this post. |
Beta Was this translation helpful? Give feedback.
-
Per this discussion I'm creating this thread to be the place where we document breaking changes in v2 and guidance for developers to migrate v1 code.
Let's make each breaking change a separate post within this discussion.
Beta Was this translation helpful? Give feedback.
All reactions