Commit Graph

550 Commits

Author SHA1 Message Date
BDisp
108afa97b8 Fix size in the scenario. 2024-04-11 17:30:55 +01:00
BDisp
b57b1f32ab Fixes #2865. Unknown character sequence while resizing terminal. (#2951)
* Fixes #2865. Unknown character sequence while resizing terminal.

* Added USE_IOCTL definition for toggle.

* Explaining that is a CSI (Esc[) = 27;91.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-12-19 16:44:44 -07:00
BDisp
85c92f4b0d Fixes #2959. Some of the scroll features on v1 are broken. (#2960)
* Add GrabMouseEventArgs for GrabbingMouse and UnGrabbingMouse events.

* Implementing GrabbingMouse and UnGrabbingMouse in Toplevel class.

* Fix contentBottomRightCorner to draw with the right color.

* Fix a typo.

* Fix ListView to allow scrolling.

* Add a comment to explain an extra column for the cursor at the end of line.

* Add unit tests for GrabbingMouse and UnGrabbingMouse events.

* Add unit test for a Window inside a non Toplevel.

* Removes GrabMouseEventArgs.

* Prevents throwing an exception if not subscribed.

* GrabMouse must be first called before set the dragPosition.

* Add unit test to test null on GrabbingMouse and UnGrabbingMouse.

* Fix event name.

* Prevents a toplevel to overflows his bounds to allow it can be drag.

* Fix unit test.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-11-16 07:14:55 -07:00
usr
c7942ae3bb Fix issue where the TestViewsDisposeCorrectly was not doing what it was supposed to do (#2964)
* add Disposal Test and fix an ssue where the CopyClipboard test was failing

* Update ViewDisposalTest.cs

* Update ViewDisposalTest.cs: Some Formatting, and adding code comments.

* Fix ViewDisposalTests (Wasn't working the way it was supposed to)

* update test

* update test

* update test

* try to fix as many conflicts as possible

* make test output prettier

* fix formatting

* Fix Subviews not being empty after disposing on all views.

* The fail cause was Application.Top not being disposed.

* Fix others containers that weren't being removed.

* Revert "The fail cause was Application.Top not being disposed."

This reverts commit 0c2183ed9e.

* Application.Top isn't null and need disposing.

* Fixes #2985. Application.RunState must be responsible for dispose the Toplevel property.

* Change the unit test with ans without Application.Shutdown method.

* Update ViewDisposeTests to actually check wether ALL views have been disposed (not just container)

* small additional check just to be safe

* Update ViewDisposalTest.cs: Formatting

* Update ViewDisposalTest.cs: Minor change to re-trigger Action

TestVKPacket is acting up again. Maybe the test is running async and is receiving scan codes from other instances?

---------

Co-authored-by: John Züchler <john.zuechler@eks-intec.de>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
2023-11-15 09:22:22 -07:00
BDisp
3e1637aac8 Fixes #2775. Something in 1.13 broke centering child windows. (#2778)
* Fixes #2776. Pressing Alt key on a Window with only a MenuBar throws System.InvalidOperationException.

* Add unit test.

* Fix extra bracket.

* Prevents throw exception if Application.Current is null.

* Fix unit test because OnLeave is now invoked on toplevel removing, preventing two views having focus.

* Fix unit test method name.

* Fix Window by not layout on his subviews when adding a new view after the Application.Begin was already running.

* FindAndOpenMenuByHotkey now search inside Menus and inside his Children.

* Add unit test for Window LayoutSubviews and FindAndOpenChildrenMenuByHotkey menu method.

* Prevents button to be clear when it's invisible.

* Fixes 2780. Moving a Window that is Application.Top shouldn't be allowed.

* Fix condition if Window and Application.Top.

* Always LayoutSubviews and PositionToplevels after Clear.

* Fixes #2787. MenuItem with CanExecute returning false is select when a MenuBar is opened.

* Leveraging the power of CanExecute feature.

* Fixes #2789. StatusItem should have a disabled attribute if it can't execute.

* Allows positioning a child window outside the limits of the menu and the status bar.

* Change to a more appropriate name.

* Simplifies all the run actions.

* Prevents open menu bar if it's invisible and close all opened menus.

* Fix mdi run loop.

* Fix hot key on mdi toplevels.

* Fix position on mdi toplevels.

* Fix Top.Redraw by set state.Toplevel.SetNeedsDisplay if it's needed to redraw.

* Fix MdiTop by repainted when a keystroke is generated by keyboard.

* Rename local fields.

* Force redraw if application.Top needs display.

* Added more features to the scenario.

* Change the scenarios to run as Application.Top instead of sub-views.

* Add a new scenario similar but as Mdi Container.

* Add a bunch of new unit tests to prove all this PR.

* Only it's need to redraw Application.Top if it's a Mdi Container.

* Remove unnecessary code.

* Unit test that proves that a MDI child leaves no trace when the location is changed.

* Removes unnecessary Application.Init because theses uses Run<T> which already call it.

* Ensures a menu bar been closed after run an action.

* Ensures that another view can be focused if not IsMenuOpen and LastFocused is null, instead of focused the menu itself.

* Ensures a focused contentview subview being focused if MostFocused is null.

* Ensures a MdiTop subview to have priority if it's focused and thus  make it Current.

* Allow a MdiChild be closed when pressing Application.QuitKey.

* More unit tests proving the changes.

* Ensures the top.MostFocused is focused.

* Ensures MdiChild on the front if MdiTop.MostFocused isn't valid, like ContentView.

* Add unit test showing MdiChild on the front.

* Fix an issue where NullReferenceException can be throws everywhere while get the Application.MdiChildes property.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-10-17 13:34:28 -04:00
BDisp
a45d65bbdd Fixes #2847. CursesDriver doesn't processing response from task threading. 2023-08-31 19:03:05 +01:00
BDisp
48a73b4756 Fixes #2739. UICatalog Text Editor Column / Row not be updated when cursor moving. (#2740) 2023-07-12 08:45:03 -07:00
Maciej
7936dd1e85 Add table example check to prevent crashes (#2691)
Co-authored-by: Tig <tig@users.noreply.github.com>
2023-07-05 16:52:13 -06:00
Thomas Nind
8f199cd765 Add ITreeViewFilter (#2599)
Co-authored-by: Tig <tig@users.noreply.github.com>
2023-05-10 06:37:24 +02:00
BDisp
ed27696b9e Fixes 2342. Border: can't change border color in window by Border.BorderBrush. (#2345)
* Fixes 2342. Border: can't change border color in window by Border.BorderBrush.

* Fixes border initialization.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-02-25 15:26:04 -07:00
Thomas Nind
40af5ed98a Adds Snake Scenario (#2353)
* Add empty snake scenario

* Move snake head around

* Snake now has a tail

* Rest of logic implementation

* Ctrl K D layout fixes

* Game gets faster as you collect more apples

* Adjust speed increase rate down

* Use white on black for snake and border and red for apple

* Fix ScenarioTests not Disposing Scenario

* Add disposes and fix to use LineCanvas.GenerateImage

* Fix stack overflow, doh!

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-02-21 11:59:46 +13:00
BDisp
c85ff954aa Illustrates #2331 (Scrollview not respecting clip) does not reproduce (#2332)
* Proves that the issue #2331 don't have reason to happen.

* fixes #2336

* Fixes #2331. ScrollView may not be honoring clip region; CustomButton shows outside

* More appropriate solution for the issue #2331.

* Start refactoring LineCanvas for mixing line style support (e.g. double into single)

* Add remaining resolvers

* Implement corner border style mixing in LineCanvas

* Refactor and simplify resolvers

* Move tests to Core folder and namespace to Terminal.Gui.CoreTests

* Fixes #2333. TextField is selecting badly a word on double click.

* Add unit test deleting a word with accented char.

* Fixes 2331. ScrollView may not be honoring clip region.

* Add a custom button scenario.

* Fixes #2350. Clipping broke (see Clipping scenario).

* Is preferable use NeedDisplay instead of Bounds.

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
Co-authored-by: tznind <tznind@dundee.ac.uk>
2023-02-21 00:53:38 +13:00
Tig
81d3ad8aeb Merge pull request #2352 from tznind/animation
Adds Animation Scenario
2023-02-20 22:29:49 +13:00
Thomas Nind
1e5ab49827 Merge branch 'develop' into line-canvas-fix-offsets 2023-02-19 17:06:21 +00:00
Thomas
0e84090c31 Add caching and comments 2023-02-18 07:56:45 +00:00
Thomas
8371a74bf9 CC attribution 2023-02-17 23:18:20 +00:00
Thomas
2b0d14f41f Resizing 2023-02-17 23:12:48 +00:00
Thomas
db38b35bb7 spinning world 2023-02-17 22:56:02 +00:00
tznind
c28d97f203 Add gif 2023-02-17 22:10:40 +00:00
tznind
81a892ad11 Add image scenario 2023-02-17 22:09:29 +00:00
Thomas
85a4471004 Remove the Draw method from LineCanvas and make GenerateImage easier to use 2023-02-14 22:11:18 +00:00
BDisp
721a8873b0 Removed Color.Invalid and added more unit tests. 2023-02-14 18:32:06 +00:00
BDisp
276ffe0343 Fixes #2348. The Basic Colors scenario doesn't output the blue on white properly. 2023-02-13 20:52:00 +00:00
Tig
27ea1e14c0 Merge branch 'develop' into line-drawer 2023-01-22 07:38:54 -07:00
tznind
ab398b93cb Make OnTabClicked fire for clicks in empty space and fix Notepad to only show context menu on right click. 2023-01-21 08:31:17 +00:00
tznind
553cd6f66f Adds TabView.TabClicked event 2023-01-20 19:30:36 +00:00
Thomas Nind
16a3c0b8ae Merge branch 'develop' into line-drawer 2023-01-18 17:25:03 +00:00
Thomas
8f41296e78 Tidy up LineCanvas
Rename Drawing Scenario
Make API simpler by directly referencing Application.Driver
2023-01-18 17:20:33 +00:00
tznind
7fefe44dbd Enable rounded corners in Drawing scenario 2023-01-08 11:57:25 +00:00
tznind
56b22be00f Add tests 2023-01-08 11:48:32 +00:00
tznind
3702c07b04 Rename to LineCanvas 2023-01-08 10:54:37 +00:00
tznind
ab5f4ccfb5 Add support for double lines into StraightLineCanvas 2023-01-07 07:40:23 +00:00
tznind
b708150eda Flesh out drawing scenario 2023-01-07 07:26:07 +00:00
tznind
fb0958dabd Implement rest of StraightLineCanvas 2023-01-07 06:46:59 +00:00
Charlie Kindel
a0b36d3457 merged develop 2022-12-04 08:09:27 -07:00
Tig
00df975751 Merge branch 'develop' into mouse-grab-dim-2219 2022-12-04 08:02:45 -07:00
Tig
bafb4bbd5f Merge pull request #2183 from cpacejo/fix-nonbmp
Fixes #2182. Fix output of non-BMP Unicode characters in NetDriver.
2022-12-04 07:54:48 -07:00
Tig
e8e07a184c Merge pull request #2243 from tznind/tablecol-visible
Fixes #1465.  TableView columns can now be hidden via `ColumnStyle.Visible`
2022-12-04 07:54:14 -07:00
tznind
6a932f6fae Fix whitespace 2022-12-04 14:50:09 +00:00
Thomas Nind
4120e1e39f Merge branch 'develop' into csv-robust 2022-12-04 14:43:51 +00:00
tznind
8a6dfe75db Merge branch 'develop' into csv-robust 2022-12-04 14:41:37 +00:00
Tig
6664a4a162 Merge branch 'develop' into tablecol-visible 2022-12-04 07:19:01 -07:00
tznind
f362e40ca0 Add sort to context menu and fix naming of context items when they are sorted 2022-12-03 19:59:52 +00:00
tznind
6136656327 Added context menu for show/hide columns in TableEditorScenario 2022-12-03 19:49:42 +00:00
BDisp
b917064bb0 Merge branch 'develop' into csv-editor-fix 2022-12-03 19:45:30 +00:00
tznind
643e53b575 Add column sorting to TableEditor 2022-11-22 10:57:03 +00:00
BDisp
bffc9cb2e8 Fix a label width size issue. 2022-11-17 18:01:03 +00:00
BDisp
a37e2d4134 Fixes #2219. Moving a grab a top with a superview fails with Dim. 2022-11-12 01:27:45 +00:00
Charlie Kindel
8c99cde92c Prep for broader ConsoleDriver tests 2022-11-11 11:24:43 -07:00
BDisp
8cf7a3514d Fixes bug related with allowed type files filter in FileDialog. 2022-11-09 23:00:50 +00:00