Commit Graph

366 Commits

Author SHA1 Message Date
Wei (Waley) Zhang
7276b5c7ce Fixes bug #483 by setting AccessibilityView property to Raw for hidden units
* Fixes bug #483 by setting AccessibilityView property to Raw for hidden units
2019-06-12 17:37:19 -07:00
Michał Janiszewski
81aec1ebe8 Drop __inline from conflicting declarations (#545)
`mulnum` et al. are declared `extern` in `ratpak.h`, which conflicts
with the `__inline` used with them. Additionally, most similar functions
don't have such keyword applied to them.
2019-06-10 14:36:05 -07:00
Michał Janiszewski
fe30c7cabc Add CMake project, GCC support (#540)
This is extract from #211 that enables compilation with GCC. With #211
now in the state of bitrot, I would rather try approaching it in smaller
steps that can be hopefully merged quicker, even if it does not provide
full support for all the features #211 provided.

This will _compile_ correctly with my (@janisozaur) GCC, but clang is
more picky about flexible array members and refuses to compile it yet.
I will extract remaining parts of #211 in future PRs.

I marked @fwcd as author, as he did most of the work in #211.
2019-06-06 14:08:31 -07:00
Matt Cooley
98f1da2e9d
Updating version of release builds to 1906 (#537) 2019-06-04 14:12:30 -07:00
Pepe Rivera
06c0dd9bd0
Update internal package version (#532) 2019-06-03 13:58:54 -07:00
Pepe Rivera
6e3fe90eb5
Wrap json parsing in try/catch (#534) 2019-06-03 13:58:37 -07:00
Pepe Rivera
2b17f82652 Migrate currency converter endpoints (#524)
We are migrating the REST endpoint that Currency Converter uses. The REST endpoint is not licensed for your use. To continue to enable community participation in the development of the feature, developer builds will use an alternate REST endpoint that serves mock data (clearly identifiable as it references planets instead of countries).
2019-05-31 12:55:06 -07:00
Matt Cooley
2fd8dc1f9d
Update localized strings 2019-05-24 (#521) 2019-05-24 10:41:42 -07:00
Northurland
d4028cda95 Force compiler to use utf-8 so the project compiles on systems in Chinese (#516) 2019-05-22 10:16:17 -07:00
Howard Wolosky
9515544c25
Update bug/feature templates to track if submitter requests assignment (#510)
An additional datapoint that can be helpful during triage of bugs and features
is if the submitter is interested in being the implementer as well.

Updating the bug_report and feature_request templates to help track this.
2019-05-20 17:19:00 -07:00
MelulekiDube
00f0f25dfc Added the name property for CalculationResult right/left scroll buttons on screen (#503)
* Added the property name to be shown on the Scrollable links to solve issue 482

* Added the x:uid tag for the buttons and also added the automationID

* Added two new uids keys for the left and right scroll buttons for the calculation result.
2019-05-17 15:54:34 -07:00
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