Replies: 23 comments 19 replies
#2358 -
|
#2431 - v1 incorrectly allowed views to reference subviews in
|
#92 - Removed Dependency on
|
#2406 Events now use
|
#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(); |
#2581 / #2576 TableView data model now uses an interface
|
#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 (); |
#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.HLineIf you accessed via - Application.Driver.HLine
+ ConfigurationManager.Glyphs.HLineIn 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; |
#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 |
|
We should update the |
#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(); |
#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; |
|
Here is the breaking change template: |
'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
|
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; |
|
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;
}
... |
|
|
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. |
|
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. |
|
Any new breaking changes should be documented here as part of a PR: https://gui-cs.github.io/Terminal.GuiV2Docs/docs/migratingfromv1.html |
|
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. |
|
Rename any properties you declare on views called |



Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions