* Added enable/disable line functionality
* Update EquationTextBox to change the opacity of functions have are not visible. Update the function label for the EquationTextBox to increment the label to show f1, f2, f3, etc
* rebase key-graph-features and fix issue where removing an equation box and adding a new one repopulates the previous equation
* Added visibility icon for the equation button hover
* updated EquationButton to be a toggle button to better handle the LineHidden state and other PR comment fixes.
* Updated EquationButton style to use a toggle button and to have placeholder icons for the show/hide states
* Updated equation button after pulling the refactor work into the branch. Fixed the Equation Button in KGF UI
* Fixed Pepe's bugs
* Uncomment temporary.pfx in calculator.vcxproj
* Fixing typo in StandardCalculatorViewModel::UpdatecommandsInRecordingMode
Removing unnecessary copy of vector in StandardCalculatorViewModel::UpdateCommandsInRecordingMode
Using range-for in StandardCalculatorViewModel::UpdateCommandsInRecordingMode
* Using static_cast instead of safe_cast for unsigned char to Command
* Added IGraphAnalyzer
* Key Graph Features called and getting returned to the client. To do put all strings into the Equation object
* Updated UpdateKeyGraphFeatures to add function analysis data to all properties in Equation object
* Update KGF when variables are updated
* Key graph features ui started
* Added MathRichEditBox and started hooking up key graph features to the UI
* Updated EquationViewModel to include parity and periodicity
* Updated key graph features to update the EquationViewModel
* updated key graph features to display more values
* Key graph features populating uing MathRichEdit mode
* moved KeyGraphFeatures control to GraphingCalculator.xaml
* Use MathML formatting instead of MathRichEdit for strings passed back from the engine
* cleaned up project targeting and equation.h comments
* Updated equation edit box to populate for KeyGraphFeatures
* Fixed vcxproj files to have the correct targeting and certificates. KGF Title strings moved to x:Uid instead of the code behind
* Updated per PR feedback
* Update MathRichEditBox to detect if the string is a mathml string and use the appropriate set method to set the text
* fixed the issue where parity, periodicity and monotonicity could be set with an old value if the next one is empty
* KGF control UI adjustments and error handling
* Error control updates
* Error handling added when analysis fails
* fixed alignment on rich edit boxes
* Add monotonicity direction into the mathml string and only have 1 richeditbox
* Set hover state on KGF EquationEditBox to change button opacity and fixed spacing in Monotonicity RichEditBox
* remove sideload package certificate info VS added
* updated logic for setting error strings to be in the viewmodel
* Updated KeyGraphFeatures to populate dynamically using a ListView and TemplateSelector
* Update periodicity to not show if it isn't supported
* Fixed issue where y-intercept was using the x-intercept value
* Remove ItemsControl ItemsContainerStyle
* Updated per pr feedback. Fixed bug where analysis error would not reset
* Update MathRichEdit box to remove selection when focus is lost
* Updated mathrichedit to get LAF access for Dev, Release and Graphing projects
* Remove OnLostFocus in MathRichEdit, Change KGF ItemsControl back to ListView
* Clean up styles for KGF and ensure the match the comps
* Moved formatoptions logic to the Grapher constructor and reverted LineColor.Text resource that was mistakenly taken out
* Add copyright header to KGF Files
* fixed issue where asymptote values were not populating
* Disable KGF button when there is no equation. Fixed issue where equation populated in a new equationtextbox after the previous one was deleted
* Removed formatoptions testing lines used for debugging
- 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
* Replacing CalculatorVector usage with std::vector
Assumptions made here are that memory allocations
are not recoverable. If it can be proved that an index
will be in range, then the indexing operation is used.
If not (without manual checks) the std::vector::at function
is used to throw an exception in case of a programmer bug.
* Changes based on PR feedback
Using auto& in CalculatorCollector::UpdateHistoryExpression
so the token.first value is properly updated.
Using range for loop to GenerateExpressions.
Setting isEditable directly to the result of boolean expression.
Using token.second directly instead of creating a
separate tokenCommandIndex variable.
* Fixing issue with generating expressions strings.
A space should not be added before the first item.
The CalculatorUITestFramework project does not need Microsoft.NET.Test.Sdk or MSTest.TestAdapter. These dependencies are needed only in the project which produces the actual test assembly (in our case, the CalculatorUITests project).
Removing these resolves a build warning, since the test adapter package does not target .NET Standard.
* Plumebd with data transfer
* Getting mainpage to talk to getbitmap. moving share callbacks from mainpage to graphingcalculator
* Trying to get bitmap from renderer.
* work
* Share worked
* cleanups
* Cleanups progressing
* Share working, need loc for title string and user notification incase of a failure. Then add the equations key.
* More cleanup, now using share icon image and resources for strings. Still need to do the graph equation key.
* Change share to html based start.
* Key working, with UL but going to try changing to table.
* Fix a html formating error, generating a new UL for each equation.
* Switched over to a table for equation key and have color block formating
* Updates from PR feedback, using Graphing::IBitmap abstraction.
* Update src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h
Fixed
Co-Authored-By: Pepe Rivera <joseartrivera@gmail.com>
* PR Updates.
* Add variables to the graph key.
* eod
* Passive graph value tracing working.
* Basic active tracing cursor working.
* Move active tracing from graphingcalculator to grapher to save some hops.
Also block tracking of the active tracing key's when in the EquationTextBox.
* Active tracing working, need to put button on screen for activation.
* Added active tracing control button (placeholder image)
* Eod
* Popup trace value now tracks the highlighted point.
* Popup skined
* PR Updates.
* Update certificate thumbnail so VS2019 doesn't have a build error.
* PR comments in process.
* PR Updates
* PR Updates, change tracing value to use tooltip static resource so we automatically change depending on system values. And changed text formatting of the value to be generic (x,y) value.
* PR updates, changed how we detect who has focus so we don't eat keys when not in active tracing.
* Additional filtering for the Key Up/Down in the grapher.
* Fix bug where active tracing would turn back on after clicking button to turn it off.
* Added new dev app icons
* Removed VS added page include in calculator.vcsxproj.filters and increased the internal version number and the app version number
* Plumebd with data transfer
* Getting mainpage to talk to getbitmap. moving share callbacks from mainpage to graphingcalculator
* Trying to get bitmap from renderer.
* work
* Share worked
* cleanups
* Cleanups progressing
* Share working, need loc for title string and user notification incase of a failure. Then add the equations key.
* More cleanup, now using share icon image and resources for strings. Still need to do the graph equation key.
* Change share to html based start.
* Key working, with UL but going to try changing to table.
* Fix a html formating error, generating a new UL for each equation.
* Switched over to a table for equation key and have color block formating
* Updates from PR feedback, using Graphing::IBitmap abstraction.
* Update src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h
Fixed
Co-Authored-By: Pepe Rivera <joseartrivera@gmail.com>
* PR Updates.
* Add variables to the graph key.
* eod
* Passive graph value tracing working.
* Basic active tracing cursor working.
* Move active tracing from graphingcalculator to grapher to save some hops.
Also block tracking of the active tracing key's when in the EquationTextBox.
* Active tracing working, need to put button on screen for activation.
* Added active tracing control button (placeholder image)
* Eod
* Popup trace value now tracks the highlighted point.
* Popup skined
* PR Updates.
* Update certificate thumbnail so VS2019 doesn't have a build error.
* PR comments in process.
* PR Updates
* PR Updates, change tracing value to use tooltip static resource so we automatically change depending on system values. And changed text formatting of the value to be generic (x,y) value.
* PR updates, changed how we detect who has focus so we don't eat keys when not in active tracing.
* Additional filtering for the Key Up/Down in the grapher.
Now that the RaiseNotificationEvent API is available on all platforms where the Calculator app runs, we can remove the factory classes which switched between RaiseNotificationEvent and an alternative implementation based on live regions.
Adds a Copy button to the context menu for history menu items located above the delete button in the menu. Copy only copies the result and not the entire content of the history item (equation and result).
Fixes#429
* Make sure TitleBar takes into account the AOT mode change
* remove namespaces in cpp files
* code linting
* use macro for IsAlwaysOnTop and make IsAlwaysOnTop/DisplayNormalAlwaysOnTopOption read-only
* Fix FontWeight
Move back the VisualStateManager node to the root XAML element to fix visual states of the titlebar.
### How changes were validated:
- Manually
Fixes#631
* Plumebd with data transfer
* Getting mainpage to talk to getbitmap. moving share callbacks from mainpage to graphingcalculator
* Trying to get bitmap from renderer.
* work
* Share worked
* cleanups
* Cleanups progressing
* Share working, need loc for title string and user notification incase of a failure. Then add the equations key.
* More cleanup, now using share icon image and resources for strings. Still need to do the graph equation key.
* Change share to html based start.
* Key working, with UL but going to try changing to table.
* Fix a html formating error, generating a new UL for each equation.
* Switched over to a table for equation key and have color block formating
* Updates from PR feedback, using Graphing::IBitmap abstraction.
* Update src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h
Fixed
Co-Authored-By: Pepe Rivera <joseartrivera@gmail.com>
* PR Updates.
* Add variables to the graph key.
* PR Updates.
Commit 0722781fc updated the app to use `DevAppName` for the
app's window title when it was a non-official build, based on
the state of `IsStoreBuild`.
Unfortunately, `IsStoreBuild` is a _project_ level variable defined in
[build-app-internal.yaml](0722781fc6/build/pipelines/templates/build-app-internal.yaml (L36)),
but not a _compile-time_ defined value.
To solve this, we are now defining `IS_STORE_BUILD` in
`Calculator.vcxproj` when `IsStoreBuild='True'`, the same way that
we set `SEND_DIAGNOSTICS` for official builds, and we'll change the
window title based on that new `#define`.
Using this new `#define` can lead us down a slippery slope. We need to
limit the amount of divergent code that we have between dev/official
builds. This should be hopefully one of very few instances where
this value is ever used.
* Currency rate: Compute how many decimals we need to display two meaningful digits at minimum
* formatting
* nit
* Increase the number of meaningfull digits (2->4)
* Revert "Increase the number of meaningfull digits (2->4)"
This reverts commit 9ad93e0d591a386e3e229e09b39a58158d544069.
* Rename constants
* modify FORMATTER_RATE_* values
* format CurrencyConverterUnitTests.cpp
### Description of the changes:
**1) Do not set units to default values if they already have valid values**
This fixes the actual issue. `UnitConverter::InitializeSelectedUnits()` ( this function resets all units to their default units if available for the current category ) gets called after `UnitConverterViewModel::RestoreUserPreferences()` ( this function restores user preferences ).
So Calculator has been restoring saved values, and then overriding the restored values with default values.
I modified `InitializeSelectedUnits()` so that we only initialize units only when they are not already set to valid units for the current category.
**2) Removed `m_isFirstTime`**
I noticed that we are calling `RestoreUserPreferences()` twice when Calculator starts up, and the function is restoring the same value both times
The below happens when Calculator starts up
1) On startup, in `UnitConverterViewModel::InitializeView()`, `RestoreUserPreferences()` is called.
2) `RestoreUserPreferences()` in turn triggers `OnUnitChanged()`
3) During the first call to `OnUnitChanged()`, m_IsFirstTime is `True`, so we call `RestoreUserPreferences()` again while also setting `m_IsFirstTime` to `False`.
4) `RestoreUserPreference()` again triggers `OnUnitChanged()`
5) During the second call to `OnUnitChanged()`, m_IsFirstTime is `False`, so we call `SaveUserPreferences()`
I think we should only call `SaveUserPreferences()` inside `OnUnitChanged()` since we already restored user preferences during view initialization. I can't really think of a reason to restore units after view has been initialized. This led me to just delete `m_isFirstTime`.
### How changes were validated:
Manually tested that units and the current category are properly selected when you quit and start Calculator.


## Fixes#445.
* Fixed the WindowIdLog so that it is updated when a new WindowCreated event is fired
* Updated the windowidlog check in LogWindowCreated to use IsWindowIdInLog
* precisely calculates the number of digits of the source and compute the number of significant digits of the result based on that.
* fix unit test
* Fix warning C4267
* Optimize how we calculate the number of digits in the integer part and don't trim the value when used by the currency converter
* modify GetNumberSignificantDigits
* fix CI error
* Access to wstring::npos from static calls
* Move UnitConverter static methods related to number to NumberFormattingUtils
* rename namespace
* Add comment and fix typo
* Move standard headers
Having an extra integer variable to hold onto an i or i-1 value is inefficient, for "if (m_token.at(i) != chZero)", the code under "fDigitsFound" will always run, so it makes sense to put the fDigitsFound code under the if statement, which can return from the function entirely instead of breaking.
### How changes were validated:
- Manual Testing verified the code having identical behavior as before, with no side effects.
* Display date difference in days if can't display in days/weeks/months/...
* add comments
* remove not used variable totalDaysDiff
* improve UpdateDisplayResult
* Display error message when the calculator can't calculate the difference between 2 dates
Simplifies the layout of `ConverterNumPad` to match that
seen of `NumpadPanel` in Calculator.xaml by using the same
static margin and removing the use of columns that had been used
for dynamic margins.
Fixes#87
Fixes#462
- Add x64 and x86 UI tests to the release builds (internal builds for the store)
- UI tests now accept the target app ID as a parameter in the runsettings file
- Added the CalculatorUIFramework to handle the WinAppDriver logic.
- Added Standard Mode smoke tests and BVTs to the CalculatorUITests project.
- Removed old UI tests that did not use the CalculatorUIFramework
The incrementally calling `Window::Globalization::Calendar::AddMonths`
resulted in a negative value for `GetDifferenceInDays` which was then
assigned to an unsigned variable `daysDiff`.
One example of the issue when running the calculator in UTC+2 was the
difference between July 31st and December 30th.
The initial guess was 4 months which then landed on November 30th.
This date was stored and then in the loop incremeted by one month.
This then landed precisely on the end date December 30th.
After the loop the final value is then used July 31st + 5 months
which results in the 31st of December.
The resulting difference of -1 days is then assigned to the unsigned
value `daysDiff`.
This commit makes the minimal changes to remedy this bug.
It makes sure to only ever call `AddMonths` with the same starting date
instead of incrementally to different dates.
fixes#552
* Bound the calendar picker to the control above
* collapsed textbox and added headertext to the calendar picker element
* collpased textbox from both To and From calendar picker used headertext instead
* localized strings for the new headers added for the calendar date pickers
* modified the resoruces file so as to localize the strings
* remapped the grid components after the removal of the text Block
* restored original spacing between components
`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.
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.
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).
* 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.
* Force en-US for unit tests
* fix some spacing issues after merge
* remove default argument of LocalizationService to fix compilation issue in Release mode
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
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.
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.htmlhttps://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.
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.
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
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
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
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
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