mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Merge branch 'master' into user/jbaylon3/accesskeyinput
This commit is contained in:
commit
93138b5036
23 changed files with 107 additions and 146 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -93,6 +93,9 @@ ipch/
|
|||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <sstream>
|
||||
#include "Header Files/CalcEngine.h"
|
||||
#include "Header Files/CalcUtils.h"
|
||||
#include "NumberFormattingUtils.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace CalcEngine;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
namespace CalcManager::NumberFormattingUtils
|
||||
namespace UnitConversionManager::NumberFormattingUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Trims out any trailing zeros or decimals in the given input string
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <string>
|
||||
#include "sal_cross_platform.h"
|
||||
|
||||
namespace CalcManager::NumberFormattingUtils
|
||||
namespace UnitConversionManager::NumberFormattingUtils
|
||||
{
|
||||
void TrimTrailingZeros(_Inout_ std::wstring& input);
|
||||
unsigned int GetNumberDigits(std::wstring value);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace UnitConversionManager;
|
||||
using namespace CalcManager::NumberFormattingUtils;
|
||||
using namespace UnitConversionManager::NumberFormattingUtils;
|
||||
|
||||
static constexpr uint32_t EXPECTEDSERIALIZEDCATEGORYTOKENCOUNT = 3U;
|
||||
static constexpr uint32_t EXPECTEDSERIALIZEDUNITTOKENCOUNT = 6U;
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "Common/AppResourceProvider.h"
|
||||
#include "Common/ExpressionCommandSerializer.h"
|
||||
#include "Common/ExpressionCommandDeserializer.h"
|
||||
#include "CalcManager/NumberFormattingUtils.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
|
@ -239,13 +238,6 @@ String^ CalculatorApp::ViewModel::Common::Utilities::EscapeHtmlSpecialCharacters
|
|||
return replaceCharacters ? replacementString : originalString;
|
||||
}
|
||||
|
||||
Platform::String^ CalculatorApp::ViewModel::Common::Utilities::TrimTrailingZeros(Platform::String^ input)
|
||||
{
|
||||
std::wstring tmp(input->Data());
|
||||
CalcManager::NumberFormattingUtils::TrimTrailingZeros(tmp);
|
||||
return ref new Platform::String(tmp.c_str());
|
||||
}
|
||||
|
||||
bool CalculatorApp::ViewModel::Common::Utilities::AreColorsEqual(Windows::UI::Color color1, Windows::UI::Color color2)
|
||||
{
|
||||
return Utils::AreColorsEqual(color1, color2);
|
||||
|
|
|
@ -713,7 +713,6 @@ namespace CalculatorApp
|
|||
{
|
||||
public:
|
||||
static Platform::String ^ EscapeHtmlSpecialCharacters(Platform::String ^ originalString);
|
||||
static Platform::String^ TrimTrailingZeros(Platform::String^ input);
|
||||
static bool AreColorsEqual(Windows::UI::Color color1, Windows::UI::Color color2);
|
||||
static Windows::UI::Xaml::Media::SolidColorBrush ^ GetContrastColor(Windows::UI::Color backgroundColor);
|
||||
static int GetWindowId();
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
|
||||
#include "pch.h"
|
||||
#include "GraphingSettingsViewModel.h"
|
||||
#include <CalcManager\NumberFormattingUtils.h>
|
||||
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalcManager::NumberFormattingUtils;
|
||||
using namespace GraphControl;
|
||||
using namespace std;
|
||||
using namespace Platform;
|
||||
|
@ -55,21 +53,22 @@ void GraphingSettingsViewModel::InitRanges()
|
|||
m_XMaxValue = xMax;
|
||||
m_YMinValue = yMin;
|
||||
m_YMaxValue = yMax;
|
||||
auto valueStr = to_wstring(m_XMinValue);
|
||||
TrimTrailingZeros(valueStr);
|
||||
XMin = ref new String(valueStr.c_str());
|
||||
|
||||
valueStr = to_wstring(m_XMaxValue);
|
||||
TrimTrailingZeros(valueStr);
|
||||
XMax = ref new String(valueStr.c_str());
|
||||
std::wostringstream xMinStr;
|
||||
xMinStr << m_XMinValue;
|
||||
XMin = ref new String(xMinStr.str().c_str());
|
||||
|
||||
valueStr = to_wstring(m_YMinValue);
|
||||
TrimTrailingZeros(valueStr);
|
||||
YMin = ref new String(valueStr.c_str());
|
||||
std::wostringstream xMaxStr;
|
||||
xMaxStr << m_XMaxValue;
|
||||
XMax = ref new String(xMaxStr.str().c_str());
|
||||
|
||||
valueStr = to_wstring(m_YMaxValue);
|
||||
TrimTrailingZeros(valueStr);
|
||||
YMax = ref new String(valueStr.c_str());
|
||||
std::wostringstream yMinStr;
|
||||
yMinStr << m_YMinValue;
|
||||
YMin = ref new String(yMinStr.str().c_str());
|
||||
|
||||
std::wostringstream yMaxStr;
|
||||
yMaxStr << m_YMaxValue;
|
||||
YMax = ref new String(yMaxStr.str().c_str());
|
||||
|
||||
m_dontUpdateDisplayRange = false;
|
||||
}
|
||||
|
|
|
@ -51,21 +51,14 @@ namespace CalculatorApp::ViewModel
|
|||
m_XIsMinLastChanged = true;
|
||||
if (m_Graph != nullptr)
|
||||
{
|
||||
try
|
||||
std::wistringstream input(value->Data());
|
||||
double number;
|
||||
if (input >> number && input.eof())
|
||||
{
|
||||
size_t sz;
|
||||
auto number = std::stod(value->Data(), &sz);
|
||||
if (value->Length() == sz)
|
||||
{
|
||||
m_Graph->XAxisMin = m_XMinValue = number;
|
||||
XMinError = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
XMinError = true;
|
||||
}
|
||||
m_Graph->XAxisMin = m_XMinValue = number;
|
||||
XMinError = false;
|
||||
}
|
||||
catch (...)
|
||||
else
|
||||
{
|
||||
XMinError = true;
|
||||
}
|
||||
|
@ -92,21 +85,14 @@ namespace CalculatorApp::ViewModel
|
|||
m_XIsMinLastChanged = false;
|
||||
if (m_Graph != nullptr)
|
||||
{
|
||||
try
|
||||
std::wistringstream input(value->Data());
|
||||
double number;
|
||||
if (input >> number && input.eof())
|
||||
{
|
||||
size_t sz;
|
||||
auto number = std::stod(value->Data(), &sz);
|
||||
if (value->Length() == sz)
|
||||
{
|
||||
m_Graph->XAxisMax = m_XMaxValue = number;
|
||||
XMaxError = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
XMaxError = true;
|
||||
}
|
||||
m_Graph->XAxisMax = m_XMaxValue = number;
|
||||
XMaxError = false;
|
||||
}
|
||||
catch (...)
|
||||
else
|
||||
{
|
||||
XMaxError = true;
|
||||
}
|
||||
|
@ -133,21 +119,14 @@ namespace CalculatorApp::ViewModel
|
|||
m_YIsMinLastChanged = true;
|
||||
if (m_Graph != nullptr)
|
||||
{
|
||||
try
|
||||
std::wistringstream input(value->Data());
|
||||
double number;
|
||||
if (input >> number && input.eof())
|
||||
{
|
||||
size_t sz;
|
||||
auto number = std::stod(value->Data(), &sz);
|
||||
if (value->Length() == sz)
|
||||
{
|
||||
m_Graph->YAxisMin = m_YMinValue = number;
|
||||
YMinError = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
YMinError = true;
|
||||
}
|
||||
m_Graph->YAxisMin = m_YMinValue = number;
|
||||
YMinError = false;
|
||||
}
|
||||
catch (...)
|
||||
else
|
||||
{
|
||||
YMinError = true;
|
||||
}
|
||||
|
@ -174,21 +153,14 @@ namespace CalculatorApp::ViewModel
|
|||
m_YIsMinLastChanged = false;
|
||||
if (m_Graph != nullptr)
|
||||
{
|
||||
try
|
||||
std::wistringstream input(value->Data());
|
||||
double number;
|
||||
if (input >> number && input.eof())
|
||||
{
|
||||
size_t sz;
|
||||
auto number = std::stod(value->Data(), &sz);
|
||||
if (value->Length() == sz)
|
||||
{
|
||||
m_Graph->YAxisMax = m_YMaxValue = number;
|
||||
YMaxError = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
YMaxError = true;
|
||||
}
|
||||
m_Graph->YAxisMax = m_YMaxValue = number;
|
||||
YMaxError = false;
|
||||
}
|
||||
catch (...)
|
||||
else
|
||||
{
|
||||
YMaxError = true;
|
||||
}
|
||||
|
|
|
@ -137,6 +137,13 @@ StandardCalculatorViewModel::StandardCalculatorViewModel()
|
|||
String ^ StandardCalculatorViewModel::LocalizeDisplayValue(_In_ wstring const& displayValue)
|
||||
{
|
||||
wstring result(displayValue);
|
||||
|
||||
// Adds leading padding 0's to Programmer Mode's Binary Display
|
||||
if (IsProgrammer && CurrentRadixType == NumberBase::BinBase)
|
||||
{
|
||||
result = AddPadding(result);
|
||||
}
|
||||
|
||||
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&result);
|
||||
return ref new Platform::String(result.c_str());
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Common\AlwaysSelectedCollectionView.cs" />
|
||||
<Compile Include="Common\AppLifecycleLogger.cs" />
|
||||
<Compile Include="Common\KeyboardShortcuManager.cs" />
|
||||
<Compile Include="Common\KeyboardShortcutManager.cs" />
|
||||
<Compile Include="Common\ValidatingConverters.cs" />
|
||||
<Compile Include="Common\ViewState.cs" />
|
||||
<Compile Include="Controls\CalculationResult.cs" />
|
||||
|
|
|
@ -652,6 +652,7 @@ namespace CalculatorApp
|
|||
private static void OnKeyDownHandler(CoreWindow sender, KeyEventArgs args)
|
||||
{
|
||||
s_keyHandlerCount++;
|
||||
|
||||
if (args.Handled)
|
||||
{
|
||||
return;
|
||||
|
@ -731,7 +732,7 @@ namespace CalculatorApp
|
|||
s_deferredEnableShortcut = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void OnAcceleratorKeyActivated(CoreDispatcher dispatcher, AcceleratorKeyEventArgs args)
|
||||
{
|
||||
if (args.KeyStatus.IsKeyReleased)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
@ -3883,11 +3883,11 @@
|
|||
<comment>Select all menu item from the Equation TextBox</comment>
|
||||
</data>
|
||||
<data name="EquationInputButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Function input list item</value>
|
||||
<value>Function input</value>
|
||||
<comment>The automation name for the Equation Input ListView item that is shown when Calculator is in graphing mode.</comment>
|
||||
</data>
|
||||
<data name="EquationInputList.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Function input list</value>
|
||||
<value>Function input</value>
|
||||
<comment>The automation name for the Equation Input ListView that is shown when Calculator is in graphing mode.</comment>
|
||||
</data>
|
||||
<data name="EquationInputPanel.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
|
@ -4166,4 +4166,4 @@
|
|||
<value>App theme setting</value>
|
||||
<comment>Screen reader prompt for the App theme Setting radio buttons group</comment>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
|
|
@ -2708,7 +2708,7 @@
|
|||
<data name="PreviewTag.Text" xml:space="preserve">
|
||||
<value>Preview</value>
|
||||
<comment>Label displayed next to upcoming features</comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="AboutControlPrivacyStatement.Text" xml:space="preserve">
|
||||
<value>Microsoft Privacy Statement</value>
|
||||
<comment>Displayed on a link to the Microsoft Privacy Statement on the About panel</comment>
|
||||
|
@ -3839,11 +3839,11 @@
|
|||
<value>Automatic best fit</value>
|
||||
<comment>Announcement used in Graphing Calculator when graph view button is clicked and automatic best fit is set</comment>
|
||||
</data>
|
||||
<data name="GraphViewManualAdjustmentAnnouncement" xml:space="preserve">
|
||||
<data name="GraphViewManualAdjustmentAnnouncement" xml:space="preserve">
|
||||
<value>Manual adjustment</value>
|
||||
<comment>Announcement used in Graphing Calculator when graph view button is clicked and manual adjustment is set</comment>
|
||||
</data>
|
||||
<data name="GridResetAnnouncement" xml:space="preserve">
|
||||
<data name="GridResetAnnouncement" xml:space="preserve">
|
||||
<value>Graph view has been reset</value>
|
||||
<comment>Announcement used in Graphing Calculator when graph view button is clicked and automatic best fit is set, resetting the graph</comment>
|
||||
</data>
|
||||
|
@ -4118,11 +4118,11 @@
|
|||
<value>The equation contains logical conditions that are mutually exclusive</value>
|
||||
<comment>Error that occurs during graphing when mutually exclusive conditions are used.</comment>
|
||||
</data>
|
||||
<data name="OutOfDomain" xml:space="preserve">
|
||||
<data name="OutOfDomain" xml:space="preserve">
|
||||
<value>Equation is out of domain</value>
|
||||
<comment>Error that occurs during graphing when the equation is out of domain.</comment>
|
||||
</data>
|
||||
<data name="GE_NotSupported" xml:space="preserve">
|
||||
<data name="GE_NotSupported" xml:space="preserve">
|
||||
<value>Graphing this equation is not supported</value>
|
||||
<comment>Error that occurs during graphing when the equation is not supported.</comment>
|
||||
</data>
|
||||
|
@ -4165,19 +4165,19 @@
|
|||
<data name="InvalidEquationSyntax" xml:space="preserve">
|
||||
<value>Invalid expression</value>
|
||||
<comment>Error that occurs during graphing when an invalid syntax is used.</comment>
|
||||
</data>
|
||||
<data name="EmptyExpression" xml:space="preserve">
|
||||
</data>
|
||||
<data name="EmptyExpression" xml:space="preserve">
|
||||
<value>The expression is empty</value>
|
||||
<comment>Error that occurs during graphing when the expression is empty</comment>
|
||||
</data>
|
||||
<data name="EqualWithoutEquation" xml:space="preserve">
|
||||
<data name="EqualWithoutEquation" xml:space="preserve">
|
||||
<value>Equal was used without an equation</value>
|
||||
<comment>Error that occurs during graphing when equal is used without an equation. Ex: sin(x=y)</comment>
|
||||
</data>
|
||||
<data name="ExpectParenthesisAfterFunctionName" xml:space="preserve">
|
||||
<value>Parenthesis missing after function name</value>
|
||||
<comment>Error that occurs during graphing when parenthesis are missing after a function.</comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="IncorrectNumParameter" xml:space="preserve">
|
||||
<value>A mathematical operation has the incorrect number of parameters</value>
|
||||
<comment>Error that occurs during graphing when a function has the wrong number of parameters</comment>
|
||||
|
@ -4234,7 +4234,7 @@
|
|||
<value>Cannot use complex numbers in inequalities</value>
|
||||
<comment>Error that occurs during graphing when complex numbers are used in inequalities.</comment>
|
||||
</data>
|
||||
<data name="equationAnalysisBack.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<data name="equationAnalysisBack.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Back to function list</value>
|
||||
<comment>This is the tooltip for the back button in the equation analysis page in the graphing calculator</comment>
|
||||
</data>
|
||||
|
@ -4294,7 +4294,7 @@
|
|||
<value>Hide equation</value>
|
||||
<comment>This is the tooltip/automation name shown when visibility is set to visible in the graphing calculator.</comment>
|
||||
</data>
|
||||
<data name="showEquationButtonAutomationName" xml:space="preserve">
|
||||
<data name="showEquationButtonAutomationName" xml:space="preserve">
|
||||
<value>Show equation %1</value>
|
||||
<comment>{Locked="%1"}, This is the tooltip/automation name shown when visibility is set to hidden in the graphing calculator. %1 is the equation number.</comment>
|
||||
</data>
|
||||
|
@ -4302,7 +4302,6 @@
|
|||
<value>Hide equation %1</value>
|
||||
<comment>{Locked="%1"}, This is the tooltip/automation name shown when visibility is set to visible in the graphing calculator. %1 is the equation number.</comment>
|
||||
</data>
|
||||
|
||||
<data name="disableTracingButtonToolTip" xml:space="preserve">
|
||||
<value>Stop tracing</value>
|
||||
<comment>This is the tooltip/automation name for the graphing calculator stop tracing button</comment>
|
||||
|
@ -4314,7 +4313,7 @@
|
|||
<data name="graphAutomationName" xml:space="preserve">
|
||||
<value>Graph viewing window, x-axis bounded by %1 and %2, y-axis bounded by %3 and %4, displaying %5 equations</value>
|
||||
<comment>{Locked="%1","%2", "%3", "%4", "%5"}. </comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="sliderOptionsButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>Configure slider</value>
|
||||
<comment>This is the tooltip text for the slider options button in Graphing Calculator</comment>
|
||||
|
@ -4431,7 +4430,7 @@
|
|||
<value>Enter an expression</value>
|
||||
<comment>this is the placeholder text used by the textbox to enter an equation</comment>
|
||||
</data>
|
||||
<data name="GraphCopyMenuItem.Text">
|
||||
<data name="GraphCopyMenuItem.Text" xml:space="preserve">
|
||||
<value>Copy</value>
|
||||
<comment>Copy menu item for the graph context menu</comment>
|
||||
</data>
|
||||
|
@ -4454,13 +4453,13 @@
|
|||
<data name="selectAllEquationMenuItem.Text" xml:space="preserve">
|
||||
<value>Select all</value>
|
||||
<comment>Select all menu item from the Equation TextBox</comment>
|
||||
</data>
|
||||
</data>
|
||||
<data name="EquationInputButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Function input list item</value>
|
||||
<value>Function input</value>
|
||||
<comment>The automation name for the Equation Input ListView item that is shown when Calculator is in graphing mode.</comment>
|
||||
</data>
|
||||
<data name="EquationInputList.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Function input list</value>
|
||||
<value>Function input</value>
|
||||
<comment>The automation name for the Equation Input ListView that is shown when Calculator is in graphing mode.</comment>
|
||||
</data>
|
||||
<data name="EquationInputPanel.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
|
@ -4571,19 +4570,19 @@
|
|||
<value>White</value>
|
||||
<comment>Name of color in the color picker</comment>
|
||||
</data>
|
||||
<data name="equationHighContrastColor1AutomationName" xml:space="preserve">
|
||||
<data name="equationHighContrastColor1AutomationName" xml:space="preserve">
|
||||
<value>Color 1</value>
|
||||
<comment>Name of color in the color picker</comment>
|
||||
</data>
|
||||
<data name="equationHighContrastColor2AutomationName" xml:space="preserve">
|
||||
<data name="equationHighContrastColor2AutomationName" xml:space="preserve">
|
||||
<value>Color 2</value>
|
||||
<comment>Name of color in the color picker</comment>
|
||||
</data>
|
||||
<data name="equationHighContrastColor3AutomationName" xml:space="preserve">
|
||||
<data name="equationHighContrastColor3AutomationName" xml:space="preserve">
|
||||
<value>Color 3</value>
|
||||
<comment>Name of color in the color picker</comment>
|
||||
</data>
|
||||
<data name="equationHighContrastColor4AutomationName" xml:space="preserve">
|
||||
<data name="equationHighContrastColor4AutomationName" xml:space="preserve">
|
||||
<value>Color 4</value>
|
||||
<comment>Name of color in the color picker</comment>
|
||||
</data>
|
||||
|
@ -4647,7 +4646,7 @@
|
|||
<value>X</value>
|
||||
<comment>Screen reader prompt for the X button on the graphing calculator operator keypad</comment>
|
||||
</data>
|
||||
<data name="yButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<data name="yButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Y</value>
|
||||
<comment>Screen reader prompt for the Y button on the graphing calculator operator keypad</comment>
|
||||
</data>
|
||||
|
@ -4739,4 +4738,4 @@
|
|||
<value>App theme setting</value>
|
||||
<comment>Screen reader prompt for the App theme Setting radio buttons group</comment>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
|
@ -982,8 +982,7 @@
|
|||
FontFamily="{ThemeResource CalculatorFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
MirroredWhenRightToLeft="True"
|
||||
UseLayoutRounding="False"/>
|
||||
MirroredWhenRightToLeft="True"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
|
@ -1030,8 +1029,7 @@
|
|||
FontFamily="{ThemeResource CalculatorFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
MirroredWhenRightToLeft="True"
|
||||
UseLayoutRounding="False"/>
|
||||
MirroredWhenRightToLeft="True"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Grid.Resources>
|
||||
|
|
|
@ -918,7 +918,6 @@
|
|||
Margin="2"
|
||||
Style="{StaticResource ScrollViewerStyle}"
|
||||
IsFocusEngagementEnabled="True"
|
||||
UseLayoutRounding="False"
|
||||
Visibility="Collapsed">
|
||||
<ScrollViewer.RenderTransform>
|
||||
<ScaleTransform x:Name="YearViewTransform"
|
||||
|
@ -931,7 +930,6 @@
|
|||
Margin="2"
|
||||
Style="{StaticResource ScrollViewerStyle}"
|
||||
IsFocusEngagementEnabled="True"
|
||||
UseLayoutRounding="False"
|
||||
Visibility="Collapsed">
|
||||
<ScrollViewer.RenderTransform>
|
||||
<ScaleTransform x:Name="DecadeViewTransform"
|
||||
|
|
|
@ -65,9 +65,8 @@
|
|||
VerticalAlignment="Stretch"
|
||||
Fill="Transparent"
|
||||
Stroke="Transparent"
|
||||
StrokeThickness="2"
|
||||
UseLayoutRounding="false"/>
|
||||
<ContentPresenter x:Name="ItemContent" UseLayoutRounding="false"/>
|
||||
StrokeThickness="2"/>
|
||||
<ContentPresenter x:Name="ItemContent" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
@ -87,8 +86,7 @@
|
|||
Fill="{x:Bind}"
|
||||
StrokeThickness="0"
|
||||
AutomationProperties.Name="{x:Bind local:EquationStylePanelControl.GetColorAutomationName((Brush))}"
|
||||
ToolTipService.ToolTip="{x:Bind local:EquationStylePanelControl.GetColorAutomationName((Brush))}"
|
||||
UseLayoutRounding="false"/>
|
||||
ToolTipService.ToolTip="{x:Bind local:EquationStylePanelControl.GetColorAutomationName((Brush))}"/>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
<GridView.ItemsPanel>
|
||||
|
|
|
@ -12,9 +12,7 @@ using CalculatorApp.ViewModel.Common.Automation;
|
|||
using CalculatorApp.Controls;
|
||||
using CalculatorApp.Utils;
|
||||
using CalculatorApp.ViewModel;
|
||||
//using CalcManager.NumberFormattingUtils;
|
||||
using GraphControl;
|
||||
//using Utils;
|
||||
using Windows.ApplicationModel.DataTransfer;
|
||||
using Windows.ApplicationModel.Resources;
|
||||
using Windows.Foundation;
|
||||
|
@ -467,8 +465,7 @@ namespace CalculatorApp
|
|||
var value = variables[i].Value;
|
||||
|
||||
rawHtml += name + "=";
|
||||
var formattedValue = value.ToString("R");
|
||||
formattedValue = Utilities.TrimTrailingZeros(formattedValue);
|
||||
var formattedValue = value.ToString();
|
||||
rawHtml += formattedValue;
|
||||
|
||||
if (variables.Count - 1 != i)
|
||||
|
|
|
@ -335,7 +335,7 @@
|
|||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid x:Name="GraphingOperators" UseLayoutRounding="False">
|
||||
<Grid x:Name="GraphingOperators">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition x:Name="OperatorPanelRow" Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<UserControl x:Class="CalculatorApp.OperatorsPanel"
|
||||
<UserControl x:Class="CalculatorApp.OperatorsPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
|
@ -6,7 +6,6 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="315"
|
||||
d:DesignWidth="235"
|
||||
UseLayoutRounding="False"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<local:CalculatorStandardOperators x:Name="StandardOperators"
|
||||
|
|
|
@ -7,7 +7,7 @@ using OpenQA.Selenium.Appium.Windows;
|
|||
namespace CalculatorUITestFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// This class contains the UI automation objects and helper methods available when the Calculator is in Scientific Mode.
|
||||
/// This class contains the UI automation objects and helper methods available when the Calculator is in Programmer Mode.
|
||||
/// </summary>
|
||||
public class ProgrammerCalculatorPage
|
||||
{
|
||||
|
|
|
@ -340,7 +340,7 @@ namespace CalculatorUITests
|
|||
page.ProgrammerOperators.LeftShiftButton.Click();
|
||||
page.StandardOperators.NumberPad.Input(1);
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 0 1 0 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 0 0 1 0 1 0 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -352,7 +352,7 @@ namespace CalculatorUITests
|
|||
page.ProgrammerOperators.RightShiftButton.Click();
|
||||
page.StandardOperators.NumberPad.Input(1);
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 0 1", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 1 0 1", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -429,7 +429,7 @@ namespace CalculatorUITests
|
|||
page.ProgrammerOperators.XorButton.Click();
|
||||
page.StandardOperators.NumberPad.Input(1100);
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 1 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 1 1 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -623,7 +623,7 @@ namespace CalculatorUITests
|
|||
page.ProgrammerOperators.LeftShiftLogicalButton.Click();
|
||||
page.StandardOperators.NumberPad.Input(1);
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 0 1 0 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 0 0 1 0 1 0 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -637,7 +637,7 @@ namespace CalculatorUITests
|
|||
page.ProgrammerOperators.RightShiftLogicalButton.Click();
|
||||
page.StandardOperators.NumberPad.Input(1);
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.IsTrue(String.Equals(page.CalculatorResults.GetCalculatorResultText(), "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1", StringComparison.OrdinalIgnoreCase));
|
||||
Assert.IsTrue(String.Equals(page.CalculatorResults.GetCalculatorResultText(), "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -737,7 +737,7 @@ namespace CalculatorUITests
|
|||
page.StandardOperators.NumberPad.Input(1011);
|
||||
page.ProgrammerOperators.RoLButton.Click();
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 0 1 1 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 0 0 1 0 1 1 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -846,7 +846,7 @@ namespace CalculatorUITests
|
|||
page.StandardOperators.NumberPad.Input(1010);
|
||||
page.ProgrammerOperators.RoLButton.Click();
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 0 1 0 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 0 0 1 0 1 0 0", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -858,7 +858,7 @@ namespace CalculatorUITests
|
|||
page.StandardOperators.NumberPad.Input(1011);
|
||||
page.ProgrammerOperators.RoRCarryButton.Click();
|
||||
page.StandardOperators.EqualButton.Click();
|
||||
Assert.AreEqual("1 0 1", page.CalculatorResults.GetCalculatorResultText());
|
||||
Assert.AreEqual("0 1 0 1", page.CalculatorResults.GetCalculatorResultText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculationManager;
|
||||
using namespace CalcManager::NumberFormattingUtils;
|
||||
using namespace UnitConversionManager::NumberFormattingUtils;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
@ -191,11 +191,11 @@ namespace CalculatorManagerTest
|
|||
TEST_METHOD(CalculatorManagerTestMaxDigitsReached_LeadingDecimal);
|
||||
TEST_METHOD(CalculatorManagerTestMaxDigitsReached_TrailingDecimal);
|
||||
|
||||
TEST_METHOD(CalculatorManagerNumberFormattingUtils_TrimTrailingZeros);
|
||||
TEST_METHOD(CalculatorManagerNumberFormattingUtils_GetNumberDigits);
|
||||
TEST_METHOD(CalculatorManagerNumberFormattingUtils_GetNumberDigitsWholeNumberPart);
|
||||
TEST_METHOD(CalculatorManagerNumberFormattingUtils_RoundSignificantDigits);
|
||||
TEST_METHOD(CalculatorManagerNumberFormattingUtils_ToScientificNumber);
|
||||
TEST_METHOD(UnitConversionManagerNumberFormattingUtils_TrimTrailingZeros);
|
||||
TEST_METHOD(UnitConversionManagerNumberFormattingUtils_GetNumberDigits);
|
||||
TEST_METHOD(UnitConversionManagerNumberFormattingUtils_GetNumberDigitsWholeNumberPart);
|
||||
TEST_METHOD(UnitConversionManagerNumberFormattingUtils_RoundSignificantDigits);
|
||||
TEST_METHOD(UnitConversionManagerNumberFormattingUtils_ToScientificNumber);
|
||||
|
||||
TEST_METHOD(CalculatorManagerTestBinaryOperatorReceived);
|
||||
TEST_METHOD(CalculatorManagerTestBinaryOperatorReceived_Multiple);
|
||||
|
@ -917,7 +917,7 @@ namespace CalculatorManagerTest
|
|||
TestMaxDigitsReachedScenario(L"123,456,789,101,112.13");
|
||||
}
|
||||
|
||||
void CalculatorManagerTest::CalculatorManagerNumberFormattingUtils_TrimTrailingZeros()
|
||||
void CalculatorManagerTest::UnitConversionManagerNumberFormattingUtils_TrimTrailingZeros()
|
||||
{
|
||||
wstring number = L"2.1032100000000";
|
||||
TrimTrailingZeros(number);
|
||||
|
@ -942,7 +942,7 @@ namespace CalculatorManagerTest
|
|||
VERIFY_ARE_EQUAL(number, L"322423");
|
||||
}
|
||||
|
||||
void CalculatorManagerTest::CalculatorManagerNumberFormattingUtils_GetNumberDigits()
|
||||
void CalculatorManagerTest::UnitConversionManagerNumberFormattingUtils_GetNumberDigits()
|
||||
{
|
||||
wstring number = L"2.10321";
|
||||
unsigned int digitsCount = GetNumberDigits(number);
|
||||
|
@ -961,7 +961,7 @@ namespace CalculatorManagerTest
|
|||
VERIFY_ARE_EQUAL(digitsCount, 8);
|
||||
}
|
||||
|
||||
void CalculatorManagerTest::CalculatorManagerNumberFormattingUtils_GetNumberDigitsWholeNumberPart()
|
||||
void CalculatorManagerTest::UnitConversionManagerNumberFormattingUtils_GetNumberDigitsWholeNumberPart()
|
||||
{
|
||||
unsigned int digitsCount = GetNumberDigitsWholeNumberPart(2.10321);
|
||||
VERIFY_ARE_EQUAL(digitsCount, 1);
|
||||
|
@ -981,7 +981,7 @@ namespace CalculatorManagerTest
|
|||
VERIFY_ARE_EQUAL(digitsCount, 1);
|
||||
}
|
||||
|
||||
void CalculatorManagerTest::CalculatorManagerNumberFormattingUtils_RoundSignificantDigits()
|
||||
void CalculatorManagerTest::UnitConversionManagerNumberFormattingUtils_RoundSignificantDigits()
|
||||
{
|
||||
wstring result = RoundSignificantDigits(12.342343242, 3);
|
||||
VERIFY_ARE_EQUAL(result, L"12.342");
|
||||
|
@ -997,7 +997,7 @@ namespace CalculatorManagerTest
|
|||
VERIFY_ARE_EQUAL(result, L"0.3423000");
|
||||
}
|
||||
|
||||
void CalculatorManagerTest::CalculatorManagerNumberFormattingUtils_ToScientificNumber()
|
||||
void CalculatorManagerTest::UnitConversionManagerNumberFormattingUtils_ToScientificNumber()
|
||||
{
|
||||
wstring result = ToScientificNumber(3423);
|
||||
VERIFY_ARE_EQUAL(result, L"3.423000e+03");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue