-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge master with feature/GraphingCalculator #805
Merge master with feature/GraphingCalculator #805
Conversation
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.
* Modify how we manage Narrator with parenthesis and refactor right parenthesis * Optimization * remove extra spaces * take feedback into account
…ation and users paste a text (microsoft#391) Fix the else condition in ApplicationViewModel::OnPaste How changes were validated: Manually Fixes microsoft#389
Fixes microsoft#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
…soft#412) ## Fixes microsoft#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
…t#440) Fixes microsoft#407 Removed AppBar, OperatorTextBox and OperandTextBox controls
Fixes microsoft#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
…osoft#436) Fixes microsoft#324 . Description of the changes: In an effort to support other compilers (microsoft#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 (microsoft#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 microsoft#402 and microsoft#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
Description of the changes: -Refactored all x:Names to use the generally accepted Pascal-Casing How changes were validated: Unit Tests Manual Tests
Fixes microsoft#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
Fix microsoft#409 - Some content in Currency Converter not right-aligned properly in RtL Fix microsoft#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 microsoft#407 (partially) and microsoft#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
…t view, like the menu items do (microsoft#447) Fixes microsoft#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
Related to microsoft#55 and microsoft#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
…block (microsoft#467) Fixes microsoft#313 In Scan/Item mode, Narrator focus navigates to hidden element “No next item” after “Update rates” link in "Currency Converter" window microsoft#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.
Fixes microsoft#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
…ft#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.
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.
[JaEra] Calc: subtracting 1-year from date during Reiwa 1 yields unexpected results.
* Ignore None characters while parsing the clipboard * reformat
Expand fix for ja era to handle months and days
Fixes microsoft#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.
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.
- Using default wstring constructor instead of taking empty string literal - Updated to for range-for where appropriate - Used std::find for IsOp* code that was doing it by hand - Used std::count to calculate LengthWithoutPadding - Used existing wstring constructor to pad a string
updating minor versioning to 1910 release
* Convert CopyPasteManager to runtime class * merge AssertUtils and Helpers.h * update onpastemanager
…del to make them read-only and use macros (microsoft#799)
I repro this error when building the UT project locally: error LNK2022: metadata operation failed (80131187) : Inconsistent method declarations in duplicated types... I don't repro this in master, nor in feature/GraphingCalculator. Seems specific to this branch. I took some time to try and figure out why but I couldn't find the cause. |
I resolved this issue. It was due to the target sdk being mismatched. The unit tests were pointing to 18362 while the other projects were updated to 19019. |
{ | ||
public: | ||
static AppResourceProvider& GetInstance(); | ||
static AppResourceProvider ^ GetInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change clashes with the recent tool tip changes causing this branch to no longer build. You will want to ctrl+shift+f "GetResourceString" and make sure it is being accessed via -> instead of a .
@@ -71,7 +71,7 @@ namespace CalculatorApp | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 1+1=3 bug is still reproing, looks like it was caused by a bad merge in #585. To fix we will want to remove the extra call to RunFirstEnabledButtonCommand(buttons) on line 574.
}); | ||
timer->Start(); | ||
co_await winrt::resume_background(); | ||
co_await winrt::resume_after(500ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but we should consider reverting this change or altering the ms here. To me the keypad feels laggier with this change, but I could see the argument that it makes it clearer visually which key was activated.
Calculator seems to be crashing frequently on this branch when interacting with the graphing mode, might just be my computer though... |
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush" Color="{ThemeResource SystemAccentColor}"/> | ||
<SolidColorBrush x:Key="AppControlPageTextBaseHighColorBrush" Color="{StaticResource SystemBaseHighColor}"/> | ||
<SolidColorBrush x:Key="AppControlForegroundAccentBrush" Color="{ThemeResource SystemAccentColor}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resource is being referenced in GraphingCalculator.xaml, which is why I keep seeing crashes in graphing mode.
Fixes Part of #338.
Description of the changes:
How changes were validated: