Commit Graph

12 Commits

Author SHA1 Message Date
Tig
6851b42a49 Fixes #2921 - MainLoop refactoring (#2922)
* Adds basic MainLoop unit tests

* Remove WinChange action from Curses

* Remove WinChange action from Curses

* Remove ProcessInput action from Windows MainLoop

* Simplified MainLoop/ConsoleDriver by making MainLoop internal and moving impt fns to Application

* Modernized Terminal resize events

* Modernized Terminal resize events

* Removed un used property

* for _isWindowsTerminal devenv->wininit; not sure what changed

* Modernized mouse/keyboard events (Action->EventHandler)

* Updated OnMouseEvent API docs

* Using WT_SESSION to detect WT

* removes hacky GetParentProcess

* Updates to fix #2634 (clear last line)

* removes hacky GetParentProcess2

* Addressed mac resize issue

* Addressed mac resize issue

* Removes ConsoleDriver.PrepareToRun, has Init return MainLoop

* Removes unneeded Attribute methods

* Removed GetProcesssName

* Removed GetProcesssName

* Refactored KeyEvent and KeyEventEventArgs into a single class

* Revert "Refactored KeyEvent and KeyEventEventArgs into a single class"

This reverts commit 88a00658db.

* Fixed key repeat issue; reverted stupidity on 1049/1047 confusion

* Updated CSI API Docs

* merge
2023-10-21 08:06:04 -07:00
Tigger Kindel
1c133ba364 Refactored CheckTimers into MainLoop and renamed/simplified 2023-10-05 22:21:59 -06:00
Thomas Nind
e2feeefa93 Fixes #2663 - No more nested classes (#2664)
* Move all public nested classes out into own files

* Move more nested classes out

* Tidy up and treat CA1034 as an error.  Fix remaining nested classes.

* Remove partial keyword from ThemeManager as it is no longer needed

* Rename Bar to BarSeriesBar to more clearly indicate it is part of GraphView subsystem

* Fix xmldoc references

* Revert nesting changes to ConsoleDrivers

* Change to file scoped namespaces and revert renames

- LineCanvasCell back to just Cell
- ApplicationRunState back to just RunState

* Switch to file scoped namespaces
2023-05-23 13:42:47 +02:00
Tig
4d6781e5f9 Fixes #2649 - Unit Tests on Windows are failing (#2650)
* attempt to fix

* Removed unneeded ToString() calls

* Forced all unit tests to use FakeClipboard
2023-05-21 17:45:02 +02:00
BDisp
713b2c4725 Fixes #92. Remove dependency on ustring. (#2620)
* Remove NStack and replace ustring to string.

* Add unit test and improving some code.

* Adjust code and fix all unit tests errors.

* Add XML Document and move the Rune folder into the Text folder.

* Improve unit tests with byte array on DecodeRune and DecodeLastRune.

* Fix unit test.

* 😂Code review

* Reduce unit tests code.

* Change StringExtensions.Make to StringExtensions.ToString and added some more unit tests.

* Fix merge errors.

* Remove GetTextWidth and calls replaced with StringExtensions.GetColumns.

* Hack to use UseSystemConsole passed in the command line arguments.

* Revert "Hack to use UseSystemConsole passed in the command line arguments."

This reverts commit b74d11c786.

* Remove Application.UseSystemConsole from the config file.

* Fix errors related by removing UseSystemConsole from the config file.

* Fixes #2633. DecodeEscSeq throw an exception if cki is null.

* Fix an exception if SelectedItem is -1.

* Set SelectedItem to 0 and remove unnecessary ToString.

* Using a unique ToString method for Rune and other for byte.

* Fix a bug where a wider rune is added with only a width of 1.

* Force the SelectedGlyph is the one that was typed after jumpList is executed.

* Added more InlineData to RuneTests.

* Reducing significantly the code by using Theory attribute in the TextFormatterTests.

* Override PositionCursor to handle the CharMap cursor position.

* Fix merge errors.

* Minor tweaks to API docs

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
2023-05-20 19:35:32 +02:00
Tig
dea5f0fe03 Fixes #2597. Enables standard glyphs to be set via ConfigurationManager (#2595)
* initial

* basically working

* removed test settings

* removed extra usings

* Improved API docs

* Renamed glyphs to be consistent and use unicode names; use char literals

* Refactored Glyphs class & Json format to not be static (startup perf)

* Refactored Glyphs class & Json format to not be static (startup perf)

* Fixed a bunch of API doc errors

* Switched checked/selected to glyhps from box drawing range

* Switched button glyphs to nicer looking ones that seem to work on standard fonts

* Upgraded LineDrawing scenario

* CrossHair->Cross

* Fixed unit tests

* Fixed unit tests; moved Glyphs from Application to ConfigurationManager; added CM global using alias

* Found and replaced all other special glyphs; fixed more unit tests
2023-05-07 07:34:02 +02:00
BDisp
105ff9ab54 Fixes #2569. Borders scenarios needed to be refactored. (#2570)
* Fixes #2569. Borders scenarios needed to be refactored.

* Fix border title with width equal to 4 and thickness top grater than 1.

* Improves border manipulation on borders scenarios.

* Prevents null value on the margin, border and padding thickness on the border scenarios.

* Remove NStack using dependence and fix prior commit.

* Refactoring the Frames scenario.

* Deleted borders scenarios.

* I did not realize that it was changed to SetSubViewNeedsDisplay.

* Re-layout; fixed colorpicker; fixed radio group

* Remove Thickness.IsEmpty as requested.

* Change the Frames scenario as requested.

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
2023-05-01 07:00:51 +02:00
Nutzzz
1bc25900e7 Add additional LineStyles (#2533)
* Add additional LineStyles

* Fix WizardTests because of renamed runes

* BorderFrame -> Border

* Fix the layout of Border Scenarios

* Fix for LineCanvas clipping

Based on comment https://github.com/gui-cs/Terminal.Gui/pull/2533#issuecomment-1508982468

* Update LineCanvasTests.cs

* Rename Thick border to Heavy

(less confusion with "Thickness")
Also:
* Add a few more runes for potential future use
* Fix Unit Tests

* Fix LineDrawing scenario to use 1 unit longer lines (matching new LineCanvas API).

* Fix LineDrawing scenario to better match mouse cursor location

---------

Co-authored-by: tznind <tznind@dundee.ac.uk>
2023-04-17 09:31:45 -06:00
Tig
b4552ee14b Fixes #2493. Move all layout code out of View (and Toplevel) into a layout helper class (#2544)
* Comment/warning clean up

* Moved Text and Drawing out

* Moved Layout out

* Removed extra lines

* Removed Mouse out

* Reorgainzed View

* API docs

* removed border.cs

* TopLevel.Resized -> TerminalResized

* Mdi -> Overlapped

* Removed confusing and un-needed WillPresent

* privates -> _

* Tweaked RunLoop API
2023-04-14 10:26:10 -06:00
Tig
8c59e8255f Partially Fixes #2483 - Removes old Border and leverages LineCanvas for Frames, etc... (#2527)
* POC

* View.DrawFrame now uses LineCanvas

* Fixes #2531. Toplevel should redraw only if it's needed.

* Fix toplevel when mdi is enabled preventing clear the screen twice.

* Massive LineCanvis updates

* Fixes #2534. Bounds isn't updating when the Frame is changed.

* Almost everything works!

* Had to disable a few tests but all unit test now pass again

* Deleted ConsoleDriver.DrawWindowFrame; hacked ProgressBar

* Deleted ConsoleDriver.DrawWindowTitle; moved to Frame.DrawTitle

* Renames BorderFrame to Border

* Removed old commented code

* Tweaked scenario

* Added auto convert \r\n to Enviornment.NewLine in TestHelpers.AssertEqual

* Fix merge errors.

* Fix AssertEqual newlines to platform-specific.

* Refactored frames drawing; view adds to its lineview, superview renders them

* New titlebar style based on Border.Top size; fixed bugs

* wzard bug

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2023-04-13 15:35:01 -06:00
Tig
a637f8a29c Fixes #2486 - Removes old Border and fixes a litany of related things (#2525)
* Added View.BorderStyle and renamed BorderStyle enum to LineStyle

* Fixed a lot of things and broke everything else

* Fixed things

* Updated DialogTests

* Updates including Rect unit tests

* Fixed Dialog & MessagBox tests

* Fixed AllviewsTester bug

* Fixed AllviewsTester bug

* Removed Border class

* Renamed View privates with _

* Removed comments in MessageBox.cs
2023-04-10 17:34:52 -06:00
Tig
574ed8fec7 Fixes #2469 - Revamp file structure and namespace (#2471)
* initial commit

* All tests pass

* Updated readme

* Revert "All tests pass"

This reverts commit 94ac462350.

* Revert "initial commit"

This reverts commit 36d92cc4e5.

* Moved Terminal.Gui files around

* Nuked .Graphs namespace

* Nuked .Graphs namespace

* Nuked .Trees namespace

* Nuked .Configuration namespace

* Nuked .Configuration namespace

* All tests pass

* tweaked tests

* removed unneeded usings

* re-enabled scrollview tests

* move scrollview test to ScrollViewTests

* Moved view navigation related tests to separate cs file

* Moved view scrollbarview related tests ScrollBarTestse

* Refactored View tests into smaller files

* Refactored driver tests

* Fixed a ton of BUGBUGs
2023-04-06 10:09:21 -06:00