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.
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
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
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.
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
## 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
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
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.
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.
Updating Contributing documentation:
* Adding reference to spec repository for feature development
* Adding localization issue template
* Adding clarifications for contributions and PRs
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.
- 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).
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.
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>
* Modify the height of RowDltrUnits when UnitConverter is in LandscapeLayout mode
* clean
* Use the same layout than the existing one while fixing the issue
* Refactor SupplementaryItemsControl to improve performance, not rely on parents and not force the parent element to be HorizonAlignment="stretch"
* take feedback into account
* add HorizontalNoOverflowStackPanel to vcproj.filters
* format conditionals
* replace max by std::max
See also #353.
In the internal build environment, there's an auto-injected component governance task which needs to run once during the build. This task doesn't need to run during the unit test, package, and internal release jobs.
Description of the changes:
Disable Windows-provided min/max macros using the NOMINMAX flag. Add the flag to each project's pch to disable the macros across the solution.
How changes were validated:
Project builds.
Unit tests pass.
Smoke tests.
Fixes#362.
The .resw files for all languages are expected to be checked into the repo (this used to not the the case). Let's remove the conditions in the project file which ignore them if they don't exist.
Additionally removes pseudo-loc resource references from the build as pseudo-loc resources aren't currently being generated.
Templatize the copyright string and use a build variable to set the year for use across the entire app.
How changes were validated:
Tested with English and French and with different dates.
Update the localization build so that it sends strings to our internal localization system on a nightly basis and produces a patch file which we can use to check translations back into the repo.
Internally, a "component detection" task is automatically injected into builds to make sure we're not using any components with known security vulnerabilities. Because this task runs during the main app builds, it doesn't also need to run in the pipeline which hands off strings to the localization system.
I have no idea if it is required to be `sealed`, I have seen no `^`
operator which makes me think it could be a regular C++ code, barring
the concurrency stuff.
* Fix auto-scaling of CalculationResult when the current locale displays symbols at the right
* Formatting
* add padding
* modify padding of ValueContainer
Description of the changes:
Hide the History button when in Programmer mode via VisualState
How changes were validated:
Open Standard mode
Switch to Programmer mode
Verify that the History button isn't visible
Fixes#326
The ViewModel wrongly assumed that non-breaking spaces were only used between the value and the symbol. It's not the case of all locales using non-breaking spaces as a thousand delimiter (French for example).
When it was the case, the function only replaced the first thousand delimiter found and kept the extra space at the end of the string, generating 2 issues:
Extra space at the end: #240
Bad formatting of the number: #232
Description of the changes:
Replace currencyResult.find(L'\u00a0') by a regex only removing spaces at the end of the string.
Fixes#240 and #232