Commit Graph

166 Commits

Author SHA1 Message Date
Charlie Kindel
f13ee4a1b8 Merge pull request #1334 from BDisp/window-initialize
Added a Initialize method to the Window to simplify the constructors.
2021-06-11 13:02:12 -07:00
BDisp
4d09d4522e Added a AllViewsTests unit test to test all Views derived class constructors. 2021-06-10 20:31:57 +01:00
BDisp
ee75af620d Fixes the restriction of the AutoSize = true of only being true if both the width and the height are true. 2021-06-08 21:35:27 +01:00
BDisp
432e9cb801 Fixes GetCurrentWidth and GetCurrentHeight providing the correct current values. 2021-06-04 16:48:09 +01:00
BDisp
66b46851cb Fixes #1327. Fixes TextField backspace and canceling TextChanging. 2021-05-31 15:51:20 +01: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
ce04eeda86 Added -noprofile option to PowerShell and the clip.exe. 2021-05-27 17:13:12 +01:00
dependabot[bot]
f19636ed33 Bump ReportGenerator from 4.8.8 to 4.8.9
Bumps [ReportGenerator](https://github.com/danielpalme/ReportGenerator) from 4.8.8 to 4.8.9.
- [Release notes](https://github.com/danielpalme/ReportGenerator/releases)
- [Commits](https://github.com/danielpalme/ReportGenerator/compare/v4.8.8...v4.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 18:11:39 +00:00
dependabot[bot]
b866dfa196 Bump Microsoft.NET.Test.Sdk from 16.9.4 to 16.10.0
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.9.4 to 16.10.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.9.4...v16.10.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 06:19:34 +00:00
BDisp
30748df0da Trying even more to fix permissions issue and removed try catch. 2021-05-25 19:43:19 +01:00
BDisp
a5915cd190 Trying fixing more permissions issue. 2021-05-25 19:33:37 +01:00
BDisp
1b7ead0e71 Fixes more permissions issues. 2021-05-25 19:19:14 +01:00
BDisp
87271cc477 Implemented the ClipboardBase abstract class as suggested by @tznind. 2021-05-25 18:49:30 +01:00
BDisp
8bdbb12c8a Check if xclip is installed. 2021-05-23 00:47:28 +01:00
BDisp
67d75725cc Fixes #1318. Ensures that the OS clipboard is always sets. 2021-05-22 22:37:04 +01:00
BDisp
f60458cc6b Fixes #983. Improving clipboard with interaction with the OS. 2021-05-20 01:27:42 +01:00
Charlie Kindel
4f0049dde8 refactored AutoInitShutdown attribute 2021-05-17 18:30:55 -07:00
Charlie Kindel
8d8025329e Added Attributes tests; balanced Application.Init/Shutdown 2021-05-17 18:22:46 -07:00
BDisp
c2d0a28c86 Fixes #1307 MainLoop timeouts duplicate keys error. (#1308)
* Fixes #1307 MainLoop timeouts duplicate keys error.

* Fixes key not exist in collection on parallel.
2021-05-16 17:01:03 -07:00
Thomas Nind
fe9c984d5c Changed Console.WriteLine to ITestOutputHelper in tests (#1305)
* Changed Console.WriteLine to ITestOutputHelper in tests

* Added ITestOutputHelper
2021-05-16 07:21:21 -07:00
Thomas Nind
0dd0f2e5c4 TableView - adds last column dividing line (#1289)
* Adds a final vertical column line at the end of the last header in TableView

* Added clear line as first step in RenderRow

* Added TableStyle.EnforceMaxWidthOnLastColumn

* Added Scenario toggle setting and tests

* Fixed EnforceMaxWidthOnLastColumn when Bounds match exactly the last column width

* Fixed whitespace and comment on ColumntoRender.Width

* Renamed EnforceMaxWidthOnLastColumn to ExpandLastColumn
2021-05-10 20:58:15 -07:00
BDisp
a492a52d79 Fixes #1291. Combining two PosAbsolute or two DimAbsolute result on a PosAbsolute or DimAbsolute. (#1292) 2021-05-09 19:28:31 -07:00
BDisp
5b490a8c8f Fixes #1266. Using Ctrl+PageUp/PageDown to allowing navigate through windows. (#1283)
* Fixes #1266. Using Ctrl+PageUp/PageDown to allowing navigate through windows.

* No need to change TextView.

* Added configurable navigations keys.
2021-05-07 14:38:05 -07:00
BDisp
8dabd16975 Fixes #1276. Added TextDirection constructor to View and Label and improving AutoSize. (#1277)
* Added AutoSize. CalcRect calculates vertical. Fixes Draw bug.

* Added TextDirection constructor. Ensuring set frame on Pos/Dim absolute. Improves AutoSize.

* Added a scenario for the AutoSize and TextDirection.

* Added more unit tests.

* Fixing some broken scenarios.

* Fixes others TextDirection that was not working.
2021-05-02 11:21:08 -07:00
BDisp
013bf80fb2 Fixes #1267. Allows NetDriver run Terminal.Gui. (#1268)
* Fixes #1267. Allows NetDriver run Terminal.Gui.

* Removing instead of commenting.
2021-04-28 16:17:03 -07:00
José Miguel Perricone
028e7e5bf2 TextValidateField reimplementation without generics (#1261)
* TextValidateField reimplementation without generic

* mask change in catalog
2021-04-28 08:42:33 -07:00
Thomas Nind
a8628e7c28 Feature/graphs (#1201)
* Empty GraphView with basic axis

* Added ISeries

* Added zoom

* Fixed zoom

* Tests and scrolling

* Refactored AxisView into abstract base

* Added atomic mass example

* Added Y axis labels

* Added Y axis labels

* comments

* Refactored axis to not be floating views

* Split axis drawing code to seperate draw line from draw labels

* Added MarginBottom and MarginLeft

* Added bar graph

* Fixes horizontal axis label generation

* Fixed axis labels changing during scrolling

* Added test for overlapping cells

* Added TestReversing_ScreenToGraphSpace

* Changed graph space from float to decimal

* Added axis labels

* Fixed issues where labels/axis overspilled bounds

* Fixed origin screen coordinates being off by 1 in y axis

* Added Orientation to BarSeries

* Added comments and standardised Name to Text

* Added prototype 'population pyramid'

* Fixed bar graphs not stopping at axis

* Added Reset and Ctrl to speed up scrolling

* Added line graph

* Fixed LineSeries implementation

* Made LineSeries Points readonly and sort on add

* Fixed RectangleD.GetHasCode()

* Improved performance of LineSeries

* Added color to graph

* Fixed colors not working on linux

* Added Visible and ColorGetter

* Added Ctrl+G Next Graph

* Added MultiBarSeries

* Fixed layout issue with population pyramid

* fixed y label overspill and origin rendering

* Fixed warnings

* Made examples prettier

* Fixed xAxis potentially drawing labels outside of control area

* Fixed multi bar example labels

* Added IAnnotation

* Added example of using GraphPosition in IAnnotation

* Fixed Annotations drawing outside of graph bounds

* Fixed Reset() not clearing Annotations and sp fixes

* Changed line drawing to Bresenham's line algorithm and deleted CohenSutherland
Testing for collisions with screen space is very slow and gives quite thick lines.  I looked at Xiaolin Wu which supports anti aliasing but this also would require more work to look good (out of the box it just looks thick).

* Fixed layout/whitespace

* Graph now renders without series if annotations are present

* Fixed ScreenToGraphSpace rect overload

* Added SeriesDrawMode for when it is easier/faster for a series to draw itself all in one go

* Added LegendAnnotation

* Added tests for correct bounds

* Added more tests

* Changed GraphView namespace to Terminal.Gui.Graphs

* Made Line2D and Horizontal/Vertical axis private classes

* Made AxisIncrementToRender.Text internal to avoid confusing user when implementing `LabelGetterDelegate`

* Changed back from decimal to float

* Refactored axis label drawing to avoid rounding errors

* Fixed over spilling bounds when drawing bars/axis increments

* Re-implemented disco colors

* Added Minimum to Axis

* Fixed tests build and render order

* Fixed test by adjusting epsilon

* tidyup, docs and warning fixes

* Standardised parameter order and added axis test

* Fixed x axis line drawing into margins and added tests

* Fixed axis increment rendering in margins, tests and tidyup examples

* Added test for BarSeries

* Added more BarSeriesTests

* Split GraphView.cs into sub files as suggested

* Fixed pointlessly passing around ConsoleDriver and Bounds

* Fixed colored bars not reseting color before drawing labels

* spelling fixes

* Replaced System.Drawing with code copied from dotnet/corefx repo

* Change to trigger CI

* Added tests for MultiBarSeries

* Added test support for Asserting exact graph contents

* Added xml doc where missing from System.Drawing Types

* Standardised unit test namespaces to Terminal.Gui

* Fixed namespace correctly this time after merging main

* Fixed test to avoid using Attribute constructor

* Reduced code duplication in test by moving InitFakeDriver to static in GraphViewTests

* Added TextAnnotationTests and improved GraphViewTests.AssertDriverContentsAre

* Added more TextAnnotation tests and fixed file indentation

* Added tests for Legend and Path
And fixed TruncateOrPad being off by 1 when truncating

* Removed unused paths in TruncateOrPad
2021-04-28 08:38:25 -07:00
BDisp
761224cf77 Fixes #1251. Fixes TextValidateProvider exception on the All View Tester scenario. (#1252) 2021-04-27 08:56:46 -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
Thomas Nind
444a01ae46 Extracted TreeView classes (builders, delegates, event args etc) into seperate files in namespace Terminal.Gui.Trees (#1246) 2021-04-26 08:59:35 -07:00
Thomas Nind
6a9e27761f Nested types for TabView and TableView (#1243)
* Made TabView classes nested

* Moved TableView classes to nested
2021-04-26 08:58:40 -07:00
dependabot[bot]
8d164cd02f Bump ReportGenerator from 4.8.7 to 4.8.8 (#1247)
Bumps [ReportGenerator](https://github.com/danielpalme/ReportGenerator) from 4.8.7 to 4.8.8.
- [Release notes](https://github.com/danielpalme/ReportGenerator/releases)
- [Commits](https://github.com/danielpalme/ReportGenerator/compare/v4.8.7...v4.8.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 08:54:12 -07:00
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