Commit Graph

402 Commits

Author SHA1 Message Date
tznind
2b5c83d3dc Merge remote-tracking branch 'upstream/main' into color-text-view 2021-06-13 14:03:04 +01:00
Thomas Nind
e601a6bd39 Fixed keyword highlighting and added string literal highlighting 2021-06-13 13:57:20 +01:00
tznind
32e4e9dff8 Added word splitting 2021-06-13 09:33:57 +01:00
Thomas Nind
fb5830ea9d Made color methods in TextView protected virtual 2021-06-13 08:30:03 +01:00
BDisp
297bf42bd6 Fixes InvalidOperationException from throwing when removing the label. 2021-06-06 20:52:45 +01:00
BDisp
87926a7d3d Prevents output to the terminal on Linux. 2021-05-29 22:10:23 +01: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
4af48392cc Fixes #1281. Fixed CursesDriver colors. Added BasicColors scenario. (#1282)
* Fixes #1281. Fixed CursesDriver colors. Added BasicColors scenario.

* Normalizing NetDriver too.

* Fixing others colors.
2021-05-06 10:29:50 -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
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
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
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
José Miguel Perricone
cec9cc3559 Add Vertical Alignment and Text Direction + UICatalog Demo (#1195)
* Add Vertical Alignment and Text Direction + UICatalog Demo

* Justified text with "Right to Left" or "Bottom To Top" Directions.
2021-04-15 16:19:02 -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
1a9720f471 Fixes #1159. Dialog must have a default button if none is provided. (#1160)
* Fixes #1159. Dialog must have a default button if none is provided.

* Reverting this because someone may don't want buttons at all. Thanks @tig

* Allow to specify which default button for MessageBox.

* Added a check if default button is greater than the buttons length and changing the MessageBox scenario.
2021-04-01 12:38:18 -07:00
Charlie Kindel
4abc3de4e8 fixed rediculous compiler warning (#1164) 2021-04-01 10:15:29 -07:00
Charlie Kindel
8027a407c4 get productversion of terminal.gui not version (#1163) 2021-04-01 10:01:42 -07:00
BDisp
47211c78e8 Fixes #1154. FileDialog blank constructor results in unstable window (#1157)
* Fixes #1154. FileDialog blank constructor results in unstable window

* Fixes #1158. File Open Dialog should disable 'Open' if file is blank (or not valid).

* Changing to CanFocus behavior. Adding a Canceled check.
2021-04-01 09:15:53 -07:00
BDisp
0669e2cc94 Fixes #134. TextView: Add line wrapping. (#1147)
* Fixes #134. TextView: Add line wrapping.

* Facilitates exception handling in Debug mode.

* Fixes the cursor position if it is always on the same line.

* Fixed TextView column position and hiding the cursor if it is outside outbound frame.

* Added more wrap lines features.. Added a BottomOffset property. Fixed Ctrl+K and Ctrl+Y.

* Fixes the Text property and fixing a redraw behavior not cleaning well at right.

* Fixes Ctrl+K from adding an extra line feed.

* Implemented Ctrl+K and Ctrl-Y on wrapped lines and preventing left Column to be greater than 0 on wrap.

* Fixes more line feed issues.

* More line feed fixing.

* Fixes UpdateModel that must return the new row and new column from the wrapped lines.

* Fixes #1155. MoveForward/MoveBackward not bound on Text controls.

* Added much more features to TextView.

* Fixes ResetPosition and forcing the cursor visibility.

* Implemented the New, Save and SaveAs methods in the Editor.
2021-04-01 09:14:14 -07:00
Thomas Nind
7e99d44b52 Fixed CreateClass to create a generic MyClass<object> when MyClass<T> is passed (#1153) 2021-03-24 10:15:03 -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
Charlie Kindel
fde741ad76 Merge pull request #1022 from tznind/tree-view
Woot!!! Well done, sir!
2021-03-08 09:21:35 -07:00
tznind
57dd4a6f61 Added ObjectActivated example in TreeViewFileSystem that displays info about the selected file/dir 2021-03-08 10:31:52 +00:00
tznind
dc22a890e9 Updated to match coding guidelines (whitespace, brackets etc) 2021-03-08 09:22:17 +00:00
Charlie Kindel
ca333ceb70 Merge pull request #1066 from BDisp/heightasbuffer-as-true
A provisional solution to the #1065 issue. Setting HeightAsBuffer as true by default.
2021-03-07 17:44:28 -07:00
tznind
62a997f4b3 Tidied up docs and fixed several methods to be virtual 2021-03-02 21:58:07 +00:00
tznind
2a86709296 Fixed not adding top menu to Scenario 2021-02-21 12:57:17 +00:00
tznind
2d7b3f4f52 Added interactive scenario (create and delete tree nodes on demand). Added Tag and Text to interface for ITreeNode 2021-02-21 12:52:42 +00:00
tznind
f21f21522f Added SelectAll and made OnSelectionChanged protected 2021-02-17 19:18:33 +00:00
tznind
5b763bd44f Added ExpandAll / CollapseAll (shortcut Ctrl + Right/Left) 2021-02-17 13:37:43 +00:00
tznind
76f81d2bdd Fixed IsSelected using reference comparison instead of equality 2021-02-17 12:46:57 +00:00
tznind
b78de72408 Added equality for ShowForType in scenario and added comments about it 2021-02-17 12:37:39 +00:00
tznind
011f3efea3 Changed tabs to spaces in visualization window to prevent rendering issue 2021-02-17 12:34:54 +00:00
tznind
f675b3b39c Added new scenario ClassExplorer which presents all Types and Methods divided by assembly 2021-02-17 11:38:38 +00:00
tznind
6ef5f1cd1d Merge remote-tracking branch 'upstream/master' into tree-view 2021-02-17 10:29:30 +00:00
Charlie Kindel
481f36013d Merge pull request #1015 from tznind/table-view
New Control 'TableView' for viewing tabular data
2021-02-15 11:12:51 -07:00
Charlie Kindel
e48b867e7e Added indication of which driver is in use to status bar 2021-02-15 10:41:15 -07:00
Gilles Freart
a467afae12 Removing no more needed using 2021-01-29 17:43:51 +01:00
Gilles Freart
3ea6bb89d9 Applying style change, renaming some variable 2021-01-29 17:35:59 +01:00
Gilles Freart
8a13efbb83 Preparing PR + fix cursor issue happening inside frameview 2021-01-28 16:56:28 +01:00
Gilles Freart
92e9d29e37 Fixing Cursor Display under Windows; setting more coherence between windows & linux at CursorVivibility enum 2021-01-28 15:57:34 +01:00
Gilles Freart
ff512f5846 Adjustment under ubuntu & ubuntu xTerm 2021-01-28 14:17:01 +01:00
Gilles Freart
9b617a07f0 Adjusting cursor size ... working under WindowsDriver 2021-01-27 21:51:07 +01:00
tznind
c5c477596c Made New Row/Col location adjacent to current selected cell 2021-01-27 19:43:41 +00:00
tznind
0817fa3d6c Added Move Column and Sort 2021-01-27 19:22:55 +00:00
tznind
22c30fbb55 Added MoveColumn command to Scenario 2021-01-27 18:59:51 +00:00