Update Calculator keyboard for greater consistency and extensibility (#688)

This commit is contained in:
Pepe Rivera
2019-10-03 15:56:44 -07:00
committed by GitHub
parent 9cb0932eaa
commit 55074c2312
34 changed files with 3151 additions and 1181 deletions

View File

@@ -94,6 +94,32 @@ public
Byte = (int)CM::Command::CommandByte,
Cube = (int)CM::Command::CommandCUB,
DMS = (int)CM::Command::CommandDMS,
Hyp = (int) CM::Command::CommandHYP,
Sec = (int) CM::Command::CommandSEC,
Csc = (int) CM::Command::CommandCSC,
Cot = (int) CM::Command::CommandCOT,
InvSec = (int) CM::Command::CommandASEC,
InvCsc = (int) CM::Command::CommandACSC,
InvCot = (int) CM::Command::CommandACOT,
Sech = (int) CM::Command::CommandSECH,
Csch = (int) CM::Command::CommandCSCH,
Coth = (int) CM::Command::CommandCOTH,
InvSech = (int) CM::Command::CommandASECH,
InvCsch = (int) CM::Command::CommandACSCH,
InvCoth = (int) CM::Command::CommandACOTH,
CubeRoot = (int) CM::Command::CommandCUBEROOT,
TwoPowerX = (int) CM::Command::CommandPOW2,
LogBaseX = (int) CM::Command::CommandLogBaseX,
Nand = (int) CM::Command::CommandNand,
Nor = (int) CM::Command::CommandNor,
Abs = (int) CM::Command::CommandAbs,
Floor = (int) CM::Command::CommandFloor,
Ceil = (int) CM::Command::CommandCeil,
Rand = (int) CM::Command::CommandRand,
Euler = (int) CM::Command::CommandEuler,
RshL = (int)CM::Command::CommandRSHFL,
RolC = (int)CM::Command::CommandROLC,
RorC = (int)CM::Command::CommandRORC,
BINSTART = (int)CM::Command::CommandBINEDITSTART,
BINPOS0 = (int)CM::Command::CommandBINPOS0,
@@ -161,7 +187,6 @@ public
BINPOS62 = (int)CM::Command::CommandBINPOS62,
BINPOS63 = (int)CM::Command::CommandBINPOS63,
BINEND = (int)CM::Command::CommandBINEDITEND,
Hyp = (int)CM::Command::CommandHYP,
// Enum values below are used for Tracelogging and do not map to the Calculator engine
MemoryAdd = (int)CM::Command::CommandMPLUS,

View File

@@ -503,16 +503,49 @@ unordered_map<wstring, wstring> LocalizationService::GetTokenToReadableNameMap()
make_pair<wstring, wstring>(L"27", L"HyperbolicTangent"),
make_pair<wstring, wstring>(L"87", L"InverseHyperbolicTangent"),
// Secant permutations
make_pair<wstring, wstring>(L"SecDeg", L"SecantDegrees"),
make_pair<wstring, wstring>(L"SecRad", L"SecantRadians"),
make_pair<wstring, wstring>(L"SecGrad", L"SecantGradians"),
make_pair<wstring, wstring>(L"InverseSecDeg", L"InverseSecantDegrees"),
make_pair<wstring, wstring>(L"InverseSecRad", L"InverseSecantRadians"),
make_pair<wstring, wstring>(L"InverseSecGrad", L"InverseSecantGradians"),
make_pair<wstring, wstring>(L"Sech", L"HyperbolicSecant"),
make_pair<wstring, wstring>(L"InverseSech", L"InverseHyperbolicSecant"),
// Cosecant permutations
make_pair<wstring, wstring>(L"CscDeg", L"CosecantDegrees"),
make_pair<wstring, wstring>(L"CscRad", L"CosecantRadians"),
make_pair<wstring, wstring>(L"CscGrad", L"CosecantGradians"),
make_pair<wstring, wstring>(L"InverseCscDeg", L"InverseCosecantDegrees"),
make_pair<wstring, wstring>(L"InverseCscRad", L"InverseCosecantRadians"),
make_pair<wstring, wstring>(L"InverseCscGrad", L"InverseCosecantGradians"),
make_pair<wstring, wstring>(L"Csch", L"HyperbolicCosecant"),
make_pair<wstring, wstring>(L"InverseCsch", L"InverseHyperbolicCosecant"),
// Cotangent permutations
make_pair<wstring, wstring>(L"CotDeg", L"CotangentDegrees"),
make_pair<wstring, wstring>(L"CotRad", L"CotangentRadians"),
make_pair<wstring, wstring>(L"CotGrad", L"CotangentGradians"),
make_pair<wstring, wstring>(L"InverseCotDeg", L"InverseCotangentDegrees"),
make_pair<wstring, wstring>(L"InverseCotRad", L"InverseCotangentRadians"),
make_pair<wstring, wstring>(L"InverseCotGrad", L"InverseCotangentGradians"),
make_pair<wstring, wstring>(L"Coth", L"HyperbolicCotangent"),
make_pair<wstring, wstring>(L"InverseCoth", L"InverseHyperbolicCotangent"),
// Miscellaneous Scientific functions
make_pair<wstring, wstring>(L"94", L"Factorial"),
make_pair<wstring, wstring>(L"35", L"DegreeMinuteSecond"),
make_pair<wstring, wstring>(L"28", L"NaturalLog"),
make_pair<wstring, wstring>(L"91", L"Square")
make_pair<wstring, wstring>(L"91", L"Square"),
make_pair<wstring, wstring>(L"CubeRoot", L"CubeRoot"),
make_pair<wstring, wstring>(L"Abs", L"AbsoluteValue")
};
static vector<pair<wstring, wstring>> s_noParenEngineKeyResourceMap = { // Programmer mode functions
make_pair<wstring, wstring>(L"9", L"LeftShift"),
make_pair<wstring, wstring>(L"10", L"RightShift"),
make_pair<wstring, wstring>(L"LogBaseX", L"Logx"),
// Y Root scientific function
make_pair<wstring, wstring>(L"16", L"YRoot")

View File

@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
@@ -160,7 +160,7 @@ static constexpr array<const NavCategoryInitializer, 17> s_categoryManifest = {
L"\uE945",
CategoryGroupType::Converter,
MyVirtualKey::None,
POSITIVE_ONLY },
SUPPORTS_NEGATIVE },
NavCategoryInitializer{ ViewMode::Data,
DATA_ID,
L"Data",
@@ -184,7 +184,7 @@ static constexpr array<const NavCategoryInitializer, 17> s_categoryManifest = {
L"\uF515",
CategoryGroupType::Converter,
MyVirtualKey::None,
POSITIVE_ONLY } };
SUPPORTS_NEGATIVE } };
// This function should only be used when storing the mode to app data.
int NavCategory::Serialize(ViewMode mode)

View File

@@ -73,7 +73,6 @@ StandardCalculatorViewModel::StandardCalculatorViewModel()
, m_MemorizedNumbers(ref new Vector<MemoryItemViewModel ^>())
, m_IsMemoryEmpty(true)
, m_IsFToEChecked(false)
, m_isShiftChecked(false)
, m_IsShiftProgrammerChecked(false)
, m_valueBitLength(BitLength::BitLengthQWord)
, m_isBitFlipChecked(false)

View File

@@ -66,7 +66,6 @@ namespace CalculatorApp
OBSERVABLE_NAMED_PROPERTY_RW(bool, IsMemoryEmpty);
OBSERVABLE_PROPERTY_RW(bool, IsFToEChecked);
OBSERVABLE_PROPERTY_RW(bool, IsFToEEnabled);
OBSERVABLE_PROPERTY_RW(bool, IsHyperbolicChecked);
OBSERVABLE_PROPERTY_RW(bool, AreHEXButtonsEnabled);
OBSERVABLE_PROPERTY_RW(Platform::String ^, CalculationResultAutomationName);
OBSERVABLE_PROPERTY_RW(Platform::String ^, CalculationExpressionAutomationName);
@@ -90,22 +89,6 @@ namespace CalculatorApp
event HideMemoryClickedHandler ^ HideMemoryClicked;
property bool IsShiftChecked
{
bool get()
{
return m_isShiftChecked;
}
void set(bool value)
{
if (m_isShiftChecked != value)
{
m_isShiftChecked = value;
RaisePropertyChanged(L"IsShiftChecked");
}
}
}
property bool IsBitFlipChecked
{
bool get()
@@ -435,7 +418,6 @@ namespace CalculatorApp
bool m_isAlwaysOnTop;
bool m_isBinaryBitFlippingEnabled;
bool m_isBitFlipChecked;
bool m_isShiftChecked;
bool m_isRtlLanguage;
int m_tokenPosition;
bool m_keyPressed;