Commit Graph

524 Commits

Author SHA1 Message Date
Tian L
fdae1000fc
Hello C# - Migrating the codebase from C++/CX to C# (Phase 1) (#1598)
* Hello C# - Going to an official feature branch (#1544)

* change CalcViewModel into a WindowsRuntimeComponent project (#5)

* change CalcViewModel into a WindowsRuntimeComponent project

* remove the old UI codebase (#6)

* initially migrated C# codebase by tian (#7)

* initial migrated C# codebase by tian

* format the codebase

* resolve comments

* undo: modifications on UI test project

* Remove the blocks that have more than 1 empty line.

* Register DP using keyword 'nameof'

* C# Migration: Initially migrated C# codebase by Han (#8)

* C# Migration: Initially migrated C# codebase by Han

* Resolved comments and misssing asset

* Added three files to Calculator project

* Added TODO comment and updated Object

* NavCategory: temporary resolution of the hang issue (#9)

* Updated CalcViewModel and missing files (#10)

* Updated CalcViewModel and WinMeta

* Added Calculator.rc

* Resolved comment for InitializeLocalizationSettings

* add: views/unitconverter.xaml (#11)

* add: views/unitconverter.xaml

* format the code

* remove the extra empty line

* add an empty line

* check null before invoking event handlers (#12)

* fix problems of the migration of OBSERVABLE_PROPERTY_RW (#13)

* fixes crash in MathRichEditBox.ctor() (#14)

* fixes crash in MathRichEditBox.ctor()

* typo

* Update azure-pipelines.ci.yaml for Azure Pipelines

* Added a link copy of CalcViewModel to temporarily pass Unit Tests (#16)

* Updated CalcViewModelCopyForUT configuration (#17)

* changes output path of the UI project to align with other projects (#15)

* fixes EETypeLoadException issue: export class DelegateCommand (#18)

* fixes EETypeLoadException issue: export class DelegateCommand

* weak-reference in C++/CX

* WeakRef in C# codebase

* UTF-8-BOM

* spaces in macro

* resolve some comments from the offline review

* format

* rename file

* fixes the memory list issue (#20)

* fixes a wrongly migrated property

* UTF-8-BOM

* fixes up the crash of type casting (#21)

* Update localized strings 2021-01-04 (#1458) (#23)

(cherry picked from commit cdcb95656d)

Co-authored-by: Matt Cooley <macool@microsoft.com>

* Fixup tests (#1429) (#24)

- Removed unneeded "ToString" calls
- Fixed typos
- Renamed "fEButtonState" to "FEButtonState"

(cherry picked from commit 66ad328d00)

Co-authored-by: N <71219152+PokeCodec@users.noreply.github.com>

* Update graph internal engine verseion (#1466) (#25)

(cherry picked from commit 0048dcb500)

Co-authored-by: Quentin Al-Timimi <27322516+quentin987@users.noreply.github.com>

* Turn off DFS file shares in internal build system (#1470) (#26)

(cherry picked from commit 885fa23a89)

Co-authored-by: Matt Cooley <macool@microsoft.com>

* Improve clarity of math expressions in history for Standard Calculator (feature #138) (#1453) (#27)

* Implemented feature & added unit tests

* Fixed more unit/ui tests

* Refactored tests

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

(cherry picked from commit 565e3e2714)

Co-authored-by: Wei (Waley) Zhang <waley.zhang@microsoft.com>

* Adds unit-test cases for NarratorAnnouncement after fixing issue #1386 (#1469) (#28)

* fix bug: No confirmation is announced by the narrator after activating 'Remove equation' button #1386

* Unit Test: Add NarratorAnnouncementUnitTests

Co-authored-by: tain <tankle_@hotmail.com>
(cherry picked from commit 9d8e2ad18c)

Co-authored-by: Tian L <60599517+MSFT-Tilia@users.noreply.github.com>

* Move localization pipeline sync schedule to the YAML file (#1478) (#30)

(cherry picked from commit 007eccd940)

Co-authored-by: Matt Cooley <macool@microsoft.com>

* remove the strong reference carried from delegate (#32)

* Remove the finalizer of ControlSizeTrigger (#31)

* Normalize the namespace of CalcViewModel (#33)

* ViewMode: arrange namespaces

* UI build pass

* run release

* UT build pass

* pass build

* resolve comment: make the diff results cleaner

* resolve comment: make the diff results cleaner (2)

* resolve comment: make the diff results cleaner (3)

* resolve comment: move impl into a namespace

* update: spaces

* update: CalculatorButtonUser.h

* UTF-8 to UTF-8-BOM

* remove ViewState.h/.cpp from CalcViewModel path

* revert changes for NavCategory.cpp

* remove extra space

* remove UCM

* remove BOM

* Fixed a graphing calculator "permissions" bug caused by PR #1426 (#1471) (#34)

- The PR #1426 can cause a crash when no users are returned via `User::FindAllAsync(UserType::LocalUser)` when subsequently trying to access the first user. The existing code also does not guarantee that the returned user is the currently active user.
- This fix retrieves the user that opened the app and passes this user into a function to check if this user has the proper permissions to access the graphing mode. This makes sense since the active user is indistinguishable (at least from the app's perspective) to the user who opened the app. This user's permissions are then propagated downwards to properly set up the navigation menu of the app.
- Implementation detail worth pointing out: `s_categoryManifest` is what is used to populate the navigation menu of the app, but this variable is static by design, so a separate function was written to override the appropriate `isEnabled` value in `s_categoryManifest`. This function is called by `onLaunched`.

- Manual testing

Co-authored-by: Wei (Waley) Zhang <waley.zhang@microsoft.com>

* fixes up a bug (#35)

* fix csproj (#37)

Co-authored-by: hanzhang54 <zhangh@microsoft.com>
Co-authored-by: Matt Cooley <macool@microsoft.com>
Co-authored-by: N <71219152+PokeCodec@users.noreply.github.com>
Co-authored-by: Quentin Al-Timimi <27322516+quentin987@users.noreply.github.com>
Co-authored-by: Wei (Waley) Zhang <waley.zhang@microsoft.com>
Co-authored-by: Tian L <60599517+MSFT-Tilia@users.noreply.github.com>

* **BYPASS_SECRET_SCANNING** (#1546)

* Fixes a bug about the UI of expression tokens (#1547)

* fix

* [FeatureBranch] Fixes x86/ARM/ARM64 builds for the CI-Pipeline (#1550)

* **BYPASS_SECRET_SCANNING**

* fix

* fixes x86/ARM/ARM64 builds for CI-Pipeline

* Add headers missing for compilation with GCC (#1468) (#1551)

Things that required such update included:
* `wstringstream`
* `setprecision`
* `SCODE_CODE`, `E_BOUNDS`
* Various SAL macros

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>

* Update nuget.config file (#1486) (#1552)

Co-authored-by: Matt Cooley <macool@microsoft.com>

* Fixes up some simple miscellaneous TODO items (#1556)

* #DEBUG is a known C# preprocessor directive

* So far, we haven't observed the problem described in the comment from C# async

* fixes misc TODO items

* resolve some warnings (#1564)

* Add internal CI pipeline (#1553) (#1565)

* Add CI-internal pipeline

* No ARM64, to match release

Co-authored-by: Matt Cooley <macool@microsoft.com>

* Temporarily disable PGO NuGet package (#1510) (#1566)

Co-authored-by: Matt Cooley <macool@microsoft.com>

* [C# Calc]Removes WinMeta.cs (#1567)

* remove WinMeta.cs

* undo a trivial change

* UTF-8 BOM

* [C# Calc] Reverts some changes for Currency constants (#1570)

* Update2108release - experimental (#1572)

* adjusts Calculator.csproj (#1571)

* fixes BinSkim problems (#1573)

* fixes an issue around line style (#1575)

* fixes the missed NULLs (#1576) (#1578)

* Fix the Missing Part in Unit Converter Constructor (#1579)

* fixes: calculator doesn't remember its previous mode (#1580)

* Fixes: GraphingNumber doesn't work correctly (#1585)

* fixes: GraphingNumber doesn't work correctly

* Avoid crashing

* fixes binding (#1586)

* resolve TODO items (#1589)

* Improving keyboard support in VariableValueSlider (#1559) (#1595)

Co-authored-by: Dave Grochocki <grochocki@users.noreply.github.com>

* [C# Calc] Fixes: Keep the value away from getting rounded in Graphing Mode (#1596)

* keep the value away from getting rounded

* set the display precision to 6 to align with C++ impl

* fixes the button-light-up time (#1597)

* fixes up merging flaws

* Update2108release

* fixes (#1599)

* keep master for ci pipeline

* remove the Resources filter from CalcViewModel project

* removes `that` since `this` can be captured automatically

* AppxBundlePlatforms

* StampAssemblyInfo

* removes PreferredToolArchitecture

* Change the arg AppVersion into Version

* Change the arg AppVersion into Version

* from Calculator.rc to AssemblyInfo.cs

* Adds assembly-info

Co-authored-by: hanzhang54 <zhangh@microsoft.com>
Co-authored-by: Matt Cooley <macool@microsoft.com>
Co-authored-by: N <71219152+PokeCodec@users.noreply.github.com>
Co-authored-by: Quentin Al-Timimi <27322516+quentin987@users.noreply.github.com>
Co-authored-by: Wei (Waley) Zhang <waley.zhang@microsoft.com>
Co-authored-by: Tian L <60599517+MSFT-Tilia@users.noreply.github.com>
Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>
Co-authored-by: Dave Grochocki <grochocki@users.noreply.github.com>
2021-07-15 17:12:38 +08:00
Tian L
d5044b1292
fixes the missed NULLs (#1576) 2021-06-10 14:10:53 +08:00
Dave Grochocki
3cc3eaf4e0
Improving keyboard support in VariableValueSlider (#1559) 2021-06-03 03:23:45 -07:00
Michał Janiszewski
f30e9494ce
Clang-format most of the sources (#1467) 2021-05-10 10:18:39 -07:00
Matt Cooley
f7d0118064
Update localized strings 2021-05-05 (#1539) 2021-05-10 10:14:47 -07:00
achmurali
ea61391a62
Disabled focus for 2nd button (#1523)
Co-authored-by: achmurali <achmurali@github.com>
2021-04-20 12:08:35 -07:00
Matt Cooley
ce4f3d5943
Update localized strings 2021-04-07 (#1521) 2021-04-20 10:38:06 -07:00
Matt Cooley
947f099455
Update localized strings 2021-03-08 (#1511) 2021-03-08 13:40:07 -08:00
Matt Cooley
12110936eb
Temporarily disable PGO NuGet package (#1510) 2021-03-08 09:33:39 -08:00
Matt Cooley
fdf7242cf0
Update build year to 2021 (#1487) 2021-02-03 07:32:38 -08:00
Matt Cooley
ef00b91619
Update nuget.config file (#1486) 2021-02-02 11:05:26 -08:00
Wei (Waley) Zhang
fd2367d483
Fixed a graphing calculator "permissions" bug caused by PR #1426 (#1471)
## Fixes a bug caused by https://github.com/microsoft/calculator/pull/1426#.


### Description of the changes:
- The PR #1426 can cause a crash when no users are returned via `User::FindAllAsync(UserType::LocalUser)` when subsequently trying to access the first user. The existing code also does not guarantee that the returned user is the currently active user.
- This fix retrieves the user that opened the app and passes this user into a function to check if this user has the proper permissions to access the graphing mode. This makes sense since the active user is indistinguishable (at least from the app's perspective) to the user who opened the app. This user's permissions are then propagated downwards to properly set up the navigation menu of the app.
- Implementation detail worth pointing out: `s_categoryManifest` is what is used to populate the navigation menu of the app, but this variable is static by design, so a separate function was written to override the appropriate `isEnabled` value in `s_categoryManifest`. This function is called by `onLaunched`.

### How changes were validated:
- Manual testing
2021-02-02 08:31:44 -08:00
Michał Janiszewski
d4be50490f
Add headers missing for compilation with GCC (#1468)
Things that required such update included:
* `wstringstream`
* `setprecision`
* `SCODE_CODE`, `E_BOUNDS`
* Various SAL macros
2021-02-01 08:40:49 -08:00
Tian L
9d8e2ad18c
Adds unit-test cases for NarratorAnnouncement after fixing issue #1386 (#1469)
* fix bug: No confirmation is announced by the narrator after activating 'Remove equation' button #1386

* Unit Test: Add NarratorAnnouncementUnitTests

Co-authored-by: tain <tankle_@hotmail.com>
2021-01-21 16:27:18 -08:00
Wei (Waley) Zhang
565e3e2714
Improve clarity of math expressions in history for Standard Calculator (feature #138) (#1453)
* Implemented feature & added unit tests

* Fixed more unit/ui tests

* Refactored tests

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp

* Update HistoryTests.cpp
2021-01-20 13:21:27 -08:00
N
66ad328d00
Fixup tests (#1429)
- Removed unneeded "ToString" calls
- Fixed typos
- Renamed "fEButtonState" to "FEButtonState"
2021-01-11 14:40:27 -08:00
Tian L
737cd15562
fix bug: No confirmation is announced by the narrator after activating 'Remove equation' button #1386 (#1465) 2021-01-11 13:48:27 -08:00
Hongxu Xu
f910d64d88
Handle Space and Enter KeyDown event for About button (#1459) 2021-01-11 11:46:08 -08:00
Matt Cooley
cdcb95656d
Update localized strings 2021-01-04 (#1458) 2021-01-06 10:50:32 -08:00
Chaitanya Mehta
7d8803dd1a
Fix copy-pasting result computed by the calculator gives "Invalid input" (#1444)
* Remove exponent value from operand length

* Copy paste test with boundary exponential numbers.
2020-12-17 10:15:24 -08:00
Rudy Huyn
3172f7fea2
Prevents the user interface from shifting upwards at launch (#633)
Co-authored-by: Matt Cooley <macool@microsoft.com>
Co-authored-by: Pepe Rivera <joseartrivera@gmail.com>
2020-12-16 14:46:37 -08:00
Chaitanya Mehta
c4793785c3
Add link to GitHub repo on about flyout (#1449)
* Add link to GitHub repo on about flyout

* Update AboutFlyout page GitHub link margin.

* Update AboutPage GitHub link string.
2020-12-10 21:04:18 -08:00
Hongxu Xu
61d06b2d2f
Use different formatter for different currency (#1432)
* Use different formatter for different currency

* Add functional tests for currency fraction digit format

* Revert "Add functional tests for currency fraction digit format"

This reverts commit bd8aab33847425f4dcfd0d76ce310c918729b2fd.

* Add TestCurrencyFormattingLogic in UnitConverterViewModelUnitTests

* Fix InitializeMultipleConverterTest

* Add comment for a line of code

* Add default case for switch in ConvertToLocalizedString

* Remove trailing decimal
Disable decimal input if maxFractionDigits is 0
Fix input may be blocked after switched active

* Fix: UpdateIsDecimalEnabled should do nothing for non-currency converter

* Remove unnecessary SetValue method

* Add a comment

* Add functional UI Tests for currency converter
Reset currency before tests
Fix: input is blocked after switching to currency with less fractional digits

* Set Priority=0 for currency format related tests

* Truncate digits in display value after switcing
To fix incorrect result after switching currency with less fractional digits
2020-12-02 11:04:22 -08:00
Matt Cooley
6359a14a9b
Update localized strings 2020-12-01 (#1447) 2020-12-01 11:02:34 -08:00
Crystal Edwards
c3ed03ccfd
Adding Test Method "KeyboardInput_HistoryHotkeys" (#1431)
Now that #744 has been fixed, I'm adding Test Method "KeyboardInput_HistoryHotkeys" to test the functionality of history hotkeys such as [Shift] + [Ctrl] + [D] to help prevent a regression or a break.
2020-11-12 11:48:40 -08:00
Hongxu Xu
296cf038b9
Lock m_renderMain in Grapher::TryInitializeGraph to avoid modifying m_graph during rendering (#1430) 2020-11-11 09:40:39 -08:00
Bura Chuhadar
483dacbeff
Fixes issue #1409 (#1412)
* Fixes issue #1409

Copy pasting into Currency locks the editor.
Skipping the validation of full editor lock when backspace or clear button is clicked.

* Adding code review feedback.

* Adding code review feedback.
2020-11-10 09:56:39 -08:00
Stephanie Anderl
15ae66626a
switch to use policy manager apis for detecting graphing policy (#1426)
* switch to use policy manager apis for detecting graphing policy

* Remove RegGetValueW from NavCategory.cpp since it is no longer used.
2020-11-05 15:08:39 -08:00
Matt Cooley
1ab43949fd
Update localized strings 2020-11-03 (#1422) 2020-11-04 12:06:24 -08:00
Seija
13d8b04d8d
Changed output of GetCurrentRadix to match the variable type of m_radix (#1416)
Co-authored-by: PokeCodec <67983839+PokeCodec@users.noreply.github.com>
2020-10-28 14:40:57 -07:00
Leonid
dd9d948408
fix: change floppy disk size (#1411)
It is 1474560 bytes for standard 3,5' floppy
2020-10-27 18:24:53 -07:00
Wei (Waley) Zhang
4e9d014b5d
Clarified period definition (#1408) 2020-10-27 15:57:28 -07:00
Wei (Waley) Zhang
8cdc177658
Fixed Negative Button for converters inconsistent with visibility (#1410)
When the unit converter's category is changed, the corresponding property setter for the CurrentCategory variable mistakenly calls OnPropertyChanged("CurrentCategory") instead of RaisePropertyChanged("CurrentCategory"). This results in a failure to notify XAML that the CurrentCategory variable has changed, resulting in the corresponding UI to not be updated accordingly.
2020-10-27 15:56:21 -07:00
Jack Rainy
903b231b1f
Edit fields are scalable for large fonts (#1401)
* Edit fields are scalable for large fonts

* Retain the initial width of edit fields, but scale if needed
2020-10-22 09:28:26 -07:00
Stephanie Anderl
c97f1c6430
Fix typo in splash icon names (#1400)
* Fix typo in splash screen icon names

* Update the internals version to match the internal change

* Update the internals version to match the internal change
2020-10-01 17:22:22 -07:00
Eric Wong
41c182f45d
fix UI tests in lab runs (#1375) 2020-09-21 18:07:31 -07:00
Eric Wong
3f11e906bd
update resw files with latest translations (#1376) 2020-09-21 12:51:20 -07:00
Stephanie Anderl
7ac14aa852
Add altform-colorful splashscreen pngs (#1374)
* add altform-colorful splashscreen pngs

* Clean up graphing dll tags in Calculator.vcxproj.filters
2020-09-15 22:28:04 -07:00
Stephanie Anderl
a0f98ca76b
Improved error handing for function analysis for functions in the f(y) format (#1338)
* Updated the CanFunctionAnalysisBePerformed api to use the updated one with variableIsNotX error handling. Updated the UI to reflect the new descriptive error case to show an informative error.

* Fixed spacing and updated the moved the variableIsNotX check up into the parent if statement

* Update the internals version to match the version needed to support this change
2020-09-15 14:27:22 -07:00
Rudy Huyn
bc473617ae
Simplify KeyboardShortcutManager and correctly support Alt-Gr key (#1223)
* Simplify KeyboardShortcutManager and correctly support Alt-Gr key

* replace multimap with map
move all global fields-functions to the class

* feedback

Co-authored-by: Eric Wong <eriwong@microsoft.com>
2020-09-15 12:43:50 -07:00
Eric Wong
6d059aa126
Fix Race condition in tests involving context menu (#1373)
* Fix Race condition in tests involving context menu

* remove extraneous logging
2020-09-15 11:08:22 -07:00
Jack Rainy
d256fb6c19
Take the boundary of signed negative values into account( Fix issue 1301) (#1336)
* Take the high boundary of signed negative values into account

* UI unit tests for the Copy/Paste menu are added

* Additional corner case for the number notations without negative values
2020-09-14 15:11:17 -07:00
Stephanie Anderl
503c27ae7b
Update WinUI Version to 2.4 (#1354)
* Updated to WinUI2.4 and fixed NavMenu about flyout and Dark Mode EquationEditBox

* Added updated equationbox background to the focusederror state
2020-09-01 16:48:22 -07:00
Pepe Rivera
5336079e32
Loc patch (#1357) 2020-08-31 20:52:57 -07:00
Stephanie Anderl
96c1a45774
Revert "Updated the Calculator projects to include the /Z7 compiler flag" (#1356)
* Revert "Updated the Calculator projects to include the /Z7 compiler flag (#1337)"

This reverts commit 6299ec2303.

* Update Calculator.vcxproj

Add  %(AdditionalOptions) where it is missing

* Update TraceLogging.vcxproj

Updated the AdditionalOptions to add /await /std:c++17 /utf-8  so this project is consistent with the other projects.
2020-08-25 09:31:40 -07:00
Lee Won Jun
9206520121
Change the initialization time of Radio button's isChecked (#1312)
* Change the initialization time of Radio button's isChecked

* Rollback checkDefaultBitShift and Use Enum instead of String

* Fix Check Default
- In previous versions, there was an issue where button availability was reset when opening BitShift Flyout not when the mode is changed

* Reset Calculator Type in Calculator ViewModel when mode change to not Calculator mode

* Revert "Reset Calculator Type in Calculator ViewModel when mode change to not Calculator mode"

This reverts commit a0d2f84513bc2d36fea3d75445782e1c67bc2e8d.

* Check deferred load button
2020-08-20 15:30:48 -07:00
Callum Shipton
95a1ba4c8c
'Keep on top' button appears last in the tab order (#1339) (#1347)
- Added TabIndex to AlwaysOnTop button
2020-08-12 09:14:45 -07:00
Callum Shipton
331388c000
Enable keyboard entry in bit-toggling mode #478 (#1346)
The programmer radix buttons were being disabled when the bit flip panel was selected, causing keyboard events to be ignored.
They should actually only be hidden in bit flip mode.

- Corrected programmer radix buttons to continue being enabled just hidden when the programmer calculator is in bit flip mode.
- Renamed AreProgrammerRadixOperatorsEnabled property to the more appropriate AreProgrammerRadixOperatorsVisible.
2020-08-12 08:53:31 -07:00
Rudy Huyn
1c8b642376
Remove ICustomPropertyProviders (#1229)
* Remove unused ICustomPropertyProviders
* Modify UI tests to not use Customproperties
2020-08-12 08:22:49 -07:00
Stephanie Anderl
6299ec2303
Updated the Calculator projects to include the /Z7 compiler flag (#1337)
* Added the /Z7 compiler flag

* added /Z7 compiler flag to remaining calculator projects

* Add %(AdditionalOptions) to complier configuration where it is missing
2020-08-11 15:39:32 -07:00