Commit Graph

134 Commits

Author SHA1 Message Date
José Miguel Perricone
819dc291bc Feature TextValidateField (#1230)
* Feature TextValidateField

* Fix Mouse Click

* Fix Mouse click on TextRegexProvider

* UiCatalog fields with text alginment centered

* Fix Mouse click on TextRegexProvider when right aligned

* added newline to text.cs catalog

* NetMaskedTextProvider - changing the mask, try to use current input.
NetMaskedTextProvider - Left and Right Cursor dosen't wrap around.

* Add Some TextValidateField Tests.

* Add TextRegexProvider Tests

* Remove unnecessary using

* Tests namespace to Terminal.Gui.Views

* Regex Parse exception handling

* remove textmaskprovider in favor of .net maskedtextprovider

* refactoring and cleaning
2021-04-25 12:13:55 -07:00
Charlie Kindel
b29240f362 Code coverage (#1235)
* tweaked version # for v1.0.0-beta.10

* tweaked version # for v1.0.0-beta.11

* Updated readme and revision history for 1.0

* excluding test results

* Added support for viewing code coverage results with Fine Code Coverage

* add generating CC to CI/CD

* refactored unit test namespaces

* more refactoring. commented out failing test.

* Removed UnitTests and UICatalog from code coverage reporting

* made Application and test more deterministic

* disabled Multi_Thread_Toplevels because it is currently broken and don't understand why

* updated threading test per @bdisp

* testing cc badge stuff

* another test

* using coverlet.settings

* trying copy

* trying cp. duh.

* trying mv.

* wrong path

* print

* chaging badge output for testing

* yaml error

* fixed code coverage

* moved dimtests to core
2021-04-25 10:18:31 -07:00
BDisp
3418f2882a Fixes #1234. Setting Handled to true in the KeyPress event avoids ProcessKey from running. (#1237)
* 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).
2021-04-22 10:04:33 -07:00
BDisp
4948d072b0 Fixes #1231. Ignoring negative bounds. (#1232)
* Fixes #1231. Ignoring negative bounds.

* Added vertical width instead VerticalTextAlignment.

* Removing width.
2021-04-20 14:17:53 -07:00
dependabot[bot]
412a3ce17d Bump Microsoft.NET.Test.Sdk from 16.8.3 to 16.9.4 (#1223)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.8.3 to 16.9.4.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.8.3...v16.9.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-18 18:02:46 -07:00
dependabot[bot]
20f21b3a25 Bump coverlet.collector from 1.3.0 to 3.0.3 (#1222)
Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 1.3.0 to 3.0.3.
- [Release notes](https://github.com/coverlet-coverage/coverlet/releases)
- [Commits](https://github.com/coverlet-coverage/coverlet/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-18 18:02:08 -07:00
BDisp
0fe512d198 Fixes #1211. Added support to TextView for word based operations Ctrl+Del and Ctrl+Backspace. (#1212)
* Fixes #1211. Added support to TextView for word based operations Ctrl+Del and Ctrl+Backspace,

* Updating nuget packages.

* Revert "Updating nuget packages."

This reverts commit e7afc56a67.

* Removed commented code.

* Replacing '\r\n' with System.Environment.NewLine due the unit tests errors on the server.

* Ensures UpdateWrapModel is always processed after a SetWrapModel in the cases where WordWrap is true.

* Added new feature where pressing Ctrl+C copies the  entire current line into the clipboard if there are no selection.

* Fixes copy and paste without selection.

* Fixing Copy/Paste and unit tests.

* Added RemoveRange method to the WordWrapManager and more unit tests.
2021-04-18 10:17:48 -07:00
BDisp
28580de3c5 Fixes #1208. Now the selected text is overwritten if SelectedStart is greater than CursorPosition. (#1209) 2021-04-15 17:28:10 -07:00
BDisp
e784765094 Fixes #1179. TextView does not copy to the clipboard on deleting. (#1180)
* Fixes #1133. Flaw in LayoutSubviews/TopologicalSort.

* Toplevel can't be used on Pos/Dim but only his subviews. Was not caught before because the LayoutSubviews  method never gone so deep before.

* Fixed the error that is triggered when the Pos/Dim is the current Application.Top.

* Application.Top is the only exception in the TopologicalSort method check.

* Fixes #1179. TextView does not copy to the clipboard on deleting.

* Added Button DoubleClick and fixed WordForward/WordBackward issues.

* Prevents a negative height.

* Fixes the enter key line feed.

* Fixes #1187. Prevents WordBackward throwing an exception if point is greater than the text length.

* Fixes #1189. Prevents negative index.

* Fixes #1193. A  non auto size default Button now preserves his width and thus the text alignment now work.

* Fixing the Width and Height checks of the Dim class with AutoSize dependence.

* Fixes #1197. Prevents width negative value if added directly to the Application.Top

* Fixes #1199. Normalize views constructors and did some typo fixing.

* Fixing the Application.Top Pos/Dim settings.

* Always uses inverted color for selected text to avoid same colors.

* Prevents throw an exception if the clipboard content is null.

* Added Find and Replace (next/previous). Replace All and Select All. A non modal dialog box.

* Keeps tracking the selected replaced text.

* Fixes #1202. CheckBox now deals with a functional '_' underscore hotkey.

* The selected text should be maintained when losing focus.

* Fixes an extra line on page down.

* Fixes the WordBackward if it text has more than one whitespaces or when has only one digit or letter.

* Fixes WordForward/WordBackward on text with more than one whitespace or with only one digit or letter.

* Forgot to replace the hacking.

* Added unit tests for the TextField view. Fixed some more bugs.

* Redraw should only show the selected text if it is focused.

* Fixes cursor position on double click and ensures the setting of the selected text.

* Added match whole word checking.

* Added missing parameters documentation.

* Ensures the SelectedLength property to be always with positive value.

* Fixes the WordBackward when at the end of the text has a character between two whitespace.

* Added unit tests to the TextView, Used property and fixed some more bugs.

* Fixed Used to only show if it has focus.

* Fixed ReplaceAll and prevents Debug.Assert from showing.
2021-04-13 13:37:13 -07:00
BDisp
5bd8be83ca Fixes #1187. Prevents WordBackward throwing an exception if point is greater than the text length. (#1188)
* Fixes #1187. Prevents WordBackward throwing an exception if point is greater than the text length.

* Always uses inverted color for selected text to avoid same colors.

* Prevents throw an exception if the clipboard content is null.

* The selected text should be maintained when losing focus.

* Fixes WordForward/WordBackward on text with more than one whitespace or with only one digit or letter.

* Forgot to replace the hacking.

* Added unit tests for the TextField view. Fixed some more bugs.

* Redraw should only show the selected text if it is focused.

* Fixes cursor position on double click and ensures the setting of the selected text.

* Ensures the SelectedLength property to be always with positive value.

* Fixes the WordBackward when at the end of the text has a character between two whitespace.
2021-04-13 13:35:23 -07:00
BDisp
3ab9e1fc27 Fixes #1199. Normalize views constructors and did some typo fixing. (#1200)
* Fixes #1199. Normalize views constructors and did some typo fixing.

* Fixing the Application.Top Pos/Dim settings.
2021-04-13 13:28:25 -07:00
Thomas Nind
1f01ff86fd New Control: Tabview (#1137)
* started working on tab view

* Ability to switch tabs

* Added interactive tab

* Added ShowBorder

* Fixed not being able to focus tabs

* Made tab row into private class and implemented PositionCursor

* Added support for TabsOnBottom

* Fixed layout flipping repeatedly between top and bottom tabs

* support for scrolling to infinite tabs

* Added scroll indicators

* Made Tabs readonly and added Notepad Scenario

* Fleshed out Notepad app

* Added SelectedTabChanged event

* Improved visiblity of where focus is and made example Absolute layout

* Added unicode tab to example

* Prototype mouse support

* Refactored tab rendering logic into sub view TabRowView

* Fixed bugs in Notepad scenario and xml doc

* Fixed position of cursor when TabsOnBottom and ShowHeaderOverline are both true

* Fixed PositionCursor when TabsOnBottom (properly this time)

* Fixed bugs when a Tab had a null View

* Fixed RemoveTab when SelectedTab is null and docs

* Fixed whitespace to match guidelines

* Fixed tabsBar position bug TabView.Y is not 0

* Added MaxTabTextWidth property

* Fixed issues based on feedback

* Support for clicking on scroll indicators

* Added tests for TabView

* Fixed horizontal line in empty tab view

* Fixed whitespace to match coding guidelines

* Added more tests, fixed AddTab allowing duplicates

* Fixed TabView not responding to double/triple click on arrows

* Refactored clicking scroll indicators to use SwitchTabBy

* Changed FileDialog to OpenDialog in Notepad Scenario
Includes support for opening multiple at once
2021-03-24 10:06:56 -07:00
BDisp
482f9db7da Fixes #1148. TextFormatter.Format does not keep the end spaces on wrapped text. (#1149)
* Fixes #1148. TextFormatter.Format does not keep the end spaces on wrapped text.

* Added comments.

* Changing keepEndSapces to preserveTrailingSpaces.
2021-03-23 10:53:02 -07:00
Thomas Nind
522745f559 Fix #1120 (#1124)
* Added ObjectActivationButton (mouse)

* Fixed layout to match coding guidelines
2021-03-08 19:42:25 -07:00
tznind
db322b27ef Added GoTo method and renamed 'model' parameter where appropriate 2021-03-08 10:11:11 +00:00
tznind
dc22a890e9 Updated to match coding guidelines (whitespace, brackets etc) 2021-03-08 09:22:17 +00:00
tznind
ec85340285 Added ObjectActivated event 2021-03-02 19:14:38 +00:00
tznind
6ef5f1cd1d Merge remote-tracking branch 'upstream/master' into tree-view 2021-02-17 10:29:30 +00:00
tznind
01b899fb37 test for multi select, mouse fix and collapse selection fix 2021-02-16 20:06:29 +00:00
tznind
c02a238ef0 Merge branch 'master' into table-view 2021-01-27 08:18:37 +00:00
tznind
1a00376885 Added more tests and fixed GetContentWidth when Bounds have 0 Height 2021-01-24 11:12:44 +00:00
tznind
2884b8e94d Added horizontal scrollbar, fixed tests 2021-01-24 10:35:03 +00:00
tznind
6f787f4638 Merge branch 'master' into tree-view 2021-01-23 08:38:27 +00:00
Charlie Kindel
77add786fc Merge pull request #1081 from BDisp/scroll-bar-view
Fixes #1073, #1058, #480 #1049. Provides more automation to the ScrollBarView, allowing easily implement on any view.
2021-01-22 09:32:27 -08:00
Charlie Kindel
285cc82b9f Merge pull request #1085 from angelobreuer/master
Application.Shutdown() does not reset SynchronizationContext
2021-01-22 09:19:44 -08:00
BDisp
f9f68048a2 The host only need to pass the real sizes and the ScrollBarView automatically consider the extra line and column. 2021-01-22 02:21:56 +00:00
BDisp
e7f66f8350 Simplifies the code more and makes it more understandable on the ScrollBarView. 2021-01-19 10:54:40 +00:00
BDisp
58c2509772 Offers more simplicity to iterate with the ScrollBarView and its hosts. 2021-01-17 00:29:01 +00:00
BDisp
bedeca61e6 Fixing some bugs. 2021-01-15 23:04:49 +00:00
BDisp
0466a6ebc3 Avoiding throwing exception on the "All Views Tester" scenario. 2021-01-15 17:09:31 +00:00
BDisp
146d23422b Ensures that the ScrollBarView don't have two vertical or horizontal ScrollBarView. 2021-01-15 11:38:32 +00:00
BDisp
351cb8133f Fixed backward bug and added one more unit test to probe. 2021-01-14 01:35:20 +00:00
BDisp
5b86c460e8 Added ScrollBarViewTests.cs file with unit tests for ScrollBarView. 2021-01-14 00:57:10 +00:00
Angelo Breuer
3ca84f8381 Add tests for #1084 2021-01-13 16:25:34 +01:00
BDisp
b3850f7f61 Fixing FakeDriver and unit test. 2021-01-08 21:33:07 +00:00
BDisp
ea8d84f185 Fixing the FocusNearestView method. 2021-01-08 19:53:04 +00:00
BDisp
950c7dd19a Adding unit test. 2021-01-07 17:37:54 +00:00
tznind
d988a34444 Added SelectAll, better selection iteration and validation 2021-01-03 21:57:00 +00:00
tznind
b2e54ec83d Fixed page up/down offset and added test 2021-01-03 10:28:27 +00:00
tznind
0c2685bcbe Added test for box selection 2021-01-02 19:20:00 +00:00
tznind
f610cc8416 better handling of unicode in table view 2020-12-31 10:06:49 +00:00
tznind
65806b1ba2 Added SelectedCellChangedEventArgs and tests 2020-12-29 09:54:50 +00:00
tznind
52af2a609e Fixed namespace, comments and added tests 2020-12-29 06:47:51 +00:00
BDisp
7583128cad Removed from the unit test too. 2020-12-26 11:50:25 +00:00
tznind
edf46b6f6d Merge branch 'master' into tree-view 2020-12-16 14:24:55 +00:00
tznind
dc184ba469 Changed from object to generic <T> for TreeView 2020-12-16 12:04:46 +00:00
tznind
8fe8128b0b Replaced delegates with new interface ITreeBuilder 2020-12-15 09:37:59 +00:00
tznind
5dad1d2221 Added test for TreeNode usage 2020-12-14 07:30:13 +00:00
tznind
7af2763f43 Added method RebuildTree
Similar to RefreshObject but for all visible branches.  Call this method when making large scale changes behind the scenes to objects including hierarchy changes.
2020-12-09 13:24:30 +00:00
BDisp
b7f91af247 Fixes #1034. The NuGet packages need to be updated. 2020-12-09 11:43:41 +00:00