Commit Graph

359 Commits

Author SHA1 Message Date
Rudy Huyn
71b010483b Remove unused expression item template selector (#623)
* remove unused AlwaysOnTopExpressionItemTemplateSelector

* replace incorrect ThemeResource by StaticResource references
2019-08-20 12:55:49 -07:00
Rudy Huyn
5966503703 Fix regression bug with application title no longer grayed out. (#632)
Move back the VisualStateManager node to the root XAML element to fix visual states of the titlebar.

### How changes were validated:
- Manually

Fixes #631
2019-08-19 16:34:49 -07:00
Wei (Waley) Zhang
1c9755d38a Adds zoom buttons to graph controls (#637) 2019-08-16 16:11:43 -07:00
David Shoemaker
c1efa3d3e3 Adding share functionality to Graphing Calculator (#601)
* 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.
2019-08-13 12:57:13 -07:00
Matt Cooley
24d997dd00
Update localized strings 2019-08-08 (#636) 2019-08-08 18:37:05 -07:00
Wei (Waley) Zhang
672e88187b Fixes Always-on-Top crashes (#626) 2019-08-06 19:52:19 -07:00
Howard Wolosky
c994e49279
Prevent Dev title from showing up on Store builds (#627)
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.
2019-08-06 16:32:13 -07:00
Howard Wolosky
25e2a14257
Updated README to note the requirement for installing WinAppDriver (#624)
- Our documentation should make it clear to contributors what the expected developer
  environment is in order for the project to work.  In this case, a user tried to run the UI
  tests, unaware that they needed WinAppDriver installed on their machine.  This updates
  the README to indicate that requirement.
- Trailing spaces from other parts of the document were also removed as part of this change

Fixes #621
2019-08-06 14:42:39 -07:00
Rudy Huyn
a7d668e568 Fix the thumbprint of the certificate in the vcxproj file (#617) 2019-08-03 14:22:11 -07:00
Rudy Huyn
cc8491a3d7 Currency rate: always display minimum 4 significant decimals or 2 trailing zeros if the number is integer (#256)
* 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
2019-08-01 15:07:27 -07:00
Wei (Waley) Zhang
796d171960 Always-on-Top mode implemented (#579) 2019-07-30 17:53:39 -07:00
Seulgi Kim
af8322617f Restore user preferences (#456)
### 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.

![GifMaker_20190414182150911](https://user-images.githubusercontent.com/3166423/56102706-88f73400-5ee3-11e9-8bbf-7a0c8e051a5c.gif)

![GifMaker_20190414183403644](https://user-images.githubusercontent.com/3166423/56102763-f0ad7f00-5ee3-11e9-99ef-3b932f587393.gif)

## Fixes #445.
2019-07-29 09:39:19 -07:00
Stephanie Anderl
8106691d7c
Fixed issue where UI Responsive events were not fired (#603)
* Fixed the WindowIdLog so that it is updated when a new WindowCreated event is fired

* Updated the windowidlog check in LogWindowCreated to use IsWindowIdInLog
2019-07-26 11:51:01 -07:00
Michał Janiszewski
60c5c39ee5 Fix #563: Odd dependency cycle (#570)
There is an odd dependency in CalcEngine.

`CalculatorManager` inherits `ICalcDisplay` and implements a set of virtual calls it exposes, in particular `SetPrimaryDisplay`.
2517854836/src/CalcManager/Header%20Files/ICalcDisplay.h (L13)

When setting a mode in `CalculatorManager`, e.g. 2517854836/src/CalcManager/CalculatorManager.cpp (L208)
`this` (here: an instance of `CalculatorManager`) gets passed as an argument to the newly created `CCalcEngine` as `ICalcDisplay` pointer and the engine is stored as `unique_ptr` member field of `CalculatorManager`.

In the destructor of `CalculatorManager`, a single function is called, `MemorizedNumberClearAll` which then invokes `ProcessCommand(IDC_MCLEAR)` on current engine, gets passed on to `CCalcEngine::ProcessCommandWorker`, to `DisplayNum`, to `CCalcEngine::SetPrimaryDisplay` and finally to `m_pCalcDisplay->SetPrimaryDisplay`, but here `m_pCalcDisplay` _was_ the instance of `CalculatorManager` that just got its destructor called.

2517854836/src/CalcManager/CalculatorManager.cpp (L46)
2517854836/src/CalcManager/CalculatorManager.cpp (L475)
2517854836/src/CalcManager/CEngine/scicomm.cpp (L87)
2517854836/src/CalcManager/CEngine/scicomm.cpp (L133)
2517854836/src/CalcManager/CEngine/scidisp.cpp (L124)
2517854836/src/CalcManager/CEngine/scicomm.cpp (L837)

It will likely differ by implementation on how exactly, but the [standard suggests](http://eel.is/c++draft/class.cdtor#4) that will invoke the pure virtual `ICalcDisplay::SetPrimaryDisplay`. In case of GCC I believe the vtable is already destroyed by the time you enter dtor's body.

There appears to be no reason to call `MemorizedNumberClearAll` in `CalculatorManager::~CalculatorManager()` because the calc manager and all its engines are going down anyway.  Therefore, removing the call (and thus, the destructor which would then be empty).


Fixes #563: Odd dependency cycle
2019-07-25 23:24:12 -07:00
Tanuja Kirthi Doddapaneni
0722781fc6 Modifying the title of the window to "Calculator [Dev]" (#531)
* Modifying the title of the window to "Calculator [Dev]" when the build isn't configured with `IsStoreBuild`

Fixes #439
2019-07-25 23:02:37 -07:00
Pepe Rivera
46f11c7c72
Add variable editing (#581) 2019-07-24 11:23:33 -07:00
Stephanie Anderl
bb027aa9c3
Added Input pasted event and added to all modes (#593) 2019-07-18 11:21:35 -07:00
Matt Cooley
aea12015bd
Update version of release builds to 1907 (#590) 2019-07-17 21:37:30 -07:00
Matt Cooley
01cfe6dd89
Fix 32-bit build (#588) 2019-07-17 19:00:19 -07:00
Stephanie Anderl
a6384269bc Updated Calculator diagnostic data collection per the specification (#572)
- Removed unneeded diagnostic events and code
- Added and consolidated events into the events defined in the spec
2019-07-17 18:09:39 -07:00
Rudy Huyn
2ff7bb4089 Unit Converter - Calculate the rounding precision of results based on the source (#498)
* 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
2019-07-16 17:00:57 -07:00
Matt Cooley
1b9d6b8fbe
Use 2020 as the major version for the appxbundle (#586)
Calculator's build number in release builds follows the pattern 10.{YYMM}.{build}.0. We use the build number in lots of places, including the app binaries, the app package version, and the app bundle version. Before Calculator moved to GitHub, the app bundle version was generated using a date-based formula which produced versions like "2019.105.612.0". This means that the bundles generated from GitHub have a lower version than previous bundles. This appears to cause some issues during device reset.

This change sets the app bundle major version number to "2020" to ensure that newly-produced appxbundles have higher versions than legacy bundles. The remaining parts of the bundle version number will match the build number for easy reference.

Also updating the MakeAppx version used in bundle creation to 18362.
2019-07-16 16:21:45 -07:00
Rudy Huyn
23550f751c Make History and Memory list items context menu accessible using keyboard (#432)
* Move History and Memory context menus to ListViewItemContainer so users can open them with keyboards

* replace static_cast by dynamic_cast
2019-07-16 14:24:27 -07:00
pi1024e
5b59bdcb60 Removed need for trimIdx and fDigitsFound, resulting in less code. (#576)
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.
2019-07-16 14:53:34 -05:00
Rudy Huyn
a35a030683 Use the current locale to sort country names (#259) 2019-07-16 11:44:12 -07:00
Stephanie Anderl
a418777f02
Merge master into feature/GraphingCalculator branch (#585)
* Merge master into feature/GraphingCalculator branch
2019-07-15 11:17:21 -07:00
Nicholas Baron
c3d3581240 Applying NR 1 to CalculatorVector.h (#491)
Applied [NR 1](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rnr-top) from the ISO C++ Guidelines to CalculatorVector.h

### Description of the changes:
- Move towards understandable and maintainable code
2019-07-11 12:46:13 -05:00
Rudy Huyn
2a5a52d44d Date difference: display the difference in days (only) when we aren't able to calculate the difference in days/weeks/months.. (#555)
* 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
2019-06-30 18:22:29 -07:00
Howard Wolosky
25708f0bef
Ensure consistent margins/padding with currency converter keypad (#566)
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
2019-06-28 15:45:43 -07:00
Matt Cooley
b3432c93c8
Update to SDK 18362 (#568) 2019-06-27 09:53:06 -07:00
Rudy Huyn
cb5dfdda7b Modify ClipTime to adjust to local time before clipping (#558) 2019-06-26 16:17:47 -07:00
Pepe Rivera
1475b49120
Create EquationTextBox control (#547) 2019-06-25 13:40:56 -07:00
Matt Cooley
499e29933c
UI tests should be able to test both dev and store-released builds (#567)
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
2019-06-25 11:29:32 -07:00
Matt Cooley
33b885ac17
Update to v142 build tools for Visual Studio 2019 (#548)
* Update to build tools v142
* Update official build pipelines to use VS2019
* Update instructions to suggest updating to VS2019
2019-06-24 16:38:45 -07:00
Matt Cooley
02a3532442
Remove deprecated internal-only tests (#565) 2019-06-24 13:23:41 -07:00
Stephanie Anderl
2517854836 Added Calculator Standard Mode UI Tests (#501)
- 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
2019-06-21 14:54:36 -07:00
Stephanie Anderl
c3c001af28
Updating GraphingInterfaces to use Graphing Engine 2.0 (#561)
* Updated Graphing Interfaces to version 2.0.1
2019-06-21 13:17:39 -07:00
Michał Janiszewski
e9551e3774 Ensure gldPrevious is scoped to its own translation unit (#556) 2019-06-18 13:05:18 -07:00
Michał Janiszewski
711b37f0bc Add missing override/final to CalculatorManagerDisplayTester (#551) 2019-06-18 13:02:39 -07:00
Michał Janiszewski
841906a4ed Update comment in scicomm.cpp (#549)
While reading this part of code I had hard time understanding the
comment, especially the misused `serious`. I tried rewording it
slightly.
2019-06-17 17:15:35 -07:00
Michał Janiszewski
da9f4ea856 Fix type of m_openParenCount (#550)
m_openParenCount is always used as unsigned and compared against unsigneds
2019-06-17 17:10:15 -07:00
Peter Tissen
dab589b3e0 Handle date difference for ends of months (#553)
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
2019-06-17 16:05:31 -07:00
David Kheri
1ee438ddaf Bound the calendar picker to the control above (#507)
* 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
2019-06-14 18:41:02 -07:00
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