* Reduces indentation by remove the namespace braces.
* Reduces indentation and removes unused using.
* Ensures clear selection if it isn't selecting.
* Turn on nullability context for TryParse and update usages as needed.
* Use IsNullOrWhiteSpace, which includes IsNullOrEmpty
All-whitespace values are also illegal, so may as well handle that here too
* Respect the nullable here
* It's a struct
* Use byte.MaxValue and add remark
* Just use the bytes directly
* Must respect endianness
* Add uint constructor so consumers don't have to do unchecked math
* Completely re-work parsing and implement ISpanParsable<Color>
All parsing is now almost-0 allocation, and is significantly faster than before
* Extension methods required by new code
* Use standard Math.Clamp method here
* Add some new unit tests for TryParse
* De-duplicate code and handle more cases
* Enable nullability context for the file
* Go ahead and enable the language features and analysis
* Implicit usings remove a lot of boilerplate usings.
* Add these to the dictionary to shut spell check up
* Make this thing a record struct and a union, and update constructors
This commit won't build. I'm just breaking out changes a little bit.
* Some additional XmlDoc standardizing
* Make FindClosestColor and CalculateColorDistance use the vector for SIMD
* Add a TryFormat method for support of I*Formattable
* Add an interface for support of custom formatting of Colors
* Pass by in reference
* Parse string delegates to Parse span
* Parse now does all the work
* Remove the old new code from TryParse
* Some new cast operators
* Add IFormattable.ToString implementation
* Add the rest of the code for Color in its current (unfinished) state
* Move that interface to its own file
* Add ColorParseException class
* Move Attribute to its own file, too.
* Re-implement these operators as explicit methods
* Get rid of fuzzy equality operators and update tests to use the named methods that replace them
* Add an explicit test case for ToString with null format string and explicitly specified Invariant culture
* Fix byte orders for hex format to be standard ARGB
* Prove that ToString and Parse can round-trip values
* Unroll this test into parameterized cases
* Fix a couple of comments to match byte order
* Update R# dictionary to match correct byte orders
* Remove stray comment
* Separate all types in this to their own files
* Convert this one to use the handy extension
* Add test for Argb property
* Add a file nesting rule to make some incoming file changes display nicely
* Move constructor tests to their own file and add some new tests
* Add implicit cast from uint
* More constructor tests
* Since this is now a record, the equality operators are compiler generated
Still spot-checking a few arbitrary values for completeness
* Override ToString to delegate to Attribute
* Simplify and clean up ToString. Delegate to ColorScheme
* Update the test to match new output
* These should be fields, really. It's a value type.
* Add some type checks for change control
* Allow unsafe and turn on implicit usings
* Make this one better
* Rename tests and remove redundant checks (the type checks already guarantee field consistency)
* Reorganize a bit
* Make these test 16 random values
* Existing operator tests converted
* That one is now redundant with both of the other tests that check all the named colors
* Move this to type checks and simplify a little bit
* These lambdas can be static
* Move operators to another file.
* Add global using for System.Text because it's EVERYWHERE
* Reorganization of Color and some related types.
Updated usages to reflect changes
* Update tests to reflect changes in Terminal.Gui
* Add missing keyword
* Add entry to dictionary
* Add dotsettings for Terminal.Gui
Only specifies language level
* Commit unsaved changes for usings here
* Implement last remaining TryFormat method
* A little cleanup/formality
* Sorting rules
Sort methods by name and interface they implement
* Sort code
* Match namespace for tests
None!
* Unroll ordinal check and reorganize.
* Sort before writing new tests
* These got reversed...
* Add test to prove explicit cast to Vector3 works properly
* Sort these too
* Add test for uint->Color implicit operator
* Add test for Color->uint implicit operator
* Correct this test name and re-order
* Add test for implicit conversion from Vector3 to Color
* Add test for implicit conversion from Vector4 to Color
* These also got reversed, like with Vector3
* Add test for implicit conversion from Color to Vector4
* Add test for GetHashCode
* Make sure these are all under the same namespace
* Remove a now-redundant test
* Reorganize formatting and parsing tests to another type part
* Tests moved back to Terminal.Gui.DrawingTests namespace as before.
* Add tests for the constructor taking 3 or 4 integers and sort
* Cleanup
- Renamed some tests
- Make a test even clearer
- Removed redundant code
- Got rid of unused parameter in Constructor_WithColorName_AllChannelsCorrect
* That needs to be from the reverse map
Not broken - just was sub-optimal due to my error.
* Enable nullability context in this file
Not sure how it got removed but whatev
* Respect nullability context in this file now that it's on 🤦♂️
* Add tests for expected exceptions with whitespace or null values
* Add test for parameterless constructor
* A couple more places for reference passing and some SkipLocalsInit attributes.
* Some XmlDoc corrections to reflect the final implementation
* Remove namespace qualifier
* Can't use these because of lambdas :(
* Removed a collection that never ended up being needed.
* Add bracing, newline, and modifier style rules
* Add spacing rules inside parens/brackets
* This was still under the Terminal.Gui.Drawing namespace. Revert that.
* Applied updated formatting settings and addressed XmlDoc reviews in #3204
* More places where spaces got added in dependent code.
Also a couple of null checks fixed to not use the equality operator
* More dependent code format fixes
* Finished re-formatting modified code that got spaces added everywhere
* Visual studio didn't actually write this file to disk til I closed out of VS...
Grr
* Delete the ReSharper settings files from this branch.
---------
Co-authored-by: BDisp <bd.bdisp@gmail.com>
* Disable next and previous button when Date would go out of range
* Make DatePicker compatible with DateField
* Update unit tests
* Fix unit tests
* Fix test comments
* Fix format bug for 10 character date
* Handle all date formats (except date formats using 2 chars seprator)
* Removes \u200F mark from the Text property.
* Make constant for RIGHT_TO_LEFT MARK
* Add comment explanation for StandardizeDateFormat method
---------
Co-authored-by: BDisp <bd.bdisp@gmail.com>
* Fixes#2882. TabView: 'Frame.DrawFrame(Rect, bool)' is obsolete: 'This method is obsolete in v2. Use use LineCanvas or Frame
* Trying fix this unit test that sometimes fail.
* Fixes#2983. View need a alternative DrawFrame for the v2.
* Use new DrawFrame method.
* Change _lines field to Lines property.
* Add TabWindow unit test.
* Add DrawIncompleteFrame method and unit tests.
* Add more unit tests to LineCanvas.
* Fix newline conflict errors.
* Revert "Change _lines field to Lines property."
This reverts commit ab6c5f3094.
* Add DrawIncompleteFrame method and unit tests.
* Add more unit tests to LineCanvas.
* Fix newline conflict errors.
* Force render immediately instead of join.
* I will never rely on zero-location-based unit test again.
* Fix TestTreeViewColor unit test fail.
* Using location of 3 to avoid be divisible by 2 and so avoiding bugs.
* Revert "Using location of 3 to avoid be divisible by 2 and so avoiding bugs."
This reverts commit dd3df135d8.
* Revert "I will never rely on zero-location-based unit test again."
This reverts commit 62adf6f285.
* Revert "Fix newline conflict errors."
This reverts commit 4acf72612d.
* Revert "Add more unit tests to LineCanvas."
This reverts commit 66bc6f514e.
* Revert "Add DrawIncompleteFrame method and unit tests."
This reverts commit 680ba264e1.
* Resolving merge conflicts.
* Revert "Use new DrawFrame method."
This reverts commit 69a7f17f19.
* Revert "Fixes #2983. View need a alternative DrawFrame for the v2."
This reverts commit dade9fd767.
* Reverting this changes to start a new one.
* Add horizontal and vertical support for combining glyphs.
* Fix text and auto size behavior.
* Add TabWidth property.
* Add unit test for WordWrap.
* Fixes#3017. View TextDirection returns incorrect size on a vertical direction instance with AutoSize as false.
* Using Frame to force read from the get method.
* Fix some issues with AutoSize and ForceValidatePosDim.
* Fixing broken unit tests.
* Restoring code I've broken.
* Removing forgotten code.
* Only LayoutStyle.Computed can change the Frame.
* DateField and TimeField depends on LayoutStyle.Computed.
* Fix unit tests related with LayoutStyle.
* Implements tabs, left and right arrows as View.
* Draws a minimum full border.
* Adds missing XML parameter.
* Adds assert tests for Frame.
* Removes duplicates InlineData.
* Adds more unit tests for minimum full border without Left and Right thickness.
* Trying to fix the TestTreeViewColor unit test fail.
* Prevents a user to set TextDirection to -1.
* Prevents any invalid TextDirection value.
* Removes (TextDirection)(-1).
* Removes unnecessary TextDirection initialization.
* Removes LayoutStyle.
* Fixing unit tests with border.
* Trying to fix TestTreeViewColor again.
* Revert "Trying to fix TestTreeViewColor again."
This reverts commit c2efa8e42e.
* Trying to fix TestTreeViewColor again.
* Fix merge errors.
* Fix merge errors.
* Restoring unit test.
* Restores the right XML comment.
* Fix Disposing unit tests that sometimes throws because some instances aren't cleared on others unit tests classes.
* Fix Disposing unit tests that sometimes throws because some instances aren't cleared on others unit tests classes.
* Only call OnResizeNeeded if it's LayoutStyle.Computed.
* Fix merge errors.
* Fix merge errors.
* Fix unit tests fail.
* Reformat.
* Again.
* Rename to OnDrawAdornments.
* Fix failing unit tests.
* Reduces indentation and cleanup code.
* Cleanup code.
* Fix bug done when cleanup.
* Replace FrameHandledMouseEvent to AdornmentHandledMouseEvent.
* Removes Tab constructor parameters.
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
* Removed resharper settings from editorconfig
* Moved ColorScheme to ColorScheme.cs
* Moved ColorScheme to ColorScheme.cs
* Potential fix. PlatformColor was not being set by FakeDriver correctly.
* Made ColorScheme effectively readonly
* Removed Color.Base etc... Updated API docs.
* Fixes#2981. LegendAnnotation: 'Frame.DrawFrame(Rect, bool)' is obsolete: 'This method is obsolete in v2. Use use LineCanvas or Frame
* Fixes#2983. View need a alternative DrawFrame for the v2.
* Use new DrawFrame method.
* Add a view for the legend annotations.
* Prefix with underscore.
* Change LegendAnnotation class to derived from View.
* The Bounds isn't needed, it's enough to set the Pos/Dim.
* Fix unit test to differentiate Bounds from Frame.
* Add DrawIncompleteFrame method and unit tests.
* Add more unit tests to LineCanvas.
* Fix newline conflict errors.
* Add DrawIncompleteFrame method and unit tests.
* Add more unit tests to LineCanvas.
* Fix newline conflict errors.
* I will never rely on zero-location-based unit test again.
* Fix TestTreeViewColor unit test fail.
* Add BorderStyle option to the menu.
* Revert "I will never rely on zero-location-based unit test again."
This reverts commit 62adf6f285.
* Revert "Fix newline conflict errors."
This reverts commit 4acf72612d.
* Revert "Add more unit tests to LineCanvas."
This reverts commit 66bc6f514e.
* Revert "Add DrawIncompleteFrame method and unit tests."
This reverts commit 680ba264e1.
* Revert "Fixes #2983. View need a alternative DrawFrame for the v2."
This reverts commit dade9fd767.
* Removed resharper settings from editorconfig
* Rename to OnDrawAdornments.
* Added diagnostics as a double-check. Code cleanup. API doc improvements.
* Fix typo for retest again.
* Increase the graph size.
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
* Reduces indentation by remove the namespace braces.
* Prefix private fields with underscore.
* Rename to SetInitialProperties.
* Reduces indentation and removes unused using.
* Using TextChanging instead of TextChanged event.
* Fixes#3160. TextField doesn't update correctly the CursorPosition on Paste.
* Rearrange code.
* Fix key bindings.
* Fix Non-numerics are ignored.
* Add format normalization.
* Improve cursor position adjustments.
* Ensures clear selection if it isn't selecting.
* Provides more text validation.
* Unit test with selection.
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
* Remove the old short two digits year and done some cleanup.
* Fixes#3160. TextField doesn't update correctly the CursorPosition on Paste.
* Using TextChanging instead of TextChanged event.
* Removes old IsShortFormat.
* Removing unnecessary private fields and done code cleanup.
* Removes unnecessary GetShortDatePattern method,
* Fix AdjCursorPosition method.
* Create TestDateAttribute.
* Reduces indentation and removes unused using.
* Remove location from constructors parameters.
* Create POC of DatePicker
* Move DatePicker to dialog
* Move DatePicker to separate view
* Support user specified date format
* Added code documentation for public API
* Select day on calendar based on currently selected date
* Add new constuctors for DatePicker
* Fix constructors
* Add month navigation buttons
* Added support for user to specify a range of years in the calendar
* Update default format date in unit tests
* Add some more unit tests
* Improve UICatalog DatePicker example
* Change default date format to CultureInfo.CurrentCulture
* Address code review comments
* Fix DatePicker height and width
* Fix crashes on 'Esc' key during open combobox
* Add DatePicker to localizable strings
* Generate calendar labels based on current culture
* Replace Month enum with localized DateTime month names
* Remove setting culture to polish (used for test purposes)
* Prevent choosing not existing day from calendar
* Update DatePicker layout
* Handle year out of range
* Make DatePicker standalone view and simplfy code and component look
* Handle clicking on no exisitng days in calendar
* Add missing rows to calendar
* Update example in UICatalog
* Dispose SubViews of DatePicker
* Add case for DatePicker
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
* Removed resharper settings from editorconfig
* Initial work in progress
* API doc
* API doc
* initial commit
* Fixed color and attribute issues
* Made Color a value type (readonly struct) etc...
* Removed stuff from other PR
* Ensured Colors.ColorScheme has private setter
* oops
* oops 2
* Code cleanup
* Code cleanup
* oops 4
* Reverted Attrivte.Default to be readonly static
* Fixed [Fact] [AutoInitShutdown]
* Removes CheckAbsoulte and updates unit tests to match
* Fixed code that was dependent on ToString behavior vs. direct test for null
* Dim/Pos != null WIP
* Moved AutoSize specific tests out of Pos/Dim tests
* Broke out AutoSize = false tests to new file
* Commented test TODOs
* New test
* Removed unused API and cleaned up code
* Removed unused API and cleaned up code
* Cleaned up code
* Cleaned up code
* reorg'd Toplevel tests
* Fixed Create and related unit tests
* Added test from #3136
* Removed TopLevel.Create
* Fixed SetCurrentOverlappedAsTop
* Updated pull request template
* Updated pull request template
* Revert "Updated pull request template"
This reverts commit d807190dd9.
* reverting
* re-reverting
* Fixed every thing but autosize scenarios??
* Fixed hexview
* Fixed contextmenu
* Fixed more minor issues in tests
* Fixed more minor issues in tests
* Debugging Dialog test failure
* Fixed bad Dialog test. Was cleary invalid
* Fixed OnResizeNeeded bug
* Fixed OnResizeNeeded bug
* Fixed UICatalog to not eat exceptions
* Fixed TextView
* Removed Frame overrides
* Made Frame non-virtual
* Fixed radioGroup
* Fixed TabView
* Hcked ScrolLBarView unit tests to pass
* All AutoSize tests pass!
* All tests pass!!!!!!!
* Updated API docs. Cleaned up code.
* Fixed ColorPicker
* Added 'Bounds =' unit tests
* Refactored TextFormatter.Size setting logic
* Cleaned up OnResizeNeeded (api docs and usages)
* Merges in #3019 changes. Makes OnResizeNeeded non-virtual. If we find a use-case where someone wants to override it we can change this back.
* Fixed FileDialog bounds warning
* Removed resharper settings from editorconfig
* Added Pos.Center test to AllViewsTests.cs.
Modernized RadioGroup.
Fixed ProgressBar.
* Reverted formatting
* Reverted formatting
* Reverted formatting
* Reverted formatting
* Reverted formatting
* Reverted formatting
* Reverted formatting
* Code cleanup
* Code cleanup
* Code cleanup
* Code cleanup
* Code cleanup
* Code cleanup
* Code cleanup
* Code cleanup
* Reverted formatting
* Moved Command.Accept/Enter key binding from Toplevel to Dialog and added unit tests
* Dialog binds Esc to Command.QuitTopLevel
* Better Dialog key binding tests
* Better MessageBox key binding tests
* List of changes:
1. Removed explicit type casting for `Application.QuitKey` in `KeyBindings.Add` method calls. This indicates that `Application.QuitKey` is already of type `KeyCode`.
2. Removed explicit type casting for `Application.AlternateForwardKey` in `KeyBindings.Add` method calls. This suggests that `Application.AlternateForwardKey` is already of type `KeyCode`.
3. Removed explicit type casting for `Application.AlternateBackwardKey` in `KeyBindings.Add` method calls. This implies that `Application.AlternateBackwardKey` is already of type `KeyCode`.
References to the code changes:
1. `KeyBindings.Add((KeyCode)Application.QuitKey, QuitApplication);` changed to `KeyBindings.Add(Application.QuitKey, QuitApplication);`
2. `KeyBindings.Add((KeyCode)Application.AlternateForwardKey, MoveForward);` changed to `KeyBindings.Add(Application.AlternateForwardKey, MoveForward);`
3. `KeyBindings.Add((KeyCode)Application.AlternateBackwardKey, MoveBackward);` changed to `KeyBindings.Add(Application.AlternateBackwardKey, MoveBackward);`
* The `Command.Accept` command now directly calls the `OnClicked` method and returns `true`, effectively incorporating the behavior of the now-removed `AcceptKey` method.
* Moved Command.Accept/Enter key binding from Toplevel to Window and added unit tests
* Fixes#3144. TextView Autocomplete does not insert capital letters
* Fixes#3144. Fix unit test for fix of TextView Autocomplete does not insert capital letters
* Fixes#3128. Some Key class unit tests does not run.
* Disabling duplicates warnings.
* Removes duplicate InlineData.
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
* Prefix private fields with underscore.
* Rename to SetInitialProperties.
* Ensures clear all selection if there isn't selecting.
* Fix format and replace duplicate key bindings for DeleteCharLeft.
* Test the new key binding for DeleteCharLeft.
* Fix formating when typing with selection which may broken the format.
* Fix copy/paste.
* Test data from 01/01/0001 to 12/31/9999.