Commit Graph

90 Commits

Author SHA1 Message Date
Tigger Kindel
1f209098dd diagnosing netdriver wsl 2023-08-12 10:39:17 -06:00
Tigger Kindel
06f7a9898e fixed WindowsDriver to work in linux unit tests 2023-08-12 10:39:17 -06:00
Tigger Kindel
a23a33f20c Unit tests 2023-08-12 10:39:17 -06:00
Tigger Kindel
cd81c927fa Debugging conhost 2023-08-12 10:39:17 -06:00
Tigger Kindel
293161bca1 TrueColor in NetDriver now works 2023-08-12 10:39:17 -06:00
Tigger Kindel
bc22a80a4a Removed unused var 2023-08-12 10:39:17 -06:00
Tigger Kindel
dd75d4ea9f Initial commit 2023-08-12 10:39:17 -06:00
Tig
0df485a890 Fixes #666. Refactor ConsoleDrivers to simplify and remove duplicated code (#2612)
* Added ClipRegion; cleaned up driver code

* clip region unit tests

* api docs

* Moved color stuff from ConsoleDriver to Color.cs

* Removes unused ConsoleDriver APIs

* Code cleanup and Removes unused ConsoleDriver APIs

* Code cleanup and Removes unused ConsoleDriver APIs

* Work around https://github.com/gui-cs/Terminal.Gui/issues/2610

* adjusted unit tests

* initial commit

* Made Rows, Cols, Top, Left virtual

* Made Clipboard non-virtual

* Made EnableConsoleScrolling  non-virtual

* Made Contents non-virtual

* Pulled Row/Col up

* Made MoveTo virtual; fixed stupid FakeDriver cursor issue

* Made CurrentAttribute non-virtual

* Made SetAttribute  non-virtual

* Moved clipboard code out

* Code cleanup

* Removes dependecy on NStack from ConsoleDrivers - WIP

* Fixed unit tests

* Fixed unit tests

* Added list of unit tests needed

* Did some perf testing; tweaked code and charmap to address

* Brough in code from PR #2264 (but commented)

* Tons of code cleanup

* Fighting with ScrollView

* Fixing bugs

* Fixed TabView tests

* Fixed View.Visible test that was not really working

* Fixed unit tests

* Cleaned up clipboard APIs in attempt to track down unit test failure

* Add Cut_Preserves_Selection test

* Removed invalid code

* Removed invalid test code; unit tests now pass

* EscSeq* - Adjusted naming, added more sequences, made code more consistent, simplified, etc...

* Added CSI_SetGraphicsRendition

* NetDriver code cleanup

* code cleanup

* Cleaned up color handling in NetDriver

* refixed tabview unit test

* WindowsDriver color code cleanup

* WindowsDriver color code cleanup

* CursesDriver color code cleanup

* CursesDriver - Adding _BOLD has no effect. Further up the stack we cast the return of ColorToCursesColor from int to short and the _BOLD values don't fit in a short.

* CursesDriver color code - make code more accurate

* CursesDriver color code - make code more accurate

* Simplified ConsoleDriver.GetColors API

* Simplified ConsoleDriver.GetColors API further

* Improved encapslation of Attribute; prep for TrueColor & other attributes like blink

* Fixes #2249. CharacterMap isn't refreshing well non-BMP code points on scroll.

* Use GetRange to take some of the runes before convert to string.

* Attempting to fix unit tests not being cleaned up

* Fixes #2658 - ConsoleDriver.IsRuneSupported

* Fixes #2658 - ConsoleDriver.IsRuneSupported (for WindowsDriver)

* Check all the range values and not only the max value.

* Reducing code.

* Fixes #2674 - Unit test process doesn't exit

* Changed Cell to support IsDirty and list of Runes

* add support for rendering TrueColor output on Windows merging veeman & tznind code

* add colorconverter changes

* fixed merged v2_develop

* Fixing merge bugs

* Fixed merge bugs

* Fixed merge bugs - all unit tests pass

* Debugging netdriver

* More netdriver diag

* API docs for escutils

* Update unicode scenario to stress more stuff

* Contents: Now a 2D array of Cells; WIP

* AddRune and ClearContents no longer virtual/abstract

* WindowsDriver renders correctly again

* Progress on Curses

* Progress on Curses

* broke windowsdriver

* Cleaned up FakeMainLoop

* Cleaned up some build warnings

* Removed _init from AutoInitShutdown as it's not needed anymore

* Removed unused var

* Removed unused var

* Fixed nullabiltiy warning in LineCanvas

* Fixed charmap crash

* Fixes #2758 in v2

* Port testonfail fix to v2

* Remove EnableConsoleScrolling

* Backport #2764 from develop (clear last line)

* Remove uneeded usings

* Progress on unicode

* Merged in changes from PR #2786, Fixes #2784

* revamp charmap rendering

* Charmap option to show glyph widths

* Fixed issue with wide glpyhs being overwritten

* Fixed charmap startcodepoint change issue

* Added abiltiy to see ncurses verison/lib

* Fought with CursesDriver; giving up for now. See notes.

* Leverage Wcwidth nuget library instaed of our own tables

* enhanced charmap Details dialog

* Final attempt at fixing curses

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: adstep <stephensonadamj@gmail.com>
2023-08-09 14:28:36 -06:00
BDisp
24ce90812f Fixes #2659. Cursor always invisible with NetDriver on Windows. (#2660)
* Fixes #2659. Cursor always invisible with NetDriver on Windows.

* Prefix private members with underscore and rename Initialize to SetInitialProperties.

* Reset _visibility private member after validation.

* Hide cursor during screen update.
2023-05-23 00:03:51 +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
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
BDisp
a7c13b5d48 Fixes merge conflicts errors. 2023-03-01 23:10:05 +00:00
BDisp
1d2dc40c8a Fixes #2305. Improves the handling of escape sequence. (#2375)
* Changed ansi esc sequence used on exit.

* Changed ansi esc sequence used on exit.

* Improves HeightAsBuffer although currently only works on Windows.

* Fixes #2267. Toplevel.EnsureVisibleBounds throws an exception if border is null.

* Changing comment as requested.

* Fixes indentation.

* Seems not needed for now, maybe some update, comment for now.

* Renamed HeightAsBuffer to EnableConsoleScrolling and made it obsolete.

* Add comment on remarks for EnableConsoleScrolling.

* merged @bdisp's EnableConsoleScrolling PR

* Fixes buffer for Windows Terminal.

* Fixes issue in Windows Terminal on resizing causing some lines not be drawing after exceptions.

* merge #9

* merged #9

* use ESC [ ? 1047

* Tweaks with new esc codes

* Fixed curses driver to not nuke scroll buffer and to resize properly

* merge

* Cleand up netdriver escape codes

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed merge issue and  spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed spaces->tabs

* fixed  build error

* removed old comments

* Resolving merge conflicts.

* Ensuring reset the EnableConsoleScrolling.

* Changing from HeightAsBuffer to EnableConsoleScrolling.

* Done requested changes.

* Reformatting.

* Rename to EscSeqReqStatus.

* Removing Console.Out.Flush ();

---------

Co-authored-by: Charlie Kindel <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
2023-02-25 15:30:44 -07:00
Tig Kindel
2b26ec7bfb merge fixes 2023-02-07 16:33:22 +09:00
Tig Kindel
4531eb00d2 more cleanup 2023-02-06 11:56:53 +09:00
Tig Kindel
de5af990df removed unused Cook/UncookMouse APIs 2023-02-06 11:28:33 +09:00
Tig Kindel
0dcc69023e removed unused GetColors api 2023-02-06 11:26:36 +09:00
Tig Kindel
ed7cb3d429 removed unused GetColors api 2023-02-06 11:25:29 +09:00
BDisp
788eed4a4d Fixes #2317. Drivers do not normalize accented letters. 2023-02-05 00:25:14 +00:00
Chris Pacejo
cb7c1be8bc fix output of non-BMP Unicode characters in NetDriver 2022-11-05 00:52:09 -04:00
BDisp
abd9d47860 Added support to handle with the virtual packet key. 2022-10-30 21:02:24 +00:00
BDisp
389d0be6bd Added abstract MakeColor and CreateColors to create the colors at once. (#1972)
* Added abstract MakeColor and CreateColors to create the colors at once.

* Adjusting colors to contrast with almost all views.

* Reverting Border unit test.

* Removing commented color code.
2022-09-05 12:47:16 -07:00
Tig Kindel
666c2e151a Fix 1773 again (#1938)
* fixes #1773 - better hotnormal color for listview

* Other drivers

* fixed curses driver
2022-08-04 08:26:39 -07:00
BDisp
9ee3502c61 Added public abstract ResizeScreen method to the ConsoleDriver. 2022-06-17 10:23:50 -07:00
BDisp
d16f0f607f Fixes some console buffer size issue on resizing reported in #1768. (#1784) 2022-06-11 03:18:33 -07:00
Freddie Mercurial (Jessica M.)
68b40a93f1 Exposes APIs to support upcoming Web console feature (#1770)
* Implementations to allow a WebConsole feature

* Preventing application hanging on the RunLoop.

* Implementations to allow a WebConsole feature

* Preventing application hanging on the RunLoop.

* Making WantContinuousButtonPressedView public.

* Added TimeoutAdded event.

* Fixes unit test for WantContinuousButtonPressedView.

* Changes as requested resolved.

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2022-06-08 13:05:06 -07:00
BDisp
ad2b5a9ba2 Removed AlwaysSetPosition and fix some wide runes issue. 2022-05-13 19:27:04 +01:00
BDisp
460f1714fa Adding Left to the WindowPositionEvent for eventual future use. 2022-05-11 16:10:56 +01:00
BDisp
4382a2c2c2 Fixes remaining wide runes render issues. 2022-05-11 00:24:57 +01:00
BDisp
89a622e78e Standardizing in the same way as the others drivers. 2022-05-04 01:13:00 +01:00
BDisp
1d0852f952 Preventing future throw exceptions on "VT101 with No Options". 2022-05-03 01:09:10 +01:00
BDisp
311acc03df Fixes drivers for wide runes handling which also works on Windows Terminal. 2022-04-30 01:03:41 +01:00
BDisp
e8fd8c503c Fixes wide runes not render well on NetDriver. 2022-04-08 00:58:47 +01:00
BDisp
e3bb7d6089 Fixes #1502. Prevents high CPU usage. (#1504)
* Fixes keys modifiers not reseting and enter key on Windows Terminal.

* Fixes summary warnings.

* Ensures MainIteration processes  input while count greater than zero.

* Adding UseSystemConsole to the launch settings profile.

* Improves the performance with Console.Write by writing faster.

* Fixes #1502. Prevents high CPU usage.

* Added a HACK comment.

* Allowing NetDriver attributes to deal with more stuff than only colors.

* Allows append more escape sequences if necessary.
2021-12-18 05:22:24 -08:00
BDisp
2ef4edd08e NetDriver fixes keys modifiers not reseting and enter key on Windows Terminal. (#1484)
* Fixes keys modifiers not reseting and enter key on Windows Terminal.

* Fixes summary warnings.

* Ensures MainIteration processes  input while count greater than zero.

* Adding UseSystemConsole to the launch settings profile.

* Improves the performance with Console.Write by writing faster.
2021-10-25 12:31:49 -07:00
BDisp
d55ae77331 Fixes #1446. Added more features to the Border and Toplevel focus. (#1447)
* Fixes #1446. Added more features to the Border and Toplevel focus.

* Prevents throwing exception on negative effect3DOffset values

* Ensures that a view can be focused.

* Only sets focus if it isn't disposing.

* Fixes ViewToScreen and DrawChildBorder Effect3D.

* Unit test for negative coordinates with the ViewToScreen method.

* Added Tab navigation feature to the Editor scenario.

* ComboBox cursonDownKey nullref fix (#1472)

* added null guard to fix null ref when pressing keyDown inside combobox
Improved an error message when view cannot be found

* Added a unit test to ensure combobox can process all key events
Found and fixed a new nullref

* Found a new bug when source is already present and combobox is added to a top view

* searchSet is auto initialized to new List() now to make the code a little bit safer

* Fixes WindowsDriver HeightAsBuffer set to false. (#1466)

* Bump ReportGenerator from 4.8.12 to 4.8.13 (#1473)

Bumps [ReportGenerator](https://github.com/danielpalme/ReportGenerator) from 4.8.12 to 4.8.13.
- [Release notes](https://github.com/danielpalme/ReportGenerator/releases)
- [Commits](https://github.com/danielpalme/ReportGenerator/compare/v4.8.12...v4.8.13)

---
updated-dependencies:
- dependency-name: ReportGenerator
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixes #1445. Fixing more the Curses and WSL clipboard. (#1448)

* Fixes #1445. Fixing more the Curses and WSL clipboard.

* Fixing unit tests.

* Changing namespace.

* Fixes WSL2 clipboard unit test.

* Upgrades devcontainer with the MainLoop fix.

* Fixes pasting with no selection and with lines break.

* Prevents the event button click being fired after a button pressed with mouse move.

* Fixes the char [ not being processed.

* Added Application.QuitKey property to allow change the quitting application key. (#1450)

* Added Application.QuitKey property to allow change the quitting application key.

* Fixes QuitKey unit test by reseting his value.

* Locks timeouts until is added.

* Fixes #1467. AlternateForward/BackwardKey bypasses dialog modality (#1468)

* Changed namespace.

* Fixing merge conflicts.

* Fixes mouse click issue.

* Removing windows resizing because buffer resizing is enough.

* Fixes #1477. Mouse click and console bottom on Windows Terminal.

Co-authored-by: Igor Bagdamyan <37334640+En3Tho@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-05 09:22:13 -07:00
BDisp
84f79b2326 Fixes #1445. Fixing more the Curses and WSL clipboard. (#1448)
* Fixes #1445. Fixing more the Curses and WSL clipboard.

* Fixing unit tests.

* Changing namespace.

* Fixes WSL2 clipboard unit test.

* Upgrades devcontainer with the MainLoop fix.

* Fixes pasting with no selection and with lines break.

* Prevents the event button click being fired after a button pressed with mouse move.

* Fixes the char [ not being processed.
2021-09-29 14:22:23 -07:00
BDisp
8bfa2f0425 Border feature (#1436)
* Allowing pass the view to the RootMouseEvent.

* Allowing bring the current window to front on dragging.

* Improving the ConsoleDriver to get the Attribute colors based on the value.

* Added a PanelView to deal with borders.

* Added a Border feature to all views.
2021-08-26 07:55:19 -07:00
BDisp
c604fcb30a NetDriver triple click bug fix. (#1422) 2021-08-24 08:22:31 -07:00
BDisp
52f48b2044 Fixes #1384. Added a VisibleChanged event on the View class. (#1385)
* Fixes #1384. Added a VisibleChanged event on the View class.

* Getting the last char.

* Fixes #871. Added Enable property to Responder and added Disabled color for all ColorSchemes.

* Added GetNormalColor method to the View being more readable.

* Fixes the contentBottomRightCorner Enable and Visible.

* Fixes #643. Added AddItemAt and RemoveItem to StatusBar and fixed more bugs.

* Typo fixes.

* Fixes #1387. Allowing the UnitTests project to test internal keywords.

* Fixes #1389. Added a unidirectional feature to the Marquee styles to the ProgressBar.

* Fixes #1394. Added ReflectedType to check for overridden.

* Fixes #1396. Using the Loaded event instead the Ready event.

* Fixes #1402. Only WindowsDriver supports horizontal scroll. (#1403)

* Fixes #1402. Only WindowsDriver supports horizontal scroll.

* Fixes ProcessContinuousButtonPressedAsync on all drivers.

* Fixed internal unit test.

* Fixing warning.

* Fixing Editor scenario error.

* Fixes double and triple click on a touchpad.

* Ensuring reset the counting.

* Allowing touchpad double and triple click with one finger on CursesDriver.

* Allowing touchpad double and triple click with one finger on WindowsDriver.

* Fixes #1414. Fixed multi toplevels and mdi container issues.

* Improving EnsureVisibleBounds and PositionToplevel.

* Added mouseGrabView to the ResetState method.

* Changing namespace.

* Allowing file type on the SaveDialog.

* Fixes SaveDialogs writing the extension twice.
2021-08-11 02:56:30 -07:00
BDisp
b193aaaa56 Fixes #1402. Only WindowsDriver supports horizontal scroll. (#1403)
* Fixes #1402. Only WindowsDriver supports horizontal scroll.

* Fixes ProcessContinuousButtonPressedAsync on all drivers.
2021-08-04 21:54:33 -07:00
Charlie Kindel
0413a93bf3 Merge pull request #1319 from BDisp/clipboard-linux-fix
Fixes #1318. Ensures that the OS clipboard is always sets.
2021-05-30 07:32:45 -06:00
BDisp
105e2a0dc4 Prevents WindowSize event from being always triggered in Netdriver unnecessarily. 2021-05-27 17:21:51 +01:00
BDisp
87271cc477 Implemented the ClipboardBase abstract class as suggested by @tznind. 2021-05-25 18:49:30 +01:00
BDisp
f60458cc6b Fixes #983. Improving clipboard with interaction with the OS. 2021-05-20 01:27:42 +01:00
BDisp
4af48392cc Fixes #1281. Fixed CursesDriver colors. Added BasicColors scenario. (#1282)
* Fixes #1281. Fixed CursesDriver colors. Added BasicColors scenario.

* Normalizing NetDriver too.

* Fixing others colors.
2021-05-06 10:29:50 -07:00
BDisp
c27da1b982 Fixes #1210. Added AllowsReturn, AllowsTab and Multiline into the TextView. (#1249)
* Fixes #1234. Setting Handled to true in the KeyPress event avoids ProcessKey from running.

* Using literals values in Assert.Equal.

* Can't use numbers variables on the left side of an Assert.Equal/NotEqual, it must be literal (Linux only).

* Fixes #1241. Added SendKeys feature to the ConsoleDriver.

* Fixes SendKeys unit test.

* Changed Key.Null to '\0' (null string).

* Fixes the space bar when there are another previous char.

* Now the drivers are reading up to 255 from ASCII table.

* Fixes CursesDriver and WindowsDriver SendKeys.

* Fixes NetDriver SendKeys.

* Fixed unit test.

* Fixes #1210.  Added AllowsReturn, AllowsTab and Multiline into the TextView.

* Added a Single Line and Multiline toggle to the Text.cs scenario.

* Removing comment.
2021-04-27 08:48:35 -07:00
BDisp
ae2f713e23 Fixes #1206. NetDriver now print the selected text. Attribute struct now create a valid Value for the current driver. Insert key is detected by NetDriver. (#1207) 2021-04-14 08:31:01 -07:00
BDisp
b8bb453992 Fixes #1185. Button click is only processed if there are no mouse mov… (#1186)
* Fixes #1185. Button click is only processed if there are no mouse movement after a button pressed and the released.

* Fixes an alt + hotkey issue that were sent separately instead of one shipping only.
2021-04-13 13:38:07 -07:00
Gilles Freart
21e24e9467 Preparing PR 2021-01-28 17:16:41 +01:00