Commit Graph

505 Commits

Author SHA1 Message Date
Dave Grochocki
0f9bd40b89
Updating terminology in new feature development process for clarity (#509) 2019-05-17 11:52:02 -07:00
Mahdi Ghiasi
9b920f0d86 Removed entrance transition for about button in NavigationView (#506) 2019-05-17 11:10:28 -07:00
Rudy Huyn
9f47fe3fc8 Fix unit tests to run on non-english devices (#289)
* Force en-US for unit tests

* fix some spacing issues after merge

* remove default argument of LocalizationService to fix compilation issue in Release mode
2019-05-14 09:57:58 -07:00
Mahdi Ghiasi
860d6d3eb2 Removed GroupName from JumpList so items can't be pinened or removed by user. (#499)
https://stackoverflow.com/a/39436591/942659
2019-05-13 17:01:28 -07:00
Rudy Huyn
d8cb5c82a8 Keep spaces when users copy an error message (#430)
Verify if the StandardCalculatorViewModel::DisplayValue isn't an error message before removing group separators (including space character).

How changes were validated:
Tested in english and french
Tested with "Cannot divide by zero" and "Result is undefined"

Fixes #420
2019-05-10 22:55:15 -04:00
Lucas Larson
dcc731f111 Repair empty link in ApplicationArchitecture.md (#502)
Link to the same infinite-precision-arithmetic article on Wikipedia as in README.md

Fixes
Existing output in the ApplicationArchitecture.md is a literal
[infinite precision][Infinite Precision]. It should be a link to https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic.

Description of the changes:
This patch assumes the author intended to link to the same Wikipedia article linked to in README.md
2019-05-10 22:20:21 -04:00
Matt Cooley
b82f571774
Updating version of release builds to 1905 (#500) 2019-05-10 11:17:43 -07:00
Matt Cooley
c568ec787e
Update localized strings 2019-05-09 (#496) 2019-05-09 16:13:32 -07:00
Rudy Huyn
28888d8df1 Remove Serialize/Deserialize functions never used in StandardCalculatorViewModel, UnitConverter, UnitConverterViewModel and CalculatorManager (#392)
* remove unused serializer

* remove all unused serialization/deserialization from StandardCalculatorViewModel and UnitConverterViewModel

* formatting
2019-05-09 11:01:43 -07:00
Rudy Huyn
750130c2bc Accept exponential numbers without -/+ sign. (#270)
* add exponential without sign support

* Add unit tests

* fix formatting

* remove extra spaces

* modify unit tests
2019-05-09 10:10:17 -07:00
Daniel Belcher
9f01c8168b
Secondary formatting changes (#489)
Description of the changes:
Adjusted some of the values in .clang-format
Add clang-format-all.ps1
Fix path to .clang-format in Calculator.sln

How changes were validated:
Manual.
2019-05-02 16:48:33 -07:00
Oleg Abrazhaev
2826d37056 Fix the project code style, as it is not consistent. (#236)
Fixes #202
This PR fixes code style for the project files.

The Problem
Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project.

Description of the changes:
Have investigated and determined the most used code style across the given codebase
Have configured IDE and applied code style to all project files.
Have crafted clang-formatter config.
see https://clang.llvm.org/docs/ClangFormat.html
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
Some cases were fixed manually
How changes were validated:
manual/ad-hoc testing, automated testing

All tests pass as before because these are only code style changes.
Additional
Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
2019-05-02 11:59:19 -07:00
Pepe Rivera
c77f1de84c
Update winui to 2.1 (#484) 2019-05-01 09:26:30 -07:00
Eric Wong
32aaa0d7e1
fixes #471 (#481)
Expand fix for ja era to handle months and days
2019-04-30 12:26:05 -07:00
Hassan Uraizee
94a90d772a UI Tests YAML updated to integrate WinAppDriver task (#480) 2019-04-30 07:13:46 -07:00
Rudy Huyn
9728ccf119 Fix bug when the negate sign is before a space (#345)
* Ignore None characters while parsing the clipboard

* reformat
2019-04-26 16:07:14 -07:00
Hassan Uraizee
8e1a14793a Added WinAppDriver UI Tests to the Calculator Project. (#411) 2019-04-25 16:54:36 -07:00
Matt Cooley
cf7ec5f729
Miscellaneous updates to internal release builds (#477) 2019-04-25 16:54:07 -07:00
Eric Wong
1dee9dc984
Fix #471 (#473)
[JaEra] Calc: subtracting 1-year from date during Reiwa 1 yields unexpected results.
2019-04-24 13:37:49 -07:00
Daniel Belcher
b03a026f6c
Allow vcxproj and sln files to merge as text. (#474)
Description of the changes:
This will cause Git to insert conflict markers in the file and make it easier to identify and fix merge conflicts. Previously, Git would complain about conflicts with these files, but no markers were inserted.

How changes were validated:
Manual.

Checkout feature/GraphingCalculator and merge in upstream/master. Git identifies merge conflicts present for Calculator.vcxproj but there are no conflict markers in the file. Abort the merge.
Merge in dabelc/MergeProjectFilesAsText. Confirm Git is able to merge Calculator.vcxproj.
2019-04-24 12:05:19 -07:00
Daniel Belcher
861d4ef408
Update the .gitignore to ignore GraphingImplOverrides.props. (#472)
Description of the changes:
Update the .gitignore to ignore GraphingImplOverrides.props.

This update already exists in the feature branch but we can merge it to master now to make development of the feature easier and prevent accidentally commiting this file.

How changes were validated:
Manual.

Switch to feature branch. Add GraphingImplOverrides.props
Switch to dabelc/IgnoreGraphingImplOverrides.props. Confirm git shows no files changed but props file is present.
2019-04-23 16:41:48 -07:00
Bharat Raghunathan
452f18fd8e Update README to include infinite precision (#470)
Fixes #119

Added infinite precision as a feature in README.md and in ApplicationArchitecture.md

How changes were validated:
Manual preview of README and ApplicationArchitecture.md
2019-04-23 10:30:31 -07:00
Eric Wong
2a29947a28 Collapse CurrencySecondaryStatus when no text is present in the text block (#467)
Fixes #313
In Scan/Item mode, Narrator focus navigates to hidden element “No next item” after “Update rates” link in "Currency Converter" window #313

Description of the changes:
Adds an x:Name to the CurrencySecondaryStatus text block
Adds a NormalCurrencyStatus visual state to the CurrencySecondaryStatusStates
Adds functionality to the CurrencySecondaryStatusStates to show or hide the CurrencySecondaryStatus text block.

How changes were validated:
Verified that the textblock is not visible in the accessibility tree via inspect.exe from the windows sdk.
Verified that Narrator also does not stop on the block when in scan mode.
Verified that the textblock is visible in the accessibility tree and read out in Narrator when the ChargesMayApplyCurrencyStatus or FailedCurrencyStatus viewstates are set.
2019-04-22 17:30:59 -07:00
Nicholas Baron
cdd2b1c8ad Updates to copypastemanager (#390)
Related to #55 and #64
Description of the changes:
Added constexpr to formerly static const or #define variables
Applied C++ Core Guideline NR.2
Added auto and const in appropriate places

How changes were validated:
Used the provided unit tests
2019-04-22 16:59:13 -07:00
Daniel Belcher
5ffe1bc858
Add Pan/Zoom support for the graph surface (#458)
Description of the changes:
Add Pan/Zoom support for the graph surface.
Currently only supports Mouse/Pen/Touch interactions. Keyboard support will be added separately.

How changes were validated:
Manual
2019-04-22 14:29:57 -07:00
cheezwhines
fab21191e2 Clicking on the same element in the hamburger view should re-open that view, like the menu items do (#447)
Fixes #437.
Clicking on the same element in the hamburger view should re-open that view, like the menu items do

Description of the changes:
-Fixed the bug that was listed

How changes were validated:
-manual
2019-04-19 18:59:10 -07:00
Rudy Huyn
bd04c92c1c Simplify title bar (#442)
Fixes #407 (partially) and #441

Description of the changes:
Remove TitleBarHelper and all <Border x:Name="CustomTitleBar" />
Let the system defines the draggable region
Centralize all events and functions associated to the title bar in a single control TitleBar instead of code splitted between MainPage/TitleBar/HistoryList/Memory.
Use the standard title bar when high contrast is activated instead of the custom one.
Modify the color of the title when the window doesn't have focus
Fix the right padding of the title bar with high contrast

How changes were validated:
Manually tested with LtR and RtL languages
Manually tested with high contrast
Tested when History and Memory flyout are opened
2019-04-19 18:49:08 -07:00
Rudy Huyn
0d31d5a5a2 Fix UI issues with UnitConverter in RtL (#410)
Fix #409 - Some content in Currency Converter not right-aligned properly in RtL
Fix #59 Currency symbol precedence is opposite of system setting in RTL languages

Description of the changes:
Add a property FlowDirectionHorizontalAlignment in UnitConverter to align some controls to the right (without modifying the FlowDirection of their parent items)
Force FlowDirection of Value1Container and Value2Container to LeftToRight (but align panels to the right)

How changes were validated:
Tested with LtR and RtL languages and with currency symbols on the left and on the right.
2019-04-19 18:37:50 -07:00
Eric Wong
43b2d4e536 Fix test code that never executes (#465)
Fixes #175.
Fixes loop in test code to verify that commands not supported by the unit converter viewmodel result in no-op.

Description of the changes:
Removed loop of range of enums with a being tested for no-ops since it added no intrinsic value (and the way that the range was handled was incorrect).  Considered adding an iterator over a static list of commands to validate against, but determined it didn't add any notable value.

How changes were validated:
Ran modified test to ensure it passes
2019-04-18 17:05:44 -07:00
Lance McCarthy
8520d3fc74 Refactored XAML x:Names (#433)
Description of the changes:
-Refactored all x:Names to use the generally accepted Pascal-Casing

How changes were validated:
Unit Tests
Manual Tests
2019-04-18 16:01:47 -07:00
Rudy Huyn
de65db6197 Decrease CPU usage of OverflowTextBlock + optimization (#403)
Fixes #402 and #414
Divide by 4 the CPU usage of OverflowTextBlock when buttons are pressed very quickly.

Description of the changes:

Xaml-side:
OverflowTextBlock has some performance issues:
double scrollviewer: the listview was in a scrollviewer, while the control already containing one -> it breaks the virtualization of the listview and impacts on UI performance.
The listview used a StackPanel, this panel doesn't support virtualization of ListViewItems contrary to ItemsStackPanel

No ListView-specific features were used, an ItemsControl is more efficient and lighter.
refactor how we manage the visibility of the left/right buttons in OverflowTextBlock, the new version is more reactive and will not display the right arrow when not necessary (see GIF below).
remove the ItemContainerSelector ExpressionItemContainerStyle, not really used by OverflowTextBlock

remove UI glitches generated by ChangeView when users type fast (control partially hidden and scrolling issues, see the GIF below).
only modify the accessibility view when it's necessary

ViewModel-side:
stop fully refreshing ExpressionTokens in StandardCalculatorViewModel when a new command were sent, instead, use a IObservableVector to only send new tokens to the UI (in average only 1 or 2 UI items are refreshed while the full expression was refreshed before)

How changes were validated:
Manually
2019-04-18 15:21:33 -07:00
Daniel Belcher
d21a47d5a1
Compile CalcManager project with or without precompiled headers (#436)
Fixes #324 .

Description of the changes:
In an effort to support other compilers (#109), this change reworks how precompiled headers are handled. For toolchains where precompiled headers are not used, there is unnecessary compilation cost because each source file explicity includes the pch, meaning all system headers in the pch were recompiled for each translation unit. This change modifies the project's files so that each translation unit includes a minimal set of dependent headers. For MSVC users, the precompiled headers option is still enabled and the precompiled header is added to each translation unit using the compiler's Forced Includes option. The end result is that MSVC users still see the same build times, but other toolchains are free to use or not use precompiled headers.

Risks introduced
Given that our CI build uses MSVC, this change introduces the risk that a system header is added to the pch and the CalcManager project builds correctly, but builds could be broken for other toolsets that don't use pch. We know we want to add support for Clang in our CI build (#211). It seems reasonable to also compile without precompiled headers there so that we can regression test this setup.

How changes were validated:
Rebuild CalcManager project. Compile time: ~4.5s.
Disable precompiled headers, keeping explicit include for pch in each source file. Compile time: ~13s.
Remove explicit pch inclusion and add the appropriate headers to each translation unit to allow the project to compile. Compile time: ~8s.
Re-enable pch and include it using the Forced Includes compiler option. MSVC compile time: ~4.5s.
Minor changes
Delete 'targetver.h'. I found this while looking around for system headers in the project. It's unused and unreferenced so let's remove it.
2019-04-17 17:28:45 -07:00
Seulgi Kim
853704c1c2 Add support for Pyeong, a Korean floorspace unit. (#444)
Fixes #382
Description of the changes:
Add Pyeong as an Area conversion unit.
Pyeong shows up only if the user's current region is Korea ( i.e. region is either KP or KR ).
Added Korean translation for Pyeong (평). For other locales, we default to English ( Pyeong ).
How changes were validated:
Manually tested the below

For non-Korean regions, Pyeong does not show up.

Korean region with Korean locale => Pyeong shows up and Pyeong is correctly translated.
pyeong_Korean

Korean region with English locale => Pyeong shows up and Pyeong is in English.
pyeong_English

Korean region with simplified Chinese locale => Pyeong shows up and Pyeong is in English.
pyeong_Chinese
2019-04-16 17:53:08 -07:00
jatinkumar
c150cd4ece Removed AppBar, OperatorTextBox and OperandTextBox controls (#440)
Fixes #407 
Removed AppBar, OperatorTextBox and OperandTextBox controls
2019-04-16 17:46:07 -07:00
Rudy Huyn
7a7ceb5888 Modify how modulo is calculated in Normal and Scientific mode. (#412)
## Fixes #111

> The modulo operator on this calculator gives the result that is different to the most used calculators.

The current `modrate` function is the equivalent of rem(...)/remainder(...), not mod(...)/modulo(...) available in some popular Math apps. 

### Description of the changes:
- rename `modrate` in `remrate` to be more accurate.
- add `modrate`, calculating modulo similarly to Matlab, Bing, Google calculator, Maxima, Wolfram Alpha and Microsoft Excel 
- Add `RationalMath::Mod` using `modrate` as an alternative to `Rational::operator%` using `remrate`
- Add a helper `SIGN` to retrieve the sign of a `Rational`.
- modify `CalcEngine` to use `modrate` in Normal and Scientific mode and `remrate` in Programmer mode.

### How changes were validated:
- manually and unit tests added
2019-04-16 17:17:24 -07:00
Rudy Huyn
ad25feda6b Keep input when users refresh currency rates (#369)
Fixes #260

Description of the changes:
prevent UnitConverterViewModel to reset values when users click on update rates.
recompute UnitConverter's caches (m_ratioMap and m_categoryToUnits) once rates are updated (but check first if the user did/didn't change the category)

How changes were validated:
Manually tested with fake currency rates (HTTP responses modified on the fly via FiddlerCore)
Verified that it works no matter the selected field (From or To)
Verified that the currencies selected are kept after a refresh
2019-04-16 11:29:43 -07:00
Matt Cooley
775771d62a
Internal builds now require the OAuth access token (#457) 2019-04-15 14:12:10 -07:00
Rudy Huyn
5a6c6f4274 Prevent the application to crash when the current page is Date Calculation and users paste a text (#391)
Fix the else condition in ApplicationViewModel::OnPaste

How changes were validated:
Manually

Fixes #389
2019-04-15 09:51:06 -07:00
Rudy Huyn
109326508f Improve the support of Narrator with parenthesis (#368)
* Modify how we manage Narrator with parenthesis and refactor right parenthesis

* Optimization

* remove extra spaces

* take feedback into account
2019-04-15 09:31:02 -07:00
Michał Janiszewski
afdda581a4 Drop unneeded const-qualifier on return type (#396) 2019-04-12 13:40:02 -07:00
Pepe Rivera
f6f10444f7 Simplify some of the calc engine string logic (#449)
Description of the changes:
Currently Calculator handles strings by defining integers for each type of function that can be performed, this integer will eventually correspond with an index in s_engineStrings which holds the corresponding display string for each function. Some functions such as Sin can have multiple strings (degrees, rads, grads, inverse). Functions like Sin are mapped to another array called "rgUfne" where a new integer is given depending on the output string which will then be given to s_engineStrings. The new integer returned by the "rgUfne" array runs the risk of overlapping with any new functions that may be added in CCommand.h. Furthermore, it is expected that the strings in s_engineStrings and rgUfne are defined in a particular order (not necessarily sequential), otherwise the logic will break. This makes adding new strings for new functions confusing and difficult, since a lot of the logic is not clearly defined.

This PR attempts to make this a bit simpler by changing the s_engineStrings and rgUfne arrays to be unordered_maps instead of arrays. For s_engineStrings the keys will now be strings, allowing the existing logic for indexing to be used by simply converting the number into a string to access the value. This will also allow us to create keys in the future that are not limited to integers but to strings that hold more meaning.

The rgUfne array will also be updated to be a map that will take in an integer and give you the corresponding string that can be passed to s_engineStrings. The UFNE object in the rgUfne array will also be updated to hold all the possible string keys for a function, instead of indexing them on other numbers that may overlap with existing definitions.

Now to add a new string for a new IDC_FOO function, we would just need to add the "FooString" resource keys to the g_sids array and use the updated rgUfne map to link the IDC_FOO value to the corresponding "FooString" resource key. This way the resource key can be a meaningful string, and not an integer that must be in any particular order.

How changes were validated:
Tested each function manually in standard, scientific, and programmer modes.
2019-04-11 15:20:01 -07:00
Daniel Belcher
091732aa94
Feature/GraphingCalculator initial commit (#450)
Initial PR for the feature/GraphingCalculator feature branch, part of #338.

The feature incorporates a proprietary Microsoft-owned graphing engine to drive graphing experiences in the Windows Calculator app. Due to the private nature of the graphing engine, the source available in the public repo will make use of a mock graphing engine. See README.md for more details.

This PR simply serves as a base for future feature development. As such, the PR will be immediately merged. Feedback on the content of this PR, and on the feature in general, is encouraged. If there is feedback related to the content of this specific PR, please leave comments on the PR page. We will address the comments in future PRs to the feature branch.
2019-04-10 18:15:10 -07:00
Dave Grochocki
47a2741218
Updating Contributing (#431)
Updating Contributing documentation:
* Adding reference to spec repository for feature development
* Adding localization issue template
* Adding clarifications for contributions and PRs
2019-04-09 17:36:36 -07:00
Daniel Belcher
7ac750f7e5
Fix invalid check of m_precedenceOpCount (#298)
The conditional m_precedenceOpCount >= 0 was always true because m_precendenceOpCount is an unsigned type. Update the conditional to simply be true and rely on a break statement in the loop. Although this member variable used to be a signed type, in practice, the value was never less than 0.

How changes were validated:
Manual. Unit tests pass locally.
2019-04-09 14:12:28 -07:00
Rudy Huyn
af41a183a7 Optimize and simplify CalculationResult to be able to update the FontSize and the DisplayMargin without fully updating the Style. (#217)
- Merge the 3 CalculationResultStyle(S|M|L) in App.xaml
- Only modify CalculationResult::*FontSize in Calculator.xaml instead of fully updating the style of the control.
- Create a new property MaxFontSize in order to be able to update it without being forced to fully update the Style (because m_startingFontSize was set in OnApplyTemplate)
- Modify how DisplayMargin is managed to prevent the textblock Margin to shift when we update its value (without fully updating the Style).
2019-04-05 13:04:39 -07:00
Matt Cooley
e7eace57f8
Update localized strings 2019-04-04 (#438) 2019-04-05 08:39:29 -07:00
Rudy Huyn
6f49b17bf0 Add Reveal Highlight on AccentCalcButtonStyle + fix accessibility iss… (#374)
Add Reveal Highlight effect on the 4 basic operator buttons + Equal button (effect more visible with purple and all grey-ish accent colors). Also fixes a high contrast issue when the operator buttons were pressed.
2019-04-04 16:55:12 -07:00
Matt Cooley
71e34c6f01
Fix inline script in loc pipeline (#434) 2019-04-04 16:11:13 -07:00
Matt Cooley
6d779a8815
Updating version of release builds to 1904 (#422) 2019-04-04 09:19:59 -07:00
Sonali Agrawal
cb31349ee2 Update README to add description of "date calculation" functionality (#365)
Fixes #140.

Added a one-liner description about the date calculation functionality

Description of the changes:
* This change maintains consistency by writing it after the description of the programmer calculator so that it matches the order of the positions of these functionalities in the hamburger menu of the calculator.
* Just like the other descriptions, this is also a one-liner
* This description covers both the functionality under "date calculation" i.e. the difference between the dates and adding/subtracting a date from another.

Co-Authored-By: sonali9696 <sonali9696@gmail.com>
2019-04-03 06:45:47 -07:00