Commit Graph

10 Commits

Author SHA1 Message Date
BDisp
933a1bda91 Added text direction support for word-wrap and fix draw issues. 2022-04-30 01:07:04 +01:00
BDisp
3e3b67889d It is needed to get rid of the first and the last line ending of expectedLook. 2022-03-17 12:49:56 +00:00
BDisp
d9f52fc2f2 Changing from AssertDriverContentsWithPosAre to AssertDriverContentsWithFrameAre to return a Rect. 2022-03-17 12:49:55 +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
b5799c3ded Fixed label positions to begin at Margins not just bottom left of screen (#1488)
* Fixed label positions to begin at Margins not just bottom left of screen

* Tidied up Axis GetLabels and added margin control to GraphViewExample

* Added tests for very large margins
2021-10-25 12:30:39 -07:00
Thomas Nind
fe464b0b94 Added test helper method AssertDriverColorsAre 2021-06-29 08:03:35 +01:00
BDisp
21714b64b8 Fixes #1341. Now if AutoSize is true the Bounds size is always updated by using the Dim.Fill or the Dim.Absolute. 2021-06-18 18:34:16 +01:00
Charlie Kindel
8d8025329e Added Attributes tests; balanced Application.Init/Shutdown 2021-05-17 18:22:46 -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
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