Commit Graph

4545 Commits

Author SHA1 Message Date
BDisp
a2c7e51db4 Remove constructors with frame parameters from ScrollView class. 2024-01-15 21:53:41 +00:00
BDisp
ec47ab1de5 Remove constructors with frame parameters from ScrollBarView class. 2024-01-15 21:42:27 +00:00
BDisp
e42c80a439 Remove constructors with frame parameters from ListView class. 2024-01-15 21:31:54 +00:00
BDisp
01f8681846 Remove constructors with frame parameters from Label class. 2024-01-15 20:57:17 +00:00
BDisp
e71f970dea @BDisp
Remove constructors with frame parameters from FrameView class.
2024-01-15 20:24:17 +00:00
BDisp
61c1cab24e Remove constructors with frame parameters from ComboBox class. 2024-01-15 19:18:48 +00:00
BDisp
cdb3d6f355 Cleanup code. 2024-01-15 19:03:05 +00:00
BDisp
6d6553a2a4 Remove constructors with frame parameters from CheckBox class. 2024-01-15 18:32:13 +00:00
BDisp
6b190d6dfd Remove constructors with frame parameters from Button class. 2024-01-15 17:55:54 +00:00
Tig
b84862d0bd Fixes #3172. Application.ResetState wasn't resetting all it should (#3173)
* Removed resharper settings from editorconfig

* Fixed Applicaton.ResetState. New unit tests

* Tweaked pull request template
2024-01-14 16:35:17 -07:00
BDisp
17e7673cd3 Fixes #2981. LegendAnnotation: 'Frame.DrawFrame(Rect, bool)' is obsolete: 'This method is obsolete in v2. Use use LineCanvas or Frame (#2982)
* 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>
2024-01-14 16:18:44 -07:00
BDisp
96f7597050 Fixes #3166. TimeField should use TextChanging instead of TextChanged event. (#3167)
* 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>
2024-01-14 16:03:03 -07:00
BDisp
d95fe1466c Fixes #3160. TextField doesn't update correctly the CursorPosition on Paste. (#3161)
* 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.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2024-01-14 16:02:54 -07:00
BDisp
43b889d1b1 Fixes #3157. DateField is validating wrong the date on different culture than us-US. (#3165)
* 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.
2024-01-14 15:54:07 -07:00
Tig
7fe95cb9c7 Renames Frame->Adornment; changes Frame to have a Border subclass (#3158) 2024-01-13 20:11:17 -07:00
Tig
d54461fc01 Fixes #1720 - ColorPicker pop up example (in ProgressBarStyles Scenario) (#3154)
* Removed resharper settings from editorconfig

* initial commit

* Lots of tweaks
2024-01-13 12:01:01 -07:00
Maciej
545c010731 Fixes #2019: Introduce DatePicker (#3134)
* 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>
2024-01-13 08:59:58 -07:00
Tig
6ad36b7ac9 Fixes #2944. TreeView unit tests fail intermittently: Ensures Attribute and Color are read only value types (#3163)
* 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]
2024-01-13 08:54:20 -07:00
Tig
d2ad11248f Fixes #3127 - View Layout improvements - Redefines how LayoutStyle works. Fixes AutoSize etc... (#3130)
* 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
2024-01-12 17:43:35 -07:00
Tig
4cc6339192 Removed resharper settings from editorconfig (#3153) 2024-01-10 13:27:34 -07:00
Tig
707dbda71b Fixes #3072, #3148. Dialog and MessageBox key binding do not handle Enter correctly (#3151)
* 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
2024-01-10 13:22:18 -07:00
Maciej
0aff2f1c87 Fixes #3149: UICatalog - Notepad example improvements (#3150)
* Fix the application crashing when closing the save file dialog without saving

* Allow user to write in multiple tabs without saving file

* Maintain code consistency

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2024-01-09 11:38:45 -07:00
Tig
12fb26a526 Updates Key unit tests with easier to edit/read MemberData (#3147)
* Prototype

* Makes MemberData test easier to write/read

* Makes MemberData test easier to write/read
2024-01-09 11:35:06 -07:00
joebart457
3150d43979 Fixes #3144. TextView Autocomplete does not insert capital letters (#3145)
* Fixes #3144. TextView Autocomplete does not insert capital letters

* Fixes #3144. Fix unit test for fix of TextView Autocomplete does not insert capital letters
2024-01-08 12:11:11 -07:00
Ross Ferguson
eb45036848 Fixes #3132 #3138 ComboBox (v2) One key delay when keying down arrow. Up arrow does not move back to searchbox (#3133)
* Fixes #3132 ComboBox one key delay when keying down arrow to move into dropdown list

* Fixes #3138. ComboBox. Up arrow does not move you back into the search box when at the top of dropdown list

* Fixes #3138 Fix unittest

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2024-01-08 12:09:59 -07:00
BDisp
d69de86ba4 Fix Disposing unit tests that sometimes throws because some instances aren't cleared on others unit tests classes. (#3142) 2024-01-08 12:08:48 -07:00
BDisp
b2aeb3887d Fixes #3128. Some Key class unit tests does not run. (#3129)
* 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>
2024-01-08 02:06:13 -07:00
BDisp
93c6b1fe44 Fixes #3124. 0001 for year in DateField. (#3131)
* 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.
2024-01-07 19:25:20 -07:00
Tig
c6570a5bfd Fixes #3098 & #3099 - Slider bugs (#3121)
* Fixed bugs

* Fixed #3098

* Fixed a slew of issues

* Fixed a slew more of issues

* Code cleanup. Fixed unit test failure

* Code cleanup.

* Code cleanup.

* Code cleanup.
2024-01-05 07:38:54 -07:00
Tig
7af54f369d Robustness improvements in prep for implementing Virtual Terminal Sequences (#3094)
* Fixes #2616. Support combining sequences that don't normalize

* Decouples Application from ConsoleDriver in TestHelpers

* Updates driver tests to match new arch

* Start on making all driver tests test all drivers

* Improves handling if combining marks.

* Fix unit tests fails.

* Fix unit tests fails.

* Handling combining mask.

* Tying to fix this unit test that sometimes fail.

* Add support for combining mask on NetDriver.

* Enable CombiningMarks as List<Rune>.

* Prevents combining marks on invalid runes default and space.

* Formatting for CI tests.

* Fix non-normalized combining mark to add 1 to Col.

* Reformatting for retest the CI.

* Forces non-normalized CMs to be ignored.

* Initial experiment

* Created ANSiDriver. Updated UI Catalog command line handling

* Fixed ForceDriver logic

* Fixed ForceDriver logic

* Updating P/Invoke

* Force16 colors WIP

* Fixed 16 colo mode

* Updated unit tests

* UI catalog tweak

* Added chinese scenario from bdisp

* Disabled AnsiDriver unit tests for now.

* Code cleanup

* Initial commit (fork from v2_fixes_2610_WT_VTS)

* Code cleanup

* Removed nativemethods.txt

* Removed not needed native stuff

* Code cleanup

* Ensures command line handler doesn't eat exceptions

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2024-01-04 22:35:18 -07:00
BDisp
e2a59050fe Fixes #3122. Shift-Tab is broken on TextView. (#3123) 2024-01-04 22:15:14 -07:00
BDisp
0484fc8bf9 Cleans up key handling in drivers (was "fixes VkeyPacketSimulator is broken") (#3078)
* Fixes #3054. VkeyPacketSimulator scenario is broken.

* Fix some key handle and unit tests.

* Remove unnecessary conditional.

* Improves key handling.

* Also allow map capslock to shift with accented characters.

* Change to MemberData.

* Remove unnecessary using.

* Fix merge errors.

* Fixes #3095. WindowsDriver should return the mask keys to IsShift, IsAlt and IsCtrl return the right value.

* Modifiers keys are valid to be handled on key down and key up.

* Map KeyCode.Enter to ConsoleKey.Enter and vice versa.

* Updated ScanCodeMapping table with readable constants

* Documented bugs

* Implemented mapping using MapVirtualKeyEx

* Implemented mapping using MapVirtualKeyEx

* Changed KeyCode special keys to match ConsoleKey values + max unicode codepoint

* Fixed bogus CollectionNavigator impl and tests

* Nuked DeleteChar. renamed InsertChar to Insert

* KeyCode.Enter = ConsoleKey.Enter, not \n

* Code cleanup

* Added diag for keyboard layout name

* Fixed AltGr support (hopefully)

* Simplified code

* Simplified KeyCode by removing ShiftKeys

* Fixed TextView

* Code cleanup

* Fixes cursesdriver (somewhat)

* Code cleanup

* netdriver wip

* Fixed netdriver under WSL

* Turned off debug spew

* Removed old code

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
Co-authored-by: Tig Kindel <tig@kindel.com>
2024-01-04 12:37:01 -07:00
Tig
bc41d9bc09 Fixes #2465 - Simplify/Enforce LayoutStyle.Absolute when X, Y, Width, and/or Height are null or Absolute() (#2467)
* Merged v2_develop; updated API docs

* Code cleanup

* Fixed code that was using Dim/Pos before IsInit

* Fixed ComboBox using Bounds before IsInitalized and grabbing focus when it shouldn't

* Fixed ComboBox tests. Fixed FileDialog

* Fixed all !IsInitalized warnings

* Fixed AllviewsTester

* Fixed CharMap scenario

* Fixed ColorPicker (hack)

* Fixed CoputedLayout and Csv Editor

* Imrpoved warning

* Fixed more warnings

* Fixed GetTextFormatterSizeNeededForTextAndHotKey

* Fixed AllViewsTester

* AllViewsTester code cleanup

* AllViewsTester code cleanup

* AllViewsTester fixed for realz

* Decided Fill was better than Percent for default
2024-01-04 10:40:47 -07:00
Tig
3b394c8104 Fixes #3115. TextView should use Command.ShowContextMenu not Command.Accept (#3118)
* Command.Accept->Command.ShowContextMenu + Unit Test

* fixed unit test
2024-01-04 10:40:02 -07:00
BDisp
0b7ca7bf44 Fixes #3097. Now that View is IDisposable, it should expose a Disposing event. (#3104) 2024-01-04 07:13:31 -07:00
Maciej
3d829d71db Fixes #3106: Combo Box selection fixes (#3117)
* Search selected item on filtered set

* Fix unit test - don't return first item when combobox is not focused or showed

* Improve method readability

* Clean selection from previous search

* Update unit test - after changing search text unselect previously selected item
2024-01-03 17:07:33 -07:00
Thomas Nind
8954fa5ecf Add constructor overload to SliderOption<T> (#3101)
* Add constructor overload to SliderOption

* Adjust whitespace

* Move tests to SliderOptionTests

* Empty commit for CI
2023-12-31 05:45:20 -07:00
Thomas Nind
55bf53336a Add ToString implementation for SliderOption<T> (#3103)
* Add ToString implementation for SliderOption<T>

* Add test case for SliderOption ToString with more complex class
2023-12-31 05:44:42 -07:00
Tig
80ef4b5e19 Fixes #3071 & #3079. Key cast and static props are not correct (#3089)
* Removed char->Key cast. Added Key(char)

* Re-added char->key cast. Added unit tests

* Fixed standard keys to always return new instead of being readonly

* Re-fixed WindowsDriver to report shift/alt/ctrl as key/down/up

* Re-fixed WindowsDriver to report shift/alt/ctrl as key/down/up

* Adds string constructor to Key + tests.

* Simplified Key json

* Added string/Key cast operators.
2023-12-27 15:50:37 -07:00
Tig
a7209bcd88 Improves robustness of Dim, Pos, and SetRelativeLayout (#3077)
* Updated overview docs

* Updated toc

* Updated docs more

* Updated yml via dependabot

* Initial work in progress

* Fixed some autosize things

* Revamped Pos / Dim API docs

* Removed margin

* horiz->width

* Updated MessageBoxes and Dialogs Scenarios to use AutoSize

* AutoSize->Auxo

* Adds validation

* prep for Dialog to use Dim.Auto - Simplify unit tests to not depend on things not important to the unit test (like Dialog)

* prep for Dialog to use Dim.Auto - Simplify unit tests

* prep for Dialog to use Dim.Auto - Simplify unit tests

* prep for Dialog to use Dim.Auto - Make Dialog tests not depend on MessageBox

* Started on DimAuto unit tests

* started impl on min/max.

* started impl on min/max.

* Added DimAutoStyle

* Added arg checking for not implemented features

* Temporarily made DimAutoStyle.Subviews default

* Removed unneeded override of Anchor

* Fixed GethashCode warning

* Implemented DimAuto(min)

* Fixed unit tests

* renamed scenario

* WIP

* Moved ViewLayout.cs into Layout folder

* Clean up cocde formatting

* Renamed and moved SetFrameToFitText

* Fixed API docs for SetRelativeLayout

* Factored out SetRelativeLayout tests

* Better documented existing SetRelativeLayout behavior + unit tess

* Debugging Pos.Center + x in SetRelativeLayout - WIP

* Progress on low level unit tess

* Initial commit

* Restored unmodified scenarios

* Bump deps
2023-12-26 09:28:43 -07:00
BDisp
3f35352561 Fixes #3066. The last RunIteration only work on WindowsDriver (#3067)
Co-authored-by: Tig <tig@users.noreply.github.com>
2023-12-26 09:25:33 -07:00
Thomas Nind
e885af0282 Support for publishing UICatalog as single file (#3074) 2023-12-26 09:15:00 -07:00
BDisp
2c8f4034b8 Fixes #3080. Potentially unintended behavior of static pre-defined Attribute.Default in Attribute class (v2) (#3091) 2023-12-26 08:29:16 -07:00
Andrey Akinshin
7822cd8100 Fix MouseEvent.ToString() (#3068) 2023-12-20 19:16:20 -07:00
BDisp
74afd18148 Fixes #3064. Pos.View returns PosCombine (#3065) 2023-12-19 16:34:17 -07:00
Tig
06ad562bc6 Update v2's yml with latest actions (#3061)
* Updated overview docs

* Updated toc

* Updated docs more

* Updated yml via dependabot
2023-12-17 22:01:01 -07:00
Tig
49ec9b7342 Updates V2 API docs (#3060)
* Updated overview docs

* Updated toc

* Updated docs more
2023-12-17 21:52:59 -07:00
Tig
7f759b573b Fixes #3055: Remove Key.Unknown (#3057)
* Simplifies Key.IsValid

* Updated unit tests

* Fixed menu
2023-12-17 14:43:19 -07:00
Tig Kindel
92cf2a0529 created token 2023-12-17 13:13:19 -07:00
Tig Kindel
1c8a69a99d Trying github.ref_name 2023-12-17 12:57:52 -07:00