Commit Graph

15 Commits

Author SHA1 Message Date
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
BDisp
c348cda317 Fixes #2987. Set a MdiChild visible to false still processes keystrokes. (#2988) 2023-11-15 08:29:26 -07:00
usr
a8d2f8d733 Fixes #2913 - remove Disposed views from Responder.instances when Debugging (#2914)
* fix issue #2913

* remove disposed instances from responder.instances (optional)

* Ensures only clear Instances if they really was disposed.

* Fix unit tests.

* Update RunStateTests.cs

Minor format change to trigger new Unittest execution

* Fixes Pos/Dim static fields not being disposing.

---------

Co-authored-by: John Züchler <john.zuechler@eks-intec.de>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
2023-10-25 07:02:46 -06: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
6e458559e2 Finally the Enter and Leave events has the correct sequence. 2023-08-15 17:56:57 +01:00
BDisp
4f635ffab4 Add unit test to use the Enter and Leave events between two views on two toplevels. 2023-08-15 17:03:39 +01:00
BDisp
de909b86cd Fix a bug where a focused view was receiving the Leave event. 2023-08-15 16:29:07 +01:00
BDisp
65851ad527 Fixes #2810. Pressing Alt key on a Toplevel with only a MenuBar throws System.InvalidOperationException. 2023-08-15 13:07:06 +01:00
BDisp
bdf9ec112c Fix unit test method name. 2023-08-11 13:21:21 -06:00
BDisp
1c633efbad Fix unit test because OnLeave is now invoked on toplevel removing, preventing two views having focus. 2023-08-11 13:21:21 -06:00
BDisp
8c7fce0472 Fix extra bracket. 2023-08-11 13:21:21 -06:00
BDisp
b13247342a Add unit test. 2023-08-11 13:21:21 -06:00
BDisp
9cfa78a033 Fixes #2354. View.Redraw doesn't clear itself and PositionCursor doesn't ensure focus when a prior view was disabled. (#2355)
* Fixes #2354. View should have a IgnoreHasFocusPropertyOnRedraw property to prevent unnecessary derived class.

* Removed IgnoreHasFocusPropertyOnRedraw property.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-02-21 14:23:40 +13:00
BDisp
057bbcaea8 Fixes #2326. Invisible cursor after modal dialog. 2023-02-06 23:47:09 +00:00
Tig Kindel
7454dac942 Reorg of unit tests 2023-01-15 18:33:38 -07:00