Commit Graph

25 Commits

Author SHA1 Message Date
BDisp
1b9b50dd12 merge develop branch 2022-12-04 20:07:39 +00:00
BDisp
4c8520ca08 Fixes #2228. Crash when attempting to open menu bar item with action but no menu items assigned. 2022-11-17 15:08:59 +00:00
BDisp
68c93ed540 Fixes #2225. MenuBar leaves trails when mounted in a Window. 2022-11-16 19:37:04 +00:00
Tig
e7bc9f5ff4 Fixed merge issue 2022-10-31 08:51:07 -07:00
Tig
44d0de016d Merge branch 'develop' into menuitem-disabled-select-fix 2022-10-31 08:48:08 -07:00
Tig Kindel
c1d976c781 refactored AssertDriverContents out of GraphView tests 2022-10-29 19:53:08 -06:00
BDisp
887a3b8b98 Fixes #2137. Disabled menu item is selected on click. 2022-10-26 16:13:48 +01:00
Charlie Kindel
6eac49383e Merge branch 'develop' into fix_2109_menubar_spacing 2022-10-21 16:04:36 -06:00
BDisp
802820edfa Fixes #2121. ContextMenu: When open, Shift-F10 should close menu. 2022-10-21 21:42:55 +01:00
Charlie Kindel
d93a247a4d documenting behavior 2022-10-21 08:12:26 -06:00
Charlie Kindel
40df03d3e3 Finished refactoring tests 2022-10-20 17:56:08 -06:00
Charlie Kindel
eb7fe9f126 further progress 2022-10-20 15:38:50 -06:00
Charlie Kindel
c15d9bcc57 refactoring menutests 2022-10-20 08:15:54 -06:00
BDisp
13948501d5 Fixes #1973. Avoid positioning Submenus off screen. (#1975)
* Fixes #1973. Avoid positioning Submenus off screen.

* Firstly avoids negative positions on the sub-menus and then avoids the bottom not exceeding the console height, as possible.
2022-09-05 07:17:58 -07:00
BDisp
63bcd2b1fc Fixes unit test after git rebase. 2022-07-04 11:22:27 -04:00
BDisp
4392f450da Fixes unit tests according to the changes. 2022-07-04 11:22:27 -04:00
BDisp
d84c4b285a Fixes #1825. Parent MenuItem stay focused if child MenuItem is empty. 2022-06-18 07:18:57 -07:00
BDisp
9dc40088bc UseKeysUpDownAsKeysLeftRight and UseSubMenusSingleFrame cannot be both true. (#1789)
* Fixes the throwing an exception if menu item is null.

* UseKeysUpDownAsKeysLeftRight and UseSubMenusSingleFrame cannot be both true.

* Refactoring the code.

* Trying fixing the Run_All_Scenarios unit test.

* Fixing typo to test again.

* Added Attribute suffix to he AutoInitShutdown class.
2022-06-12 09:09:41 -07:00
BDisp
c867d32a13 Fixes #1739. Setting menu UseKeysUpDownAsKeysLeftRight as false by default. (#1779)
* Fixes #1739. Setting menu UseKeysUpDownAsKeysLeftRight property as false by default.

* Fixed some more bugs and added support for UseKeysUpDownAsKeysLeftRight on the demo file.
2022-06-11 03:24:46 -07:00
BDisp
ed2c516702 Button pressed now close the menu and the menu length is the same with or without hot-keys 2022-05-07 16:14:26 +01:00
BDisp
d9f52fc2f2 Changing from AssertDriverContentsWithPosAre to AssertDriverContentsWithFrameAre to return a Rect. 2022-03-17 12:49:55 +00:00
BDisp
484e98998a Feature to display the sub-menus on a single frame instead multiple frames. 2022-03-17 12:49:43 +00:00
BDisp
a822e1afa9 Adds a popup ContextMenu feature. Implements ContextMenu for TextField. (#1615)
* Implementing ContextMenu feature to being popup by keyboard or mouse.

* Implements ContextMenu into TextField.

* Ensures the context menu's right and bottom frame from being greater than the container.

* Added Host property. Improving scenario and unit tests.

* Only draw the RightTee if it is at the end of the menu.

* Implements cursor visibility on TextField.

* Fixes the sub-menu not showing.

* Avoids draw the menu help and shortcut if there no available space.

* Remove reference for the MenuClosing event.

* UpdateCursor must only run after the ScreenBuffer is initialized to use the cursor visibility.

* Implements Resized event on Toplevel class.

* Prevents writing overlay on the menu.

* Covering more unit tests.

* Changing from Views to Core namespace.

* Implementing MenuClosingEventArgs and MenuAllClosed event.

* Only close the menu if it's open.

* Implementing localization for en-US and pt-PT to the FileDialog.

* Implementing localization for en-US and pt-PT on the TextField context menu.

* Fixes a bug where DeleteSelectedText is updating the Text before operation completion.

* Added a method to get all the supported cultures from the Terminal.Gui.

* Improving context menu and adding more unit tests.
2022-03-06 22:01:51 -08:00
Thomas Nind
ea7981dc59 Adds Key Binding support. Also refactors Autocomplete and Undo/Redo. (#1556)
* Refactored ProcessKey to use public methods for case logic

* Added KeyBinding class

* Refactored key binding to split key->command from command->implementation

This reduces duplication and simplifies the API

* Finishing key bindings implementation in ListView.

* Adding more unit tests to the ListView.

* Added key bindings to the Button and more features.

* Replaces Action for Func<KeyEvent, bool> on CommandImplementations.

* Allowing commands to have any number of arguments.

* Implementing key bindings on Checkbox view.

* Added test for changing HotKey in Button and made ReplaceKeyBinding protected

* Changed `CommandImplementations` to `Func<KeyEvent, bool>` to better understand current command implementations

* Implementing key bindings in ComboBox.

* Renamed Command keys and fixed ComboBox issues:

- Fixed pressing Esc in ListAndCombos scenario without selecting cause an array out of bounds error
- Changed the Esc key in ComboBox to also collapse the list selection
- Added bool return to public virtual method Expand and Collapse (this is a breaking change)

* Implementing key bindings in DateField.

* Organizing some things.

* Implementing key bindings on TimeField.

* No key bindings on FrameView.

* Added keybinding support to TreeView

* Added mouse support and more features.

* Updating NuGet packages.

* Putting text on the same line.

* Changing function command to Func<bool>.

* Added a read only Position, CursorPosition properties and events.

* Keybindings for GraphView

* Added a stream argument to ApplyEdits to only save the edits.

* Implementing key bindings on the HexView.

* Added MenuOpened event and others bug fixes.

* Fixing typo.

* Unifying constructors initializations.

* Implementing keybindings in the Menu.

* Removing unnecessary variable.

* Implementing keybindings in RadioGroup view.

* Changing Home to TopHome and End to BottomEnd.

* Implementing keybindings in the ScrollView.

* Changing the PageLeft and PageRight keybindings.

* Fixing PageLeft and RightPage.

* Removing CleanUp command.

* Key bindings for TabView

* Keybindings for TableView

* Fixed unit tests for PageDown to correctly assign input focus to the TableView

* Fixes the CalculateLeftColumn method avoiding jump two columns on forward moving.

* Fixes #1525. Gives the same backspace behavior as TextView.

* Changes kill-to-start key to work on Linux too.

* Fixes SelectedStart, SelectedText and some cleaning.

* Implementing keybindings in TextField.

* Updated command names and merged as discussed with @BDisp

- Merged LeftItem and LeftChar to Left (same for Right).
- Also renamed Kill to Cut
- Added ScrollLeft / ScrollRight (and renamed ScrollLineUp to just ScrollUp

* Renamed Command.InsertChar to ToggleOverwriteMode and added Enable/Disable

* Removed 'Mode' suffix from toggle overwrite

* Allows navigation to outside a TextView if IsMdiContainer is true.

* Implementing keybindings in Toplevel.

* Fixing null reference exception.

* Changing to keys instances events instead static.

* Transferring the events to the Toplevel.

* Implementing keybindings in TextView.

* Removing static from the QuitKeyChanged and adding unit test.

* Replacing Added with the Initialized event.

* Ignore control characters and other special keys.

* Changing InvokeKeybindings to return Nullable bool and added two more keys to the Toplevel.

* Implementing keybindings in Autocomplete. I had to derive from View.

* Added keybindings menu item to UICatalog

* Added ClearBinding

* Implementing IAutocomplete, abstract Autocomplete and derived TextViewAutocomplete.

* Implementing keybindings in the TextValidateProvider

* Add keybinding to CellActivationKey.

* Fixing some formats.

* Add ObjectActivationKey to the keybindings.

* Made it much easier to implement abstract base `Autocomplete` in other views by moving methods up out of `TextViewAutocomplete` implementation

* Allowing Autocomplete to popup inside or outside the container.

* Fixes the cursor not being showing if the text length is equal to the view width.

* A unit test to prove the 4df5897.

* Removed unused method `GetCursorPosition` from Autocomplete

* Trimmed down implementation specific methods from IAutocomplete

* Fixed xmldoc comment tag

* Format Autocomplete on multiline and fixes wrap settings.

* Adding keys from a to z to avoid the Key.Space on ToString.

* Fixes the vertical position outside the container.

* Adding more key unit tests.

* Changing comment to upper case and proving that doesn't will breaking nothing.

* Replaces Pos.Bottom to Pos.AnchorEnd.

* Fixes popup on resizing.

* Should only using the Pos.Bottom to position outside the view.

* Fixes #1584

* Fixes https://github.com/migueldeicaza/gui.cs/issues/1584#issuecomment-1027987475

* Fixes some bugs with SelectedItem.

* Command must also return a nullable bool.

* Ensures updating the ComboBox text on leaving the control.

* Only with the nullable bool was possible to make the MoveUp and the MoveDown working.

* Added logging of which scenario failed in test

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2022-02-08 10:40:40 -08:00
BDisp
ff962b64df Added MenuOpened event and others bug fixes. (#1572)
* Added MenuOpened event and others bug fixes.

* Fixing typo.

* Unifying constructors initializations.
2022-02-06 14:38:11 -08:00