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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;

View File

@ -17,17 +17,33 @@
<x:Double x:Key="HighContrastStrokeThickness">0</x:Double>
<Color x:Key="AltHighColor">#FF000000</Color>
<Color x:Key="ChromeMediumLowColor">#FF2B2B2B</Color>
<Color x:Key="OperatorPanelScrollButtonBackgroundColor">#FF858585</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource AltHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource ChromeMediumLowColor}"/>
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="AppBackgroundAltMediumLowBrush" Color="{ThemeResource SystemAltMediumLowColor}"/>
<SolidColorBrush x:Key="AppOperatorPanelBackground"
Opacity="0.4"
Color="{ThemeResource SystemAltMediumLowColor}"/>
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush" Color="{StaticResource SystemBaseMediumHighColor}"/>
<RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush" Color="#18FFFFFF"/>
<RevealBackgroundBrush x:Key="AppControlPressedButtonFaceBrush" Color="#30FFFFFF"/>
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush" Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlPageTextBaseHighColorBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="OperatorPanelScrollButtonBackgroundBrush" Color="{ThemeResource OperatorPanelScrollButtonBackgroundColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonBrush"
Opacity="0.4"
Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonToggledBrush"
Opacity="0.4"
Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonHoverBrush"
Opacity="0.9"
Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlPageTextRedColorBrush" Color="Red"/>
<RevealBorderBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
FallbackColor="Transparent"
@ -46,24 +62,41 @@
FallbackColor="{ThemeResource SystemChromeMediumColor}"
TintColor="{ThemeResource SystemChromeLowColor}"
TintOpacity="0.7"/>
<SolidColorBrush x:Key="AppChromeAcrylicOperatorFlyoutBackgroundBrush" Color="#FF2F2F2F"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<Thickness x:Key="HighContrastThicknessTop">0,0,0,0</Thickness>
<x:Double x:Key="HighContrastStrokeThickness">0</x:Double>
<Color x:Key="AltHighColor">#FFF2F2F2</Color>
<Color x:Key="ChromeMediumLowColor">#FFE0E0E0</Color>
<Color x:Key="OperatorPanelScrollButtonBackgroundColor">#FF858585</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource ChromeMediumLowColor}"/>
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="AppBackgroundAltMediumLowBrush" Color="{ThemeResource SystemAltMediumLowColor}"/>
<SolidColorBrush x:Key="AppOperatorPanelBackground"
Opacity="0.4"
Color="{ThemeResource SystemAltMediumLowColor}"/>
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush" Color="{StaticResource SystemBaseMediumHighColor}"/>
<RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush" Color="#17000000"/>
<RevealBackgroundBrush x:Key="AppControlPressedButtonFaceBrush" Color="#30000000"/>
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush" Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlPageTextBaseHighColorBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="OperatorPanelScrollButtonBackgroundBrush" Color="{ThemeResource OperatorPanelScrollButtonBackgroundColor}"/>
<SolidColorBrush x:Key="AppControlPageTextRedColorBrush" Color="Red"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonBrush"
Opacity="0.4"
Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonToggledBrush"
Opacity="0.4"
Color="{ThemeResource SystemAccentColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonHoverBrush"
Opacity="0.7"
Color="{ThemeResource SystemAccentColor}"/>
<RevealBorderBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
FallbackColor="Transparent"
TargetTheme="Light"
@ -81,6 +114,11 @@
FallbackColor="{ThemeResource SystemChromeMediumColor}"
TintColor="{ThemeResource SystemChromeLowColor}"
TintOpacity="0.7"/>
<AcrylicBrush x:Key="AppChromeAcrylicOperatorFlyoutBackgroundBrush"
BackgroundSource="HostBackdrop"
FallbackColor="{ThemeResource SystemChromeMediumColor}"
TintColor="{ThemeResource SystemChromeLowColor}"
TintOpacity="0.8"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Thickness x:Key="HighContrastThicknessTop">0,1,0,0</Thickness>
@ -91,17 +129,23 @@
<SolidColorBrush x:Key="SystemControlBackgroundTransparentBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="AppBackgroundAltMediumLowBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="AppOperatorPanelBackground" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush" Color="{ThemeResource SystemColorWindowTextColor}"/>
<SolidColorBrush x:Key="AppControlHoverButtonFaceBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="AppControlPressedButtonFaceBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="AppControlPressedButtonFaceBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush" Color="Transparent"/>
<SolidColorBrush x:Key="AppControlPageTextBaseHighColorBrush" Color="{ThemeResource SystemColorWindowTextColor}"/>
<SolidColorBrush x:Key="OperatorPanelScrollButtonBackgroundBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="AppControlPageTextRedColorBrush" Color="{ThemeResource SystemColorWindowTextColor}"/>
<SolidColorBrush x:Key="AppControlForegroundTransparentRevealBorderBrush" Color="{ThemeResource SystemColorButtonTextColor}"/>
<SolidColorBrush x:Key="AppControlHighlightAccentRevealBackgroundBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="AppControlBackgroundListAccentHighRevealBackgroundBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="AppControlListLowRevealHighlightBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="AppChromeAcrylicHostBackdropMediumLowBrush" Color="{ThemeResource SystemColorWindowColor}"/>
<SolidColorBrush x:Key="AppChromeAcrylicOperatorFlyoutBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonBrush" Color="{ThemeResource SystemColorWindowColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonToggledBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="AppControlHighlightCalcButtonHoverBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
@ -116,6 +160,21 @@
<x:Double x:Key="PivotHeaderItemFontSize">15</x:Double>
<FontWeight x:Key="PivotHeaderItemThemeFontWeight">SemiBold</FontWeight>
<x:Double x:Key="OperatorPanelButtonRowSizeLarge">64</x:Double>
<x:Double x:Key="OperatorPanelFontSizeLarge">24</x:Double>
<x:Double x:Key="OperatorPanelGlyphFontSizeLarge">24</x:Double>
<x:Double x:Key="OperatorPanelChevronFontSizeLarge">16</x:Double>
<x:Double x:Key="OperatorPanelButtonRowSizeMedium">64</x:Double>
<x:Double x:Key="OperatorPanelFontSizeMedium">16</x:Double>
<x:Double x:Key="OperatorPanelGlyphFontSizeMedium">20</x:Double>
<x:Double x:Key="OperatorPanelChevronFontSizeMedium">10</x:Double>
<x:Double x:Key="OperatorPanelButtonRowSizeSmall">38</x:Double>
<x:Double x:Key="OperatorPanelFontSizeSmall">12</x:Double>
<x:Double x:Key="OperatorPanelGlyphFontSizeSmall">16</x:Double>
<x:Double x:Key="OperatorPanelChevronFontSizeSmall">8</x:Double>
<x:Double x:Key="CaptionFontSize">12</x:Double>
<x:Double x:Key="BodyFontSize">15</x:Double>
<x:Double x:Key="TitleFontSize">24</x:Double>
@ -125,13 +184,17 @@
<GridLength x:Key="HamburgerHeightGridLength">40</GridLength>
<x:Double x:Key="CalcButtonCaptionSize">34</x:Double>
<x:Double x:Key="CalcButtonTextIconCaptionSize">38</x:Double>
<x:Double x:Key="CalcStandardOperatorCaptionSizeExtraLarge">48</x:Double>
<x:Double x:Key="CalcStandardOperatorCaptionSizeLarge">24</x:Double>
<!-- Numpad Standard/Scientific in Fill/Full -->
<x:Double x:Key="CalcStandardOperatorCaptionSize">20</x:Double>
<x:Double x:Key="CalcStandardOperatorTextIconCaptionSize">22</x:Double>
<x:Double x:Key="CalcStandardOperatorCaptionSizeSmall">15</x:Double>
<x:Double x:Key="CalcStandardOperatorCaptionSizeTiny">12</x:Double>
<!-- Standard Operators Standard/Scientific in Fill/Full -->
<x:Double x:Key="CalcOperatorCaptionSize">15</x:Double>
<x:Double x:Key="CalcOperatorCaptionSize">14</x:Double>
<x:Double x:Key="CalcOperatorTextIconCaptionSize">16</x:Double>
<!-- Base style for calc buttons -->
<Style x:Key="CalcButtonStyle" TargetType="Controls:CalculatorButton">
@ -222,6 +285,11 @@
TargetType="Controls:CalculatorButton">
<Setter Property="FontSize" Value="12"/>
</Style>
<Style x:Key="NumericButtonStyle14"
BasedOn="{StaticResource NumericButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="FontSize" Value="14"/>
</Style>
<Style x:Key="NumericButtonStyle16"
BasedOn="{StaticResource NumericButtonStyle}"
TargetType="Controls:CalculatorButton">
@ -247,11 +315,28 @@
TargetType="Controls:CalculatorButton">
<Setter Property="FontSize" Value="34"/>
</Style>
<Style x:Key="NumericButtonStyle38"
BasedOn="{StaticResource NumericButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="FontSize" Value="38"/>
</Style>
<Style x:Key="NumericButtonStyle46"
BasedOn="{StaticResource NumericButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="FontSize" Value="46"/>
</Style>
<Style x:Key="NumericButtonStyle48"
BasedOn="{StaticResource NumericButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="FontSize" Value="48"/>
</Style>
<Style x:Key="SymbolOperatorKeypadButtonStyle"
BasedOn="{StaticResource NumericButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="FontFamily" Value="{StaticResource CalculatorFontFamily}"/>
<Setter Property="FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
</Style>
<Style x:Key="OperatorButtonStyle"
BasedOn="{StaticResource CalcButtonStyle}"
@ -337,13 +422,33 @@
</Setter>
</Style>
<Style x:Key="AccentCalcButtonStyle"
<Style x:Key="AccentEmphasizedCalcButtonStyle"
BasedOn="{StaticResource SymbolOperatorButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="HoverBackground" Value="{ThemeResource AppControlHighlightAccentRevealBackgroundBrush}"/>
<Setter Property="HoverForeground" Value="{ThemeResource SystemControlHighlightAltAltHighBrush}"/>
<Setter Property="PressBackground" Value="{ThemeResource AppControlBackgroundListAccentHighRevealBackgroundBrush}"/>
<Setter Property="PressForeground" Value="{ThemeResource SystemControlHighlightAltAltHighBrush}"/>
<Setter Property="HoverBackground" Value="{ThemeResource AppControlHighlightCalcButtonHoverBrush}"/>
<Setter Property="HoverForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="PressBackground" Value="{ThemeResource SystemControlHighlightAccentBrush}"/>
<Setter Property="PressForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Background" Value="{ThemeResource AppControlHighlightCalcButtonBrush}"/>
</Style>
<Style x:Key="EmphasizedCalcButtonStyle"
BasedOn="{StaticResource SymbolOperatorButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="HoverBackground" Value="{ThemeResource AppControlHighlightCalcButtonHoverBrush}"/>
<Setter Property="HoverForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="PressBackground" Value="{ThemeResource SystemControlHighlightAccentBrush}"/>
<Setter Property="PressForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
</Style>
<Style x:Key="AccentEmphasizedOperatorCalcButtonStyle"
BasedOn="{StaticResource OperatorButtonStyle}"
TargetType="Controls:CalculatorButton">
<Setter Property="HoverBackground" Value="{ThemeResource AppControlHighlightCalcButtonHoverBrush}"/>
<Setter Property="HoverForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="PressBackground" Value="{ThemeResource SystemControlHighlightAccentBrush}"/>
<Setter Property="PressForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Background" Value="{ThemeResource AppControlHighlightCalcButtonBrush}"/>
</Style>
<!-- RESULTS -->
@ -457,6 +562,124 @@
</Setter>
</Style>
<Style x:Key="OperatorPanelButtonStyle" TargetType="Controls:OperatorPanelButton">
<Setter Property="FontSize" Value="{StaticResource CaptionFontSize}"/>
<Setter Property="GlyphFontSize" Value="{StaticResource CaptionFontSize}"/>
<Setter Property="ChevronFontSize" Value="{StaticResource CaptionFontSize}"/>
<Setter Property="Padding" Value="8,0,8,0"/>
<Setter Property="MinWidth" Value="32"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundTransparentBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Controls:OperatorPanelButton">
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlHoverButtonFaceBrush}"/>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
<Setter Target="ContentPresenter.BorderThickness" Value="0"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedPointerOver">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedPressed">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedDisabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
<Setter Target="ContentPresenter.BorderThickness" Value="0"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="Sizing">
<VisualState x:Name="NormalSize">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}" MinWindowWidth="{StaticResource AppMinWindowWidth}"/>
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="SmallSize">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
</VisualState.StateTriggers>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
BorderBrush="{ThemeResource AppControlForegroundTransparentRevealBorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
FontSize="{TemplateBinding FontSize}"
FontWeight="Normal"
AutomationProperties.AccessibilityView="Raw"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}">
<StackPanel Orientation="Horizontal">
<FontIcon Margin="0,2,8,0"
VerticalAlignment="Center"
FontFamily="{StaticResource CalculatorFontFamily}"
FontSize="{TemplateBinding GlyphFontSize}"
Glyph="{TemplateBinding Glyph}"/>
<TextBlock x:Name="trigTextBlock"
VerticalAlignment="Center"
FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Text}"/>
<FontIcon Margin="8,4,0,0"
VerticalAlignment="Center"
FontFamily="{StaticResource CalculatorFontFamily}"
FontSize="{TemplateBinding ChevronFontSize}"
Glyph="&#xE70D;"/>
</StackPanel>
</ContentPresenter>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CaptionButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundTransparentBrush}"/>
@ -692,6 +915,99 @@
<Setter Property="MinHeight" Value="0"/>
</Style>
<Style x:Key="CaptionToggleEmphasizedButtonStyle"
BasedOn="{StaticResource CaptionToggleButtonStyle}"
TargetType="ToggleButton">
<Setter Property="Background" Value="{ThemeResource AppBackgroundAltMediumLowBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlHoverButtonFaceBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
<Setter Target="ContentPresenter.BorderThickness" Value="0"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlHighlightCalcButtonToggledBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedPointerOver">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlHighlightCalcButtonHoverBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedPressed">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
<Setter Target="RootGrid.Background" Value="{ThemeResource SystemControlHighlightAccentBrush}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedDisabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
<Setter Target="ContentPresenter.BorderThickness" Value="0"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="Sizing">
<VisualState x:Name="NormalSize">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}" MinWindowWidth="{StaticResource AppMinWindowWidth}"/>
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="SmallSize">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
</VisualState.StateTriggers>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Foreground="{TemplateBinding Foreground}"
BorderBrush="{ThemeResource AppControlForegroundTransparentRevealBorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
AutomationProperties.AccessibilityView="Raw"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ProgWordSizeButtonStyle"
BasedOn="{StaticResource CaptionButtonStyle}"
TargetType="Button">
@ -1086,6 +1402,147 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="OperatorPanelFlyoutStyle" TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="1"/>
<Setter Property="Background" Value="{ThemeResource AppChromeAcrylicOperatorFlyoutBackgroundBrush}"/>
<Setter Property="Margin" Value="0,-3,0,0"/>
<Setter Property="MaxWidth" Value="Infinity"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="FlyoutPresenter">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Controls:OperatorPanelListView">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="TabNavigation" Value="Once"/>
<Setter Property="IsSwipeEnabled" Value="True"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="SelectionMode" Value="None"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled"/>
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False"/>
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled"/>
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False"/>
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled"/>
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True"/>
<Setter Property="ItemContainerTransitions">
<Setter.Value>
<TransitionCollection>
<AddDeleteThemeTransition/>
<ContentThemeTransition/>
<ReorderThemeTransition/>
</TransitionCollection>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Height="Auto"
VerticalAlignment="Stretch"
Orientation="Horizontal"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListViewItem">
<Setter Property="MinHeight" Value="0"/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Controls:OperatorPanelListView">
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid x:Name="Grid">
<Grid.Resources>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="{ThemeResource OperatorPanelScrollButtonBackgroundColor}"/>
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="{ThemeResource OperatorPanelScrollButtonBackgroundColor}"/>
<SolidColorBrush x:Key="ButtonForegroundPointerOver" Color="{ThemeResource SystemAltMediumHighColor}"/>
<SolidColorBrush x:Key="ButtonBorderBrushPointerOver" Color="{ThemeResource SystemBaseMediumLowColor}"/>
<SolidColorBrush x:Key="ButtonForegroundPressed" Color="{ThemeResource SystemAltMediumHighColor}"/>
</Grid.Resources>
<Grid.ColumnDefinitions/>
<ScrollViewer x:Name="ScrollViewer"
AutomationProperties.AccessibilityView="Raw"
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}"
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}"
TabNavigation="{TemplateBinding TabNavigation}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">
<ItemsPresenter x:Name="Content"
Padding="{TemplateBinding Padding}"
Footer="{TemplateBinding Footer}"
FooterTemplate="{TemplateBinding FooterTemplate}"
FooterTransitions="{TemplateBinding FooterTransitions}"
Header="{TemplateBinding Header}"
HeaderTemplate="{TemplateBinding HeaderTemplate}"
HeaderTransitions="{TemplateBinding HeaderTransitions}"/>
</ScrollViewer>
<Button x:Name="ScrollLeft"
MinWidth="20"
Padding="0"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Background="{ThemeResource OperatorPanelScrollButtonBackgroundBrush}"
Foreground="{ThemeResource SystemAltMediumHighColor}"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Content="&#xE76B;"
IsTabStop="False"
Visibility="Collapsed"/>
<Button x:Name="ScrollRight"
MinWidth="20"
Padding="0"
HorizontalAlignment="Right"
VerticalAlignment="Stretch"
Background="{ThemeResource OperatorPanelScrollButtonBackgroundBrush}"
Foreground="{ThemeResource SystemAltMediumHighColor}"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Content="&#xE76C;"
IsTabStop="False"
Visibility="Collapsed"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

Binary file not shown.

View File

@ -247,6 +247,8 @@
<ClInclude Include="Converters\RadixToStringConverter.h" />
<ClInclude Include="Converters\VisibilityNegationConverter.h" />
<ClInclude Include="Controls\HorizontalNoOverflowStackPanel.h" />
<ClInclude Include="Controls\OperatorPanelListView.h" />
<ClInclude Include="Controls\OperatorPanelButton.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="App.xaml.h">
<DependentUpon>App.xaml</DependentUpon>
@ -294,6 +296,7 @@
<DependentUpon>Views\OperatorsPanel.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\StateTriggers\AspectRatioTrigger.h" />
<ClInclude Include="Views\StateTriggers\ControlSizeTrigger.h" />
<ClInclude Include="Views\SupplementaryResults.xaml.h">
<DependentUpon>Views\SupplementaryResults.xaml</DependentUpon>
</ClInclude>
@ -376,6 +379,8 @@
<ClCompile Include="Converters\RadixToStringConverter.cpp" />
<ClCompile Include="Converters\VisibilityNegationConverter.cpp" />
<ClCompile Include="Controls\HorizontalNoOverflowStackPanel.cpp" />
<ClCompile Include="Controls\OperatorPanelListView.cpp" />
<ClCompile Include="Controls\OperatorPanelButton.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@ -429,6 +434,7 @@
<DependentUpon>Views\OperatorsPanel.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\StateTriggers\AspectRatioTrigger.cpp" />
<ClCompile Include="Views\StateTriggers\ControlSizeTrigger.cpp" />
<ClCompile Include="Views\SupplementaryResults.xaml.cpp">
<DependentUpon>Views\SupplementaryResults.xaml</DependentUpon>
</ClCompile>

View File

@ -299,6 +299,15 @@
<Filter>Controls</Filter>
</ClCompile>
<ClCompile Include="Views\TitleBar.xaml.cpp" />
<ClCompile Include="Views\StateTriggers\ControlSizeTrigger.cpp">
<Filter>Views\StateTriggers</Filter>
</ClCompile>
<ClCompile Include="Controls\OperatorPanelListView.cpp">
<Filter>Controls</Filter>
</ClCompile>
<ClCompile Include="Controls\OperatorPanelButton.cpp">
<Filter>Controls</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
@ -379,7 +388,16 @@
<ClInclude Include="Controls\HorizontalNoOverflowStackPanel.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="Views\StateTriggers\ControlSizeTrigger.h">
<Filter>Views\StateTriggers</Filter>
</ClInclude>
<ClInclude Include="Views\TitleBar.xaml.h" />
<ClInclude Include="Controls\OperatorPanelListView.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="Controls\OperatorPanelButton.h">
<Filter>Controls</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />

View File

@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "OperatorPanelButton.h"
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Media;
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Controls;
DEPENDENCY_PROPERTY_INITIALIZATION(OperatorPanelButton, Text);
DEPENDENCY_PROPERTY_INITIALIZATION(OperatorPanelButton, Glyph);
DEPENDENCY_PROPERTY_INITIALIZATION(OperatorPanelButton, GlyphFontSize);
DEPENDENCY_PROPERTY_INITIALIZATION(OperatorPanelButton, ChevronFontSize);
DEPENDENCY_PROPERTY_INITIALIZATION(OperatorPanelButton, FlyoutMenu);
void OperatorPanelButton::OnApplyTemplate()
{
if (FlyoutMenu != nullptr)
{
FlyoutMenu->Closed += ref new EventHandler<Object ^>(this, &OperatorPanelButton::FlyoutClosed);
}
}
void OperatorPanelButton::OnToggle()
{
ToggleButton::OnToggle();
if (IsChecked)
{
FlyoutMenu->ShowAt(this);
}
}
void OperatorPanelButton::FlyoutClosed(Object ^ sender, Object ^ args)
{
IsChecked = false;
}

View File

@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "CalcViewModel/Common/Utils.h"
namespace CalculatorApp
{
namespace Controls
{
public
ref class OperatorPanelButton sealed : Windows::UI::Xaml::Controls::Primitives::ToggleButton
{
public:
OperatorPanelButton()
{
}
DEPENDENCY_PROPERTY_OWNER(OperatorPanelButton);
DEPENDENCY_PROPERTY(Platform::String^, Text);
DEPENDENCY_PROPERTY(Platform::String^, Glyph);
DEPENDENCY_PROPERTY(double, GlyphFontSize);
DEPENDENCY_PROPERTY(double, ChevronFontSize);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Controls::Flyout^, FlyoutMenu);
protected:
virtual void OnApplyTemplate() override;
virtual void OnToggle() override;
private:
void FlyoutClosed(Platform::Object^ sender, Platform::Object^ args);
};
}
}

View File

@ -0,0 +1,147 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "OperatorPanelListView.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Controls;
using namespace Platform;
using namespace std;
using namespace Windows::Foundation;
using namespace Windows::Devices::Input;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Controls;
OperatorPanelListView::OperatorPanelListView()
{
}
void OperatorPanelListView::OnApplyTemplate()
{
m_scrollViewer = dynamic_cast<ScrollViewer^>(GetTemplateChild("ScrollViewer"));
m_scrollLeft = dynamic_cast<Button^>(GetTemplateChild("ScrollLeft"));
m_scrollRight = dynamic_cast<Button^>(GetTemplateChild("ScrollRight"));
m_content = dynamic_cast<ItemsPresenter^>(GetTemplateChild("Content"));
if (m_scrollLeft != nullptr)
{
m_scrollLeft->Click += ref new RoutedEventHandler(this, &OperatorPanelListView::OnScrollClick);
m_scrollLeft->PointerExited += ref new PointerEventHandler(this, &OperatorPanelListView::OnButtonPointerExited);
}
if (m_scrollRight != nullptr)
{
m_scrollRight->Click += ref new RoutedEventHandler(this, &OperatorPanelListView::OnScrollClick);
m_scrollRight->PointerExited += ref new PointerEventHandler(this, &OperatorPanelListView::OnButtonPointerExited);
}
if (m_scrollViewer != nullptr)
{
m_scrollViewer->ViewChanged += ref new EventHandler<ScrollViewerViewChangedEventArgs^>(this, &OperatorPanelListView::ScrollViewChanged);
}
this->PointerEntered += ref new PointerEventHandler(this, &OperatorPanelListView::OnPointerEntered);
this->PointerExited += ref new PointerEventHandler(this, &OperatorPanelListView::OnPointerExited);
ListView::OnApplyTemplate();
}
void OperatorPanelListView::ScrollViewChanged(_In_ Object^, _In_ ScrollViewerViewChangedEventArgs^ e)
{
if (m_isPointerEntered && !e->IsIntermediate)
{
UpdateScrollButtons();
}
}
void OperatorPanelListView::OnScrollClick(_In_ Object^ sender, _In_ RoutedEventArgs^)
{
auto clicked = dynamic_cast<Button^>(sender);
if (clicked == m_scrollLeft)
{
ScrollLeft();
}
else
{
ScrollRight();
}
}
void OperatorPanelListView::OnButtonPointerExited(_In_ Object^ sender, _In_ PointerRoutedEventArgs^ e)
{
auto button = dynamic_cast<Button^>(sender);
// Do not bubble up the pointer exit event to the control if the button being exited was not visible
if (button->Visibility == ::Visibility::Collapsed)
{
e->Handled = true;
}
}
void OperatorPanelListView::OnPointerEntered(_In_ Object^ sender, _In_ PointerRoutedEventArgs^ e)
{
if (e->Pointer->PointerDeviceType == PointerDeviceType::Mouse)
{
UpdateScrollButtons();
m_isPointerEntered = true;
}
}
void OperatorPanelListView::OnPointerExited(_In_ Object^ sender, _In_ PointerRoutedEventArgs^ e)
{
m_scrollLeft->Visibility = ::Visibility::Collapsed;
m_scrollRight->Visibility = ::Visibility::Collapsed;
m_isPointerEntered = false;
}
void OperatorPanelListView::ScrollLeft()
{
double offset = m_scrollViewer->HorizontalOffset - (scrollRatio * m_scrollViewer->ViewportWidth);
m_scrollViewer->ChangeView(offset, nullptr, nullptr);
}
void OperatorPanelListView::ScrollRight()
{
double offset = m_scrollViewer->HorizontalOffset + (scrollRatio * m_scrollViewer->ViewportWidth);
m_scrollViewer->ChangeView(offset, nullptr, nullptr);
}
void OperatorPanelListView::UpdateScrollButtons()
{
if (m_content == nullptr || m_scrollViewer == nullptr)
{
return;
}
// When the width is smaller than the container, don't show any
if (m_content->ActualWidth <= m_scrollViewer->ActualWidth)
{
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Collapsed);
}
// We have more number on both side. Show both arrows
else if ((m_scrollViewer->HorizontalOffset > 0) && (m_scrollViewer->HorizontalOffset < (m_scrollViewer->ExtentWidth - m_scrollViewer->ViewportWidth)))
{
ShowHideScrollButtons(::Visibility::Visible, ::Visibility::Visible);
}
// Width is larger than the container and left most part of the number is shown. Should be able to scroll left.
else if (m_scrollViewer->HorizontalOffset == 0)
{
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Visible);
}
else // Width is larger than the container and right most part of the number is shown. Should be able to scroll left.
{
ShowHideScrollButtons(::Visibility::Visible, ::Visibility::Collapsed);
}
}
void OperatorPanelListView::ShowHideScrollButtons(::Visibility vLeft, ::Visibility vRight)
{
if (m_scrollLeft != nullptr && m_scrollRight != nullptr)
{
m_scrollLeft->Visibility = vLeft;
m_scrollRight->Visibility = vRight;
}
}

View File

@ -0,0 +1,43 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "CalcViewModel/Common/Utils.h"
namespace CalculatorApp
{
namespace Controls
{
public
ref class OperatorPanelListView sealed : public Windows::UI::Xaml::Controls::ListView
{
public:
OperatorPanelListView();
protected:
virtual void OnApplyTemplate() override;
private:
void OnScrollClick(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
void OnPointerEntered(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void OnPointerExited(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void OnButtonPointerExited(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void ScrollViewChanged(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ args);
void ShowHideScrollButtons(Windows::UI::Xaml::Visibility vLeft, Windows::UI::Xaml::Visibility vRight);
void UpdateScrollButtons();
void ScrollLeft();
void ScrollRight();
double scrollRatio = 0.7;
bool m_isPointerEntered;
Windows::UI::Xaml::Controls::ItemsPresenter^ m_content;
Windows::UI::Xaml::Controls::ScrollViewer^ m_scrollViewer;
Windows::UI::Xaml::Controls::Button^ m_scrollLeft;
Windows::UI::Xaml::Controls::Button^ m_scrollRight;
};
}
}

View File

@ -449,12 +449,12 @@
<value>^</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="rolButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>J</value>
<data name="rolButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>&lt;</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="rorButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>K</value>
<data name="rorButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>&gt;</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="decimalButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
@ -3363,6 +3363,114 @@
<value>inverse hyperbolic tangent</value>
<comment>Name for the inverse hyperbolic tangent function. Used by screen readers.</comment>
</data>
<data name="SecantDegrees" xml:space="preserve">
<value>secant degrees</value>
<comment>Name for the secant function in degrees mode. Used by screen readers.</comment>
</data>
<data name="SecantRadians" xml:space="preserve">
<value>secant radians</value>
<comment>Name for the secant function in radians mode. Used by screen readers.</comment>
</data>
<data name="SecantGradians" xml:space="preserve">
<value>secant gradians</value>
<comment>Name for the secant function in gradians mode. Used by screen readers.</comment>
</data>
<data name="InverseSecantDegrees" xml:space="preserve">
<value>inverse secant degrees</value>
<comment>Name for the inverse secant function in degrees mode. Used by screen readers.</comment>
</data>
<data name="InverseSecantRadians" xml:space="preserve">
<value>inverse secant radians</value>
<comment>Name for the inverse secant function in radians mode. Used by screen readers.</comment>
</data>
<data name="InverseSecantGradians" xml:space="preserve">
<value>inverse secant gradians</value>
<comment>Name for the inverse secant function in gradians mode. Used by screen readers.</comment>
</data>
<data name="HyperbolicSecant" xml:space="preserve">
<value>hyperbolic secant</value>
<comment>Name for the hyperbolic secant function. Used by screen readers.</comment>
</data>
<data name="InverseHyperbolicSecant" xml:space="preserve">
<value>inverse hyperbolic secant</value>
<comment>Name for the inverse hyperbolic secant function. Used by screen readers.</comment>
</data>
<data name="CosecantDegrees" xml:space="preserve">
<value>cosecant degrees</value>
<comment>Name for the cosecant function in degrees mode. Used by screen readers.</comment>
</data>
<data name="CosecantRadians" xml:space="preserve">
<value>cosecant radians</value>
<comment>Name for the cosecant function in radians mode. Used by screen readers.</comment>
</data>
<data name="CosecantGradians" xml:space="preserve">
<value>cosecant gradians</value>
<comment>Name for the cosecant function in gradians mode. Used by screen readers.</comment>
</data>
<data name="InverseCosecantDegrees" xml:space="preserve">
<value>inverse cosecant degrees</value>
<comment>Name for the inverse cosecant function in degrees mode. Used by screen readers.</comment>
</data>
<data name="InverseCosecantRadians" xml:space="preserve">
<value>inverse cosecant radians</value>
<comment>Name for the inverse cosecant function in radians mode. Used by screen readers.</comment>
</data>
<data name="InverseCosecantGradians" xml:space="preserve">
<value>inverse cosecant gradians</value>
<comment>Name for the inverse cosecant function in gradians mode. Used by screen readers.</comment>
</data>
<data name="HyperbolicCosecant" xml:space="preserve">
<value>hyperbolic cosecant</value>
<comment>Name for the hyperbolic cosecant function. Used by screen readers.</comment>
</data>
<data name="InverseHyperbolicCosecant" xml:space="preserve">
<value>inverse hyperbolic cosecant</value>
<comment>Name for the inverse hyperbolic cosecant function. Used by screen readers.</comment>
</data>
<data name="CotangentDegrees" xml:space="preserve">
<value>cotangent degrees</value>
<comment>Name for the cotangent function in degrees mode. Used by screen readers.</comment>
</data>
<data name="CotangentRadians" xml:space="preserve">
<value>Cotangent radians</value>
<comment>Name for the cotangent function in radians mode. Used by screen readers.</comment>
</data>
<data name="CotangentGradians" xml:space="preserve">
<value>cotangent gradians</value>
<comment>Name for the cotangent function in gradians mode. Used by screen readers.</comment>
</data>
<data name="InverseCotangentDegrees" xml:space="preserve">
<value>inverse cotangent degrees</value>
<comment>Name for the inverse cotangent function in degrees mode. Used by screen readers.</comment>
</data>
<data name="InverseCotangentRadians" xml:space="preserve">
<value>inverse cotangent radians</value>
<comment>Name for the inverse cotangent function in radians mode. Used by screen readers.</comment>
</data>
<data name="InverseCotangentGradians" xml:space="preserve">
<value>inverse cotangent gradians</value>
<comment>Name for the inverse cotangent function in gradians mode. Used by screen readers.</comment>
</data>
<data name="HyperbolicCotangent" xml:space="preserve">
<value>hyperbolic cotangent</value>
<comment>Name for the hyperbolic cotangent function. Used by screen readers.</comment>
</data>
<data name="InverseHyperbolicCotangent" xml:space="preserve">
<value>inverse hyperbolic cotangent</value>
<comment>Name for the inverse hyperbolic cotangent function. Used by screen readers.</comment>
</data>
<data name="CubeRoot" xml:space="preserve">
<value>Cube Root</value>
<comment>Name for the cube root function. Used by screen readers.</comment>
</data>
<data name="Logx" xml:space="preserve">
<value>Base Log</value>
<comment>Name for the logbasex function. Used by screen readers.</comment>
</data>
<data name="AbsoluteValue" xml:space="preserve">
<value>Absolute Value</value>
<comment>Name for the absolute value function. Used by screen readers.</comment>
</data>
<data name="LeftShift" xml:space="preserve">
<value>left shift</value>
<comment>Name for the programmer function that shifts bits to the left. Used by screen readers.</comment>
@ -3425,7 +3533,319 @@
</data>
<data name="CalculationFailed" xml:space="preserve">
<value>Calculation failed</value>
<comment>Text displayed when the application is not able to do a calculation</comment>
<comment>Text displayed when the application is not able to do a calculation</comment>
</data>
<data name="logBaseX.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Log base X</value>
<comment>Screen reader prompt for the logBaseX button</comment>
</data>
<data name="logBaseX.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyShiftChord" xml:space="preserve">
<value>L</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="trigButton.Text" xml:space="preserve">
<value>Trigonometry</value>
<comment>Displayed on the button that contains a flyout for the trig functions in scientific mode.</comment>
</data>
<data name="funcButton.Text" xml:space="preserve">
<value>Function</value>
<comment>Displayed on the button that contains a flyout for the general functions in scientific mode.</comment>
</data>
<data name="bitwiseButton.Text" xml:space="preserve">
<value>Bitwise</value>
<comment>Displayed on the button that contains a flyout for the bitwise functions in programmer mode.</comment>
</data>
<data name="bitShiftButton.Text" xml:space="preserve">
<value>Bit Shift</value>
<comment>Displayed on the button that contains a flyout for the bit shift functions in programmer mode.</comment>
</data>
<data name="trigShiftButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Inverse Function</value>
<comment>Screen Reader prompt for the shift button in the trig flyout in scientific mode.</comment>
</data>
<data name="hypButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic function</value>
<comment>Screen reader prompt for the Calculator button HYP in the scientific flyout keypad</comment>
</data>
<data name="secButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Secant</value>
<comment>Screen reader prompt for the Calculator button sec in the scientific flyout keypad</comment>
</data>
<data name="secButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>U</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="sechButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic Secant</value>
<comment>Screen reader prompt for the Calculator button sech in the scientific flyout keypad</comment>
</data>
<data name="sechButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlChord" xml:space="preserve">
<value>U</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="invsecButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Arc Secant</value>
<comment>Screen reader prompt for the Calculator button arc sec in the scientific flyout keypad</comment>
</data>
<data name="invsecButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyShiftChord" xml:space="preserve">
<value>U</value>
<comment>{Locked}The shortcut for the inverted sec button</comment>
</data>
<data name="invsecButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyInverseChord" xml:space="preserve">
<value>U</value>
<comment>{Locked}The shortcut for the inverted sec button</comment>
</data>
<data name="invsechButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic Arc Secant</value>
<comment>Screen reader prompt for the Calculator button arc sec in the scientific flyout keypad</comment>
</data>
<data name="invsechButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlShiftChord" xml:space="preserve">
<value>U</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="invsechButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlInverseChord" xml:space="preserve">
<value>U</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="cscButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Cosecant</value>
<comment>Screen reader prompt for the Calculator button csc in the scientific flyout keypad</comment>
</data>
<data name="cscButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>I</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="cschButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic Cosecant</value>
<comment>Screen reader prompt for the Calculator button csch in the scientific flyout keypad</comment>
</data>
<data name="cschButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlChord" xml:space="preserve">
<value>I</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="invcscButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Arc Cosecant</value>
<comment>Screen reader prompt for the Calculator button arc csc in the scientific flyout keypad</comment>
</data>
<data name="invcscButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyShiftChord" xml:space="preserve">
<value>I</value>
<comment>{Locked}The shortcut for the inverted sec button</comment>
</data>
<data name="invcscButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyInverseChord" xml:space="preserve">
<value>I</value>
<comment>{Locked}The shortcut for the inverted sec button</comment>
</data>
<data name="invcschButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic Arc Cosecant</value>
<comment>Screen reader prompt for the Calculator button arc csc in the scientific flyout keypad</comment>
</data>
<data name="invcschButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlShiftChord" xml:space="preserve">
<value>I</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="invcschButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlInverseChord" xml:space="preserve">
<value>I</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="cotButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Cotangent</value>
<comment>Screen reader prompt for the Calculator button cot in the scientific flyout keypad</comment>
</data>
<data name="cotButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>J</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="cothButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic Cotangent</value>
<comment>Screen reader prompt for the Calculator button coth in the scientific flyout keypad</comment>
</data>
<data name="cothButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlChord" xml:space="preserve">
<value>J</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="invcotButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Arc Cotangent</value>
<comment>Screen reader prompt for the Calculator button arc cot in the scientific flyout keypad</comment>
</data>
<data name="invcotButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyShiftChord" xml:space="preserve">
<value>J</value>
<comment>{Locked}The shortcut for the inverted sec button</comment>
</data>
<data name="invcotButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyInverseChord" xml:space="preserve">
<value>J</value>
<comment>{Locked}The shortcut for the inverted sec button</comment>
</data>
<data name="invcothButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hyperbolic Arc Cotangent</value>
<comment>Screen reader prompt for the Calculator button arc coth in the scientific flyout keypad</comment>
</data>
<data name="invcothButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlInverseChord" xml:space="preserve">
<value>J</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="invcothButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyControlShiftChord" xml:space="preserve">
<value>J</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="floorButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Floor</value>
<comment>Screen reader prompt for the Calculator button floor in the scientific flyout keypad</comment>
</data>
<data name="floorButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>[</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="ceilButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Ceiling</value>
<comment>Screen reader prompt for the Calculator button ceiling in the scientific flyout keypad</comment>
</data>
<data name="ceilButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>]</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="randButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Random</value>
<comment>Screen reader prompt for the Calculator button random in the scientific flyout keypad</comment>
</data>
<data name="randButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyShiftChord" xml:space="preserve">
<value>R</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="absButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Absolute Value</value>
<comment>Screen reader prompt for the Calculator button abs in the scientific flyout keypad</comment>
</data>
<data name="absButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>|</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="eulerButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Euler's number</value>
<comment>Screen reader prompt for the Calculator button e in the scientific flyout keypad</comment>
</data>
<data name="eulerButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKeyShiftChord" xml:space="preserve">
<value>E</value>
<comment>{Locked}The shortcut for the inverted sech button</comment>
</data>
<data name="twoPowerXButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Two to the exponent</value>
<comment>Screen reader prompt for the Calculator button 2^x in the scientific flyout keypad</comment>
</data>
<data name="twoPowerXButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>G</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="nandButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Nand</value>
<comment>Screen reader prompt for the Calculator button nand in the scientific flyout keypad</comment>
</data>
<data name="nandButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>.</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="nandButton.[using:CalculatorApp.Controls]CalculatorButton.AuditoryFeedback" xml:space="preserve">
<value>Nand</value>
<comment>Auditory feedback for Screen Reader users. Users will hear "Display is 7 nand" when the button is pressed. NAND is a mathematical operation on two binary values.</comment>
</data>
<data name="norButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Nor</value>
<comment>Screen reader prompt for the Calculator button nor in the scientific flyout keypad</comment>
</data>
<data name="norButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>\</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="norButton.[using:CalculatorApp.Controls]CalculatorButton.AuditoryFeedback" xml:space="preserve">
<value>Nor</value>
<comment>Auditory feedback for Screen Reader users. Users will hear "Display is 7 nor" when the button is pressed. NAND is a mathematical operation on two binary values.</comment>
</data>
<data name="rolCarryButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Rotate on left with carry</value>
<comment>Screen reader prompt for the Calculator button rol with carry in the scientific flyout keypad</comment>
</data>
<data name="rolCarryButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>&lt;</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="rorCarryButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Rotate on right with carry</value>
<comment>Screen reader prompt for the Calculator button ror with carry in the scientific flyout keypad</comment>
</data>
<data name="rorCarryButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>&gt;</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="lshLogicalButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Left Shift</value>
<comment>Screen reader prompt for the Calculator button lshLogical in the scientific flyout keypad</comment>
</data>
<data name="lshLogicalButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>&lt;</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="lshLogicalButton.[using:CalculatorApp.Controls]CalculatorButton.AuditoryFeedback" xml:space="preserve">
<value>Left shift</value>
<comment>Auditory feedback for Screen Reader users. Users will hear "Display is 7 left shift" when the button is pressed. NAND is a mathematical operation on two binary values.</comment>
</data>
<data name="rshLogicalButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Right Shift</value>
<comment>Screen reader prompt for the Calculator button rshLogical in the scientific flyout keypad</comment>
</data>
<data name="rshLogicalButton.[using:CalculatorApp.Common]KeyboardShortcutManager.Character" xml:space="preserve">
<value>&gt;</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="rshLogicalButton.[using:CalculatorApp.Controls]CalculatorButton.AuditoryFeedback" xml:space="preserve">
<value>Right shift</value>
<comment>Auditory feedback for Screen Reader users. Users will hear "Display is 7 right shift" when the button is pressed. NAND is a mathematical operation on two binary values.</comment>
</data>
<data name="arithmeticShiftButton.Content" xml:space="preserve">
<value>Arithmetic Shift</value>
<comment>Label for a radio button that toggles arithmetic shift behavior for the shift operations.</comment>
</data>
<data name="logicalShiftButton.Content" xml:space="preserve">
<value>Logical Shift</value>
<comment>Label for a radio button that toggles logical shift behavior for the shift operations.</comment>
</data>
<data name="rotateCircularButton.Content" xml:space="preserve">
<value>Rotate Circular Shift</value>
<comment>Label for a radio button that toggles rotate circular behavior for the shift operations.</comment>
</data>
<data name="rotateCarryShiftButton.Content" xml:space="preserve">
<value>Rotate Through Carry Circular Shift</value>
<comment>Label for a radio button that toggles rotate circular with carry behavior for the shift operations.</comment>
</data>
<data name="cubeRootButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Cube root</value>
<comment>Screen reader prompt for the cube root button on the scientific operator keypad</comment>
</data>
<data name="cubeRootButton.[using:CalculatorApp.Common]KeyboardShortcutManager.VirtualKey" xml:space="preserve">
<value>B</value>
<comment>{Locked}This is the character that should trigger this button. Note that it is a character and not a key, so it does not come from the Windows::System::VirtualKey enum.</comment>
</data>
<data name="trigButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Trigonometry</value>
<comment>Screen reader prompt for the square root button on the scientific operator keypad</comment>
</data>
<data name="funcButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Functions</value>
<comment>Screen reader prompt for the square root button on the scientific operator keypad</comment>
</data>
<data name="bitwiseButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Bitwise</value>
<comment>Screen reader prompt for the square root button on the scientific operator keypad</comment>
</data>
<data name="bitShiftButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Bitshift</value>
<comment>Screen reader prompt for the square root button on the scientific operator keypad</comment>
</data>
<data name="ScientificOperatorPanel.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scientific Operator Panels</value>
<comment>Screen reader prompt for the Scientific Operator Panels on the scientific operator keypad</comment>
</data>
<data name="ProgrammerOperatorPanel.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Programmer Operator Panels</value>
<comment>Screen reader prompt for the Programmer Operator Panels on the programmer operator keypad</comment>
</data>
<data name="MostSignificantBit" xml:space="preserve">
<value>most significant bit</value>

View File

@ -11,6 +11,8 @@
#include "Controls/CalculatorButton.h"
#include "Controls/CalculationResult.h"
#include "Controls/OverflowTextBlock.h"
#include "Controls/OperatorPanelListView.h"
#include "Controls/OperatorPanelButton.h"
#include "CalcViewModel/HistoryViewModel.h"
#include "Views/CalculatorProgrammerDisplayPanel.xaml.h"
#include "Views/CalculatorProgrammerOperators.xaml.h"
@ -18,6 +20,7 @@
#include "Views/HistoryList.xaml.h"
#include "Views/Memory.xaml.h"
#include "Views/OperatorsPanel.xaml.h"
#include "Views/StateTriggers/ControlSizeTrigger.h"
namespace CalculatorApp
{

View File

@ -1,18 +1,28 @@
<UserControl x:Class="CalculatorApp.CalculatorProgrammerRadixOperators"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Windows10version1803="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract, 7)"
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
xmlns:common="using:CalculatorApp.Common"
xmlns:controls="using:CalculatorApp.Controls"
xmlns:converters="using:CalculatorApp.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:CalculatorApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:triggers="using:CalculatorApp.Views.StateTriggers"
x:Name="ControlRoot"
d:DesignHeight="395"
d:DesignWidth="315"
XYFocusKeyboardNavigation="Enabled"
mc:Ignorable="d">
<UserControl.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<converters:BooleanToVisibilityNegationConverter x:Key="BooleanToVisibilityNegationConverter"/>
</UserControl.Resources>
<Grid x:Name="ProgRadixOps">
<Grid.RowDefinitions>
<RowDefinition x:Name="OperatorPanelRow" Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
@ -27,7 +37,6 @@
<ColumnDefinition x:Name="C2" Width="1*"/>
<ColumnDefinition x:Name="C3" Width="1*"/>
<ColumnDefinition x:Name="C4" Width="1*"/>
<ColumnDefinition x:Name="C5" Width="1*"/>
<ColumnDefinition x:Name="GutterRight" Width="0"/>
</Grid.ColumnDefinitions>
@ -45,7 +54,6 @@
<Setter Target="NotButton.IsEnabled" Value="False"/>
<Setter Target="AndButton.IsEnabled" Value="False"/>
<Setter Target="ShiftButton.IsEnabled" Value="False"/>
<Setter Target="ModButton.IsEnabled" Value="False"/>
<Setter Target="DivideButton.IsEnabled" Value="False"/>
@ -56,180 +64,489 @@
<Setter Target="OpenParenthesisButton.IsEnabled" Value="False"/>
<Setter Target="CloseParenthesisButton.IsEnabled" Value="False"/>
<Setter Target="NegateButton.IsEnabled" Value="False"/>
<Setter Target="BitShiftButton.IsEnabled" Value="False"/>
<Setter Target="BitwiseButton.IsEnabled" Value="False"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup>
<VisualState x:Name="Portrait768x1366">
<VisualState x:Name="Large">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="1366" MinWindowWidth="768"/>
<triggers:ControlSizeTrigger MinWidth="1053"
MinHeight="729"
Source="{x:Bind ProgRadixOps}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="AButton.Style" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="BButton.Style" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="CButton.Style" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="DButton.Style" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="EButton.Style" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="FButton.Style" Value="{StaticResource NumericButtonStyle38}"/>
<Setter Target="ModButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="OpenParenthesisButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="CloseParenthesisButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="AndButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="OrButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="XorButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="NandButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="NorButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="RolButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="RorButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="RolCarryButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="RorCarryButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="LshButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="RshButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="LshLogicalButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="RshLogicalButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="NotButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="OperatorPanelRow.MinHeight" Value="{StaticResource OperatorPanelButtonRowSizeLarge}"/>
<Setter Target="BitwiseButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeLarge}"/>
<Setter Target="BitwiseButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeLarge}"/>
<Setter Target="BitwiseButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeLarge}"/>
<Setter Target="BitShiftButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeLarge}"/>
<Setter Target="BitShiftButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeLarge}"/>
<Setter Target="BitShiftButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeLarge}"/>
<Setter Target="BitwiseGrid.MinWidth" Value="387"/>
<Setter Target="BitwiseGrid.MinHeight" Value="192"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Medium">
<VisualState.StateTriggers>
<triggers:ControlSizeTrigger MinWidth="630"
MinHeight="437"
Source="{x:Bind ProgRadixOps}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="AButton.Style" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="BButton.Style" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="CButton.Style" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="DButton.Style" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="EButton.Style" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="FButton.Style" Value="{StaticResource NumericButtonStyle24}"/>
<Setter Target="ModButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="OpenParenthesisButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="CloseParenthesisButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="AndButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="OrButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XorButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NandButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NorButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="RolButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="RorButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="RolCarryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="RorCarryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="LshButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="RshButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="LshLogicalButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="RshLogicalButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NotButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="OperatorPanelRow.MinHeight" Value="{StaticResource OperatorPanelButtonRowSizeMedium}"/>
<Setter Target="BitwiseButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeMedium}"/>
<Setter Target="BitwiseButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeMedium}"/>
<Setter Target="BitwiseButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeMedium}"/>
<Setter Target="BitShiftButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeMedium}"/>
<Setter Target="BitShiftButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeMedium}"/>
<Setter Target="BitShiftButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeMedium}"/>
<Setter Target="BitwiseGrid.MinWidth" Value="416"/>
<Setter Target="BitwiseGrid.MinHeight" Value="144"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Small">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}" MinWindowWidth="{StaticResource AppMinWindowWidth}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle18}"/>
<Setter Target="AButton.Style" Value="{StaticResource NumericButtonStyle14}"/>
<Setter Target="BButton.Style" Value="{StaticResource NumericButtonStyle14}"/>
<Setter Target="CButton.Style" Value="{StaticResource NumericButtonStyle14}"/>
<Setter Target="DButton.Style" Value="{StaticResource NumericButtonStyle14}"/>
<Setter Target="EButton.Style" Value="{StaticResource NumericButtonStyle14}"/>
<Setter Target="FButton.Style" Value="{StaticResource NumericButtonStyle14}"/>
<Setter Target="ModButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="OpenParenthesisButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="CloseParenthesisButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="AButton.FontSize" Value="{StaticResource TitleFontSize}"/>
<Setter Target="BButton.FontSize" Value="{StaticResource TitleFontSize}"/>
<Setter Target="CButton.FontSize" Value="{StaticResource TitleFontSize}"/>
<Setter Target="DButton.FontSize" Value="{StaticResource TitleFontSize}"/>
<Setter Target="EButton.FontSize" Value="{StaticResource TitleFontSize}"/>
<Setter Target="FButton.FontSize" Value="{StaticResource TitleFontSize}"/>
<Setter Target="AndButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="OrButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="XorButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NandButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NorButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="RolButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="RorButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="RolCarryButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="RorCarryButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="LshButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="RshButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="LshLogicalButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="RshLogicalButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NotButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="FullLayout">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="768" MinWindowWidth="1024"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="MinSizeLayout">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}" MinWindowWidth="{StaticResource AppMinWindowWidth}"/>
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="DefaultLayout">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="OpenParenthesisButton.FontSize" Value="12"/>
<Setter Target="OpenParenthesisButton.Padding" Value="0"/>
<Setter Target="CloseParenthesisButton.FontSize" Value="12"/>
<Setter Target="CloseParenthesisButton.Padding" Value="0"/>
<Setter Target="OperatorPanelRow.MinHeight" Value="{StaticResource OperatorPanelButtonRowSizeSmall}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="AButton.Style" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="BButton.Style" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="CButton.Style" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="DButton.Style" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="EButton.Style" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="FButton.Style" Value="{StaticResource NumericButtonStyle12}"/>
<Setter Target="BitwiseButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeSmall}"/>
<Setter Target="BitwiseButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeSmall}"/>
<Setter Target="BitwiseButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeSmall}"/>
<Setter Target="ShiftButton.Style" Value="{StaticResource CaptionToggleButtonSmallStyle}"/>
<Setter Target="BitShiftButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeSmall}"/>
<Setter Target="BitShiftButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeSmall}"/>
<Setter Target="BitShiftButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeSmall}"/>
<Setter Target="BitwiseGrid.MinWidth" Value="194"/>
<Setter Target="BitwiseGrid.MinHeight" Value="96"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<controls:OperatorPanelListView x:Uid="ProgrammerOperatorPanel"
Grid.ColumnSpan="6"
Background="{ThemeResource AppOperatorPanelBackground}"
AutomationProperties.HeadingLevel="Level1">
<controls:OperatorPanelButton x:Name="BitwiseButton"
x:Uid="bitwiseButton"
Style="{StaticResource OperatorPanelButtonStyle}"
AutomationProperties.AutomationId="bitwiseButton"
Glyph="&#xF895;">
<controls:OperatorPanelButton.FlyoutMenu>
<Flyout x:Name="BitwiseFlyout"
Windows10version1803:Placement="Bottom"
Windows10version1809:AreOpenCloseAnimationsEnabled="False"
Windows10version1809:Placement="BottomEdgeAlignedLeft"
FlyoutPresenterStyle="{ThemeResource OperatorPanelFlyoutStyle}">
<Grid x:Name="BitwiseGrid"
MinWidth="258"
MinHeight="96"
XYFocusKeyboardNavigation="Enabled">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--
Because of the way we handle keyboard shortcuts, the IsEnabled property must be bound to a button outside the flyout.
This is because the content from within the Flyout do not inherit the IsEnabled property of the flyout parent,
causing the shortcut keys to be used when the control would normally be disabled.
-->
<controls:CalculatorButton x:Name="AndButton"
x:Uid="andButton"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="andButton"
ButtonId="And"
Click="FlyoutButton_Clicked"
Command="{x:Bind Model.ButtonPressed}"
Content="AND"
IsEnabled="{x:Bind BitwiseButton.IsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="OrButton"
x:Uid="orButton"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="orButton"
ButtonId="Or"
Click="FlyoutButton_Clicked"
Command="{x:Bind Model.ButtonPressed}"
Content="OR"
IsEnabled="{x:Bind BitwiseButton.IsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="NotButton"
x:Uid="notButton"
Grid.Column="2"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="notButton"
ButtonId="Not"
Click="FlyoutButton_Clicked"
Command="{x:Bind Model.ButtonPressed}"
Content="NOT"
IsEnabled="{x:Bind BitwiseButton.IsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="XorButton"
x:Uid="xorButton"
Grid.Row="1"
Grid.Column="2"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="xorButton"
ButtonId="Xor"
Click="FlyoutButton_Clicked"
Command="{x:Bind Model.ButtonPressed}"
Content="XOR"
IsEnabled="{x:Bind BitwiseButton.IsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="NandButton"
x:Uid="nandButton"
Grid.Row="1"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="nandButton"
ButtonId="Nand"
Click="FlyoutButton_Clicked"
Command="{x:Bind Model.ButtonPressed}"
Content="NAND"
IsEnabled="{x:Bind BitwiseButton.IsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="NorButton"
x:Uid="norButton"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="norButton"
ButtonId="Nor"
Click="FlyoutButton_Clicked"
Command="{x:Bind Model.ButtonPressed}"
Content="NOR"
IsEnabled="{x:Bind BitwiseButton.IsEnabled, Mode=OneWay}"/>
</Grid>
</Flyout>
</controls:OperatorPanelButton.FlyoutMenu>
</controls:OperatorPanelButton>
<controls:OperatorPanelButton x:Name="BitShiftButton"
x:Uid="bitShiftButton"
Style="{StaticResource OperatorPanelButtonStyle}"
AutomationProperties.AutomationId="bitShiftButton"
Glyph="&#xE301;">
<controls:OperatorPanelButton.FlyoutMenu>
<Flyout x:Name="BitShiftFlyout"
Windows10version1809:AreOpenCloseAnimationsEnabled="False"
FlyoutPresenterStyle="{ThemeResource OperatorPanelFlyoutStyle}"
Placement="Bottom">
<StackPanel MaxWidth="192" Padding="12">
<RadioButton x:Name="ArithmeticShiftButton"
x:Uid="arithmeticShiftButton"
AutomationProperties.AutomationId="arithmeticShiftButton"
Checked="BitshiftFlyout_Checked"
IsChecked="True"/>
<RadioButton x:Name="LogicalShiftButton"
x:Uid="logicalShiftButton"
AutomationProperties.AutomationId="logicalShiftButton"
Checked="BitshiftFlyout_Checked"/>
<RadioButton x:Name="RotateCircularButton"
x:Uid="rotateCircularButton"
AutomationProperties.AutomationId="rotateCircularButton"
Checked="BitshiftFlyout_Checked"/>
<RadioButton x:Name="RotateCarryShiftButton"
x:Uid="rotateCarryShiftButton"
AutomationProperties.AutomationId="rotateCarryShiftButton"
Checked="BitshiftFlyout_Checked"/>
</StackPanel>
</Flyout>
</controls:OperatorPanelButton.FlyoutMenu>
</controls:OperatorPanelButton>
</controls:OperatorPanelListView>
<Grid x:Uid="ProgrammerOperators"
Grid.Column="1"
Grid.ColumnSpan="6"
Grid.Row="1"
Grid.Column="2"
Grid.ColumnSpan="2"
AutomationProperties.HeadingLevel="Level1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<controls:CalculatorButton x:Name="RolButton"
x:Uid="rolButton"
Grid.Column="0"
Style="{StaticResource OperatorButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
x:DeferLoadStrategy="Lazy"
AutomationProperties.AutomationId="rolButton"
ButtonId="Rol"
Content="RoL"
Content="&#xF88E;"
Visibility="Collapsed"/>
<controls:CalculatorButton x:Name="RorButton"
x:Uid="rorButton"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
x:DeferLoadStrategy="Lazy"
AutomationProperties.AutomationId="rorButton"
ButtonId="Ror"
Content="RoR"
Content="&#xF88F;"
Visibility="Collapsed"/>
<controls:CalculatorButton x:Name="RolCarryButton"
x:Uid="rolCarryButton"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
x:DeferLoadStrategy="Lazy"
AutomationProperties.AutomationId="rolButton"
ButtonId="RolC"
Content="&#xF88E;"
Visibility="Collapsed"/>
<controls:CalculatorButton x:Name="RorCarryButton"
x:Uid="rorCarryButton"
Grid.Column="1"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
x:DeferLoadStrategy="Lazy"
AutomationProperties.AutomationId="rorCarryButton"
ButtonId="RorC"
Content="&#xF88F;"
Visibility="Collapsed"/>
<controls:CalculatorButton x:Name="LshButton"
x:Uid="lshButton"
Grid.Column="0"
Style="{StaticResource OperatorButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="lshButton"
ButtonId="Lsh"
Content="Lsh"/>
Content="&#xF88E;"/>
<controls:CalculatorButton x:Name="RshButton"
x:Uid="rshButton"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="rshButton"
ButtonId="Rsh"
Content="Rsh"/>
<controls:CalculatorButton x:Name="OrButton"
x:Uid="orButton"
Grid.Column="2"
Style="{StaticResource OperatorButtonStyle}"
Content="&#xF88F;"/>
<controls:CalculatorButton x:Name="LshLogicalButton"
x:Uid="LshLogicalButton"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="orButton"
ButtonId="Or"
Content="Or"/>
<controls:CalculatorButton x:Name="XorButton"
x:Uid="xorButton"
Grid.Column="3"
Style="{StaticResource OperatorButtonStyle}"
x:DeferLoadStrategy="Lazy"
AutomationProperties.AutomationId="lshLogicalButton"
ButtonId="Lsh"
Content="&#xF88E;"
Visibility="Collapsed"/>
<controls:CalculatorButton x:Name="RshLogicalButton"
x:Uid="rshLogicalButton"
Grid.Column="1"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="xorButton"
ButtonId="Xor"
Content="Xor"/>
<controls:CalculatorButton x:Name="NotButton"
x:Uid="notButton"
Grid.Column="4"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="notButton"
ButtonId="Not"
Content="Not"/>
<controls:CalculatorButton x:Name="AndButton"
x:Uid="andButton"
Grid.Column="5"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="andButton"
ButtonId="And"
Content="And"/>
x:DeferLoadStrategy="Lazy"
AutomationProperties.AutomationId="rshLogicalButton"
ButtonId="RshL"
Content="&#xF88F;"
Visibility="Collapsed"/>
</Grid>
<ToggleButton x:Name="ShiftButton"
x:Uid="shiftButton"
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Style="{StaticResource CaptionToggleButtonStyle}"
FontFamily="{StaticResource CalculatorFontFamily}"
FontSize="16"
AutomationProperties.AutomationId="shiftButton"
Checked="Shift_Clicked"
Content="&#xF897;"
Unchecked="Shift_Clicked"/>
<Grid x:Uid="DisplayControls"
Grid.Row="1"
Grid.Column="4"
Grid.ColumnSpan="2"
AutomationProperties.HeadingLevel="Level1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<controls:CalculatorButton x:Name="ClearButton"
x:Uid="clearButton"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="clearButton"
ButtonId="Clear"
Content="C"
Visibility="{x:Bind Model.IsInputEmpty, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<controls:CalculatorButton x:Name="ClearEntryButton"
x:Uid="clearEntryButton"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="clearEntryButton"
ButtonId="ClearEntry"
Content="CE"
Visibility="{x:Bind Model.IsInputEmpty, Mode=OneWay, Converter={StaticResource BooleanToVisibilityNegationConverter}}"/>
<controls:CalculatorButton x:Name="BackSpaceButton"
x:Uid="backSpaceButton"
Grid.Column="1"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="backSpaceButton"
ButtonId="Backspace"
Content="&#xE94F;"/>
</Grid>
<controls:CalculatorButton x:Name="OpenParenthesisButton"
x:Uid="openParenthesisButton"
Grid.Row="2"
Grid.Column="2"
Style="{StaticResource ParenthesisCalcButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="openParenthesisButton"
ButtonId="OpenParenthesis"
Content="("
GotFocus="OpenParenthesisButton_GotFocus"
Tag="{x:Bind ParenthesisCountToString(Model.OpenParenthesisCount), Mode=OneWay}"/>
<controls:CalculatorButton x:Name="CloseParenthesisButton"
x:Uid="closeParenthesisButton"
Grid.Row="2"
Grid.Column="3"
Style="{StaticResource OperatorButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="closeParenthesisButton"
ButtonId="CloseParenthesis"
Content=")"/>
<controls:CalculatorButton x:Name="ModButton"
x:Uid="modButton"
Grid.Row="1"
Grid.Column="2"
Grid.Row="2"
Grid.Column="4"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="modButton"
ButtonId="Mod"
Content="Mod"/>
Content="%"/>
<Grid x:Uid="StandardOperators"
Grid.Row="1"
Grid.Row="2"
Grid.RowSpan="5"
Grid.Column="6"
Grid.Column="5"
AutomationProperties.HeadingLevel="Level1">
<Grid.RowDefinitions>
<RowDefinition/>
@ -241,86 +558,52 @@
<controls:CalculatorButton x:Name="DivideButton"
x:Uid="divideButton"
Grid.Row="0"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="divideButton"
ButtonId="Divide"
Content="&#xE94A;"/>
<controls:CalculatorButton x:Name="MultiplyButton"
x:Uid="multiplyButton"
Grid.Row="1"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="multiplyButton"
ButtonId="Multiply"
Content="&#xE947;"/>
<controls:CalculatorButton x:Name="MinusButton"
x:Uid="minusButton"
Grid.Row="2"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="minusButton"
ButtonId="Subtract"
Content="&#xE949;"/>
<controls:CalculatorButton x:Name="PlusButton"
x:Uid="plusButton"
Grid.Row="3"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="plusButton"
ButtonId="Add"
Content="&#xE948;"/>
<controls:CalculatorButton x:Name="EqualButton"
x:Uid="equalButton"
Grid.Row="4"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource AccentEmphasizedCalcButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="equalButton"
ButtonId="Equals"
Content="&#xE94E;"/>
</Grid>
<Grid x:Uid="DisplayControls"
Grid.Row="1"
Grid.Column="3"
Grid.ColumnSpan="3"
AutomationProperties.HeadingLevel="Level1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<controls:CalculatorButton x:Name="ClearEntryButton"
x:Uid="clearEntryButton"
Grid.Column="0"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
FontWeight="SemiBold"
AutomationProperties.AutomationId="clearEntryButton"
ButtonId="ClearEntry"
Content="CE"/>
<controls:CalculatorButton x:Name="ClearButton"
x:Uid="clearButton"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
FontSize="12"
FontWeight="SemiBold"
AutomationProperties.AutomationId="clearButton"
ButtonId="Clear"
Content="C"/>
<controls:CalculatorButton x:Name="BackSpaceButton"
x:Uid="backSpaceButton"
Grid.Column="2"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="12"
AutomationProperties.AutomationId="backSpaceButton"
ButtonId="Backspace"
Content="&#xE94F;"/>
</Grid>
<Grid x:Uid="NumberPad"
Grid.Row="2"
Grid.RowSpan="4"
Grid.Row="1"
Grid.RowSpan="6"
Grid.Column="1"
Grid.ColumnSpan="5"
AutomationProperties.AutomationId="NumberPad"
@ -330,6 +613,8 @@
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@ -338,13 +623,6 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<local:NumberPad x:Name="NumberPad"
Grid.RowSpan="4"
Grid.Column="2"
Grid.ColumnSpan="3"
ButtonStyle="{StaticResource NumericButtonStyle18}"
CurrentRadixType="{x:Bind Model.CurrentRadixType, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="AButton"
x:Uid="aButton"
Grid.Row="0"
@ -354,79 +632,73 @@
ButtonId="A"
Content="A"
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="BButton"
x:Uid="bButton"
Grid.Row="0"
Grid.Column="1"
Grid.Row="1"
Grid.Column="0"
Style="{StaticResource NumericButtonStyle12}"
AutomationProperties.AutomationId="bButton"
ButtonId="B"
Content="B"
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="CButton"
x:Uid="cButton"
Grid.Row="1"
Grid.Row="2"
Grid.Column="0"
Style="{StaticResource NumericButtonStyle12}"
AutomationProperties.AutomationId="cButton"
ButtonId="C"
Content="C"
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="DButton"
x:Uid="dButton"
Grid.Row="1"
Grid.Column="1"
Grid.Row="3"
Grid.Column="0"
Style="{StaticResource NumericButtonStyle12}"
AutomationProperties.AutomationId="dButton"
ButtonId="D"
Content="D"
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="EButton"
x:Uid="eButton"
Grid.Row="2"
Grid.Row="4"
Grid.Column="0"
Style="{StaticResource NumericButtonStyle12}"
AutomationProperties.AutomationId="eButton"
ButtonId="E"
Content="E"
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}"/>
<controls:CalculatorButton x:Name="FButton"
x:Uid="fButton"
Grid.Row="2"
Grid.Column="1"
Grid.Row="5"
Grid.Column="0"
Style="{StaticResource NumericButtonStyle12}"
AutomationProperties.AutomationId="fButton"
ButtonId="F"
Content="F"
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}"/>
<local:NumberPad x:Name="NumberPad"
Grid.Row="2"
Grid.RowSpan="4"
Grid.Column="1"
Grid.ColumnSpan="3"
ButtonStyle="{StaticResource NumericButtonStyle18}"
CurrentRadixType="{x:Bind Model.CurrentRadixType, Mode=OneWay}"/>
</Grid>
<controls:CalculatorButton x:Name="OpenParenthesisButton"
x:Uid="openParenthesisButton"
Grid.Row="5"
Grid.Column="1"
Style="{StaticResource ParenthesisCalcButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="openParenthesisButton"
ButtonId="OpenParenthesis"
Content="("
GotFocus="OpenParenthesisButton_GotFocus"
Tag="{x:Bind ParenthesisCountToString(Model.OpenParenthesisCount), Mode=OneWay}"/>
<controls:CalculatorButton x:Name="CloseParenthesisButton"
x:Uid="closeParenthesisButton"
Grid.Row="5"
Grid.Column="2"
Style="{StaticResource OperatorButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="closeParenthesisButton"
ButtonId="CloseParenthesis"
Content=")"/>
<controls:CalculatorButton x:Name="NegateButton"
x:Uid="negateButton"
Grid.Row="5"
Grid.Column="3"
Style="{StaticResource SymbolOperatorButtonStyle}"
Grid.Row="6"
Grid.Column="2"
Style="{StaticResource SymbolOperatorKeypadButtonStyle}"
FontSize="12"
FontWeight="Normal"
AutomationProperties.AutomationId="negateButton"
ButtonId="Negate"
Content="&#xF898;"/>

View File

@ -29,32 +29,92 @@ CalculatorProgrammerRadixOperators::CalculatorProgrammerRadixOperators()
InitializeComponent();
}
void CalculatorProgrammerRadixOperators::Shift_Clicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
void CalculatorProgrammerRadixOperators::FlyoutButton_Clicked(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
{
bool isShiftChecked = static_cast<ToggleButton ^>(sender)->IsChecked->Value;
auto scvm = safe_cast<StandardCalculatorViewModel ^>(this->DataContext);
scvm->IsShiftProgrammerChecked = isShiftChecked;
this->BitwiseFlyout->Hide();
}
void CalculatorProgrammerRadixOperators::checkDefaultBitShift()
{
this->ArithmeticShiftButton->IsChecked = true;
}
void CalculatorProgrammerRadixOperators::BitshiftFlyout_Checked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
{
// Load deferred load buttons
if (RolButton == nullptr)
{
FindName("RolButton");
FindName("RorButton");
FindName("RolCarryButton");
FindName("RorCarryButton");
FindName("LshLogicalButton");
FindName("RshLogicalButton");
}
if (isShiftChecked)
// Since arithmeticShiftButton defaults to IsChecked = true, this event an fire before we can load the deferred loaded controls. If that is the case, just return and do nothing.
if (RolButton == nullptr || RorButton == nullptr || RolCarryButton == nullptr || RorCarryButton == nullptr || LshLogicalButton == nullptr
|| RshLogicalButton == nullptr)
{
return;
}
CollapseBitshiftButtons();
auto radioButton = static_cast<RadioButton^>(sender);
if (radioButton == ArithmeticShiftButton)
{
LshButton->Visibility = ::Visibility::Visible;
RshButton->Visibility = ::Visibility::Visible;
LshButton->IsEnabled = true;
RshButton->IsEnabled = true;
}
else if (radioButton == LogicalShiftButton)
{
LshLogicalButton->Visibility = ::Visibility::Visible;
RshLogicalButton->Visibility = ::Visibility::Visible;
LshLogicalButton->IsEnabled = true;
RshLogicalButton->IsEnabled = true;
}
else if (radioButton == RotateCircularButton)
{
RolButton->Visibility = ::Visibility::Visible;
RorButton->Visibility = ::Visibility::Visible;
LshButton->Visibility = ::Visibility::Collapsed;
RshButton->Visibility = ::Visibility::Collapsed;
RolButton->IsEnabled = true;
RorButton->IsEnabled = true;
}
else
else if (radioButton == RotateCarryShiftButton)
{
RolButton->Visibility = ::Visibility::Collapsed;
RorButton->Visibility = ::Visibility::Collapsed;
LshButton->Visibility = ::Visibility::Visible;
RshButton->Visibility = ::Visibility::Visible;
RolCarryButton->Visibility = ::Visibility::Visible;
RorCarryButton->Visibility = ::Visibility::Visible;
RolCarryButton->IsEnabled = true;
RorCarryButton->IsEnabled = true;
}
this->BitShiftFlyout->Hide();
}
void CalculatorProgrammerRadixOperators::CollapseBitshiftButtons()
{
RolButton->Visibility = ::Visibility::Collapsed;
RorButton->Visibility = ::Visibility::Collapsed;
RolCarryButton->Visibility = ::Visibility::Collapsed;
RorCarryButton->Visibility = ::Visibility::Collapsed;
LshButton->Visibility = ::Visibility::Collapsed;
RshButton->Visibility = ::Visibility::Collapsed;
LshLogicalButton->Visibility = ::Visibility::Collapsed;
RshLogicalButton->Visibility = ::Visibility::Collapsed;
// We need to set the collapsed buttons to disabled so that the KeyboardShortcutManager can skip the keybinds for the disabled buttons
RolButton->IsEnabled = false;
RorButton->IsEnabled = false;
RolCarryButton->IsEnabled = false;
RorCarryButton->IsEnabled = false;
LshButton->IsEnabled = false;
RshButton->IsEnabled = false;
LshLogicalButton->IsEnabled = false;
RshLogicalButton->IsEnabled = false;
}
bool CalculatorProgrammerRadixOperators::IsErrorVisualState::get()

View File

@ -30,8 +30,12 @@ namespace CalculatorApp
DEPENDENCY_PROPERTY_OWNER(CalculatorProgrammerRadixOperators);
void checkDefaultBitShift();
private:
void Shift_Clicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
void BitshiftFlyout_Checked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
void FlyoutButton_Clicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void CollapseBitshiftButtons();
bool m_isErrorVisualState;
void OpenParenthesisButton_GotFocus(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);

View File

@ -47,8 +47,6 @@
<Setter Target="DegreeButton.Style" Value="{StaticResource CaptionButtonSmallStyle}"/>
<Setter Target="RadianButton.Style" Value="{StaticResource CaptionButtonSmallStyle}"/>
<Setter Target="GradsButton.Style" Value="{StaticResource CaptionButtonSmallStyle}"/>
<Setter Target="HyperbolicButton.Style" Value="{StaticResource CaptionToggleButtonSmallStyle}"/>
<Setter Target="FtoeButton.Style" Value="{StaticResource CaptionToggleButtonSmallStyle}"/>
</VisualState.Setters>
</VisualState>
@ -60,7 +58,6 @@
<Setter Target="DegreeButton.IsEnabled" Value="False"/>
<Setter Target="RadianButton.IsEnabled" Value="False"/>
<Setter Target="GradsButton.IsEnabled" Value="False"/>
<Setter Target="HyperbolicButton.IsEnabled" Value="False"/>
<Setter Target="FtoeButton.IsEnabled" Value="False"/>
</VisualState.Setters>
</VisualState>
@ -89,20 +86,9 @@
CommandParameter="2"
Content="GRAD"
Visibility="Collapsed"/>
<ToggleButton x:Name="HyperbolicButton"
x:Uid="hyperbolicButton"
Grid.Column="1"
Style="{StaticResource CaptionToggleButtonStyle}"
Background="{ThemeResource SystemControlBackgroundTransparentBrush}"
FontWeight="SemiBold"
AutomationProperties.AutomationId="hyperbolicButton"
Checked="HypButton_Toggled"
Content="HYP"
IsChecked="{Binding IsHyperbolicChecked, Mode=TwoWay}"
Unchecked="HypButton_Toggled"/>
<ToggleButton x:Name="FtoeButton"
x:Uid="ftoeButton"
Grid.Column="2"
Grid.Column="1"
Style="{StaticResource CaptionToggleButtonStyle}"
Background="{ThemeResource SystemControlBackgroundTransparentBrush}"
FontWeight="SemiBold"

View File

@ -35,10 +35,6 @@ CalculatorScientificAngleButtons::CalculatorScientificAngleButtons()
InitializeComponent();
}
void CalculatorScientificAngleButtons::HypButton_Toggled(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)
{
}
void CalculatorScientificAngleButtons::FToEButton_Toggled(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)
{
auto viewModel = safe_cast<StandardCalculatorViewModel ^>(this->DataContext);

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.
//
@ -35,7 +35,6 @@ namespace CalculatorApp
private:
void OnAngleButtonPressed(_In_ Platform::Object ^ commandParameter);
void FToEButton_Toggled(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void HypButton_Toggled(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
bool m_isErrorVisualState;
};

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@
#include "pch.h"
#include "CalculatorScientificOperators.xaml.h"
#include "CalcViewModel/Common/KeyboardShortcutManager.h"
#include "CalcViewModel/Common/TraceLogger.h"
#include "Controls/CalculatorButton.h"
#include "CalcViewModel/StandardCalculatorViewModel.h"
@ -20,6 +21,8 @@ using namespace std;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Core;
using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
@ -27,30 +30,15 @@ using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::UI::Core;
DEPENDENCY_PROPERTY_INITIALIZATION(CalculatorScientificOperators, IsErrorVisualState);
DEPENDENCY_PROPERTY_INITIALIZATION(CalculatorScientificOperators, IsWideLayout);
CalculatorScientificOperators::CalculatorScientificOperators()
{
InitializeComponent();
ExpButton->SetValue(Common::KeyboardShortcutManager::VirtualKeyProperty, Common::MyVirtualKey::E);
Common::KeyboardShortcutManager::ShiftButtonChecked(false);
}
void CalculatorScientificOperators::ShortLayout_Completed(_In_ Platform::Object ^ /*sender*/, _In_ Platform::Object ^ /*e*/)
{
IsWideLayout = false;
SetOperatorRowVisibility();
Common::KeyboardShortcutManager::ShiftButtonChecked(Model->IsShiftChecked);
}
void CalculatorScientificOperators::WideLayout_Completed(_In_ Platform::Object ^ /*sender*/, _In_ Platform::Object ^ /*e*/)
{
IsWideLayout = true;
SetOperatorRowVisibility();
Common::KeyboardShortcutManager::ShiftButtonChecked(Model->IsShiftChecked);
}
void CalculatorScientificOperators::OnIsErrorVisualStatePropertyChanged(bool /*oldValue*/, bool newValue)
@ -60,31 +48,75 @@ void CalculatorScientificOperators::OnIsErrorVisualStatePropertyChanged(bool /*o
NumberPad->IsErrorVisualState = newValue;
}
void CalculatorScientificOperators::shiftButton_Check(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
void CalculatorScientificOperators::ShiftButton_Check(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
{
bool isChecked = ShiftButton->IsChecked->Value;
Model->IsShiftChecked = isChecked;
Common::KeyboardShortcutManager::ShiftButtonChecked(isChecked);
SetOperatorRowVisibility();
}
void CalculatorScientificOperators::shiftButton_IsEnabledChanged(
void CalculatorScientificOperators::ShiftButton_Uncheck(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
{
ShiftButton->IsChecked = false;
SetOperatorRowVisibility();
ShiftButton->Focus(::FocusState::Programmatic);
}
void CalculatorScientificOperators::TrigFlyoutShift_Toggle(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
{
SetTrigRowVisibility();
}
void CalculatorScientificOperators::TrigFlyoutHyp_Toggle(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
{
SetTrigRowVisibility();
}
void CalculatorScientificOperators::FlyoutButton_Clicked(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
{
this->HypButton->IsChecked = false;
this->TrigShiftButton->IsChecked = false;
this->Trigflyout->Hide();
this->FuncFlyout->Hide();
}
void CalculatorScientificOperators::ShiftButton_IsEnabledChanged(
_In_ Platform::Object ^ /*sender*/,
_In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ /*e*/)
{
SetOperatorRowVisibility();
Common::KeyboardShortcutManager::ShiftButtonChecked(ShiftButton->IsEnabled && ShiftButton->IsChecked->Value);
}
void CalculatorScientificOperators::SetTrigRowVisibility()
{
bool isShiftChecked = TrigShiftButton->IsChecked->Value;
bool isHypeChecked = HypButton->IsChecked->Value;
InverseHyperbolicTrigFunctions->Visibility = ::Visibility::Collapsed;
InverseTrigFunctions->Visibility = ::Visibility::Collapsed;
HyperbolicTrigFunctions->Visibility = ::Visibility::Collapsed;
TrigFunctions->Visibility = ::Visibility::Collapsed;
if (isShiftChecked && isHypeChecked)
{
InverseHyperbolicTrigFunctions->Visibility = ::Visibility::Visible;
}
else if (isShiftChecked && !isHypeChecked)
{
InverseTrigFunctions->Visibility = ::Visibility::Visible;
}
else if (!isShiftChecked && isHypeChecked)
{
HyperbolicTrigFunctions->Visibility = ::Visibility::Visible;
}
else
{
TrigFunctions->Visibility = ::Visibility::Visible;
}
}
void CalculatorScientificOperators::SetOperatorRowVisibility()
{
::Visibility rowVis, invRowVis;
if (IsWideLayout)
{
rowVis = ::Visibility::Visible;
invRowVis = ::Visibility::Visible;
}
else if (ShiftButton->IsChecked->Value)
if (ShiftButton->IsChecked->Value)
{
rowVis = ::Visibility::Collapsed;
invRowVis = ::Visibility::Visible;
@ -96,9 +128,7 @@ void CalculatorScientificOperators::SetOperatorRowVisibility()
}
Row1->Visibility = rowVis;
Row2->Visibility = rowVis;
InvRow1->Visibility = invRowVis;
InvRow2->Visibility = invRowVis;
}
void CalculatorScientificOperators::OpenParenthesisButton_GotFocus(Object ^ sender, RoutedEventArgs ^ e)

View File

@ -29,21 +29,19 @@ namespace CalculatorApp
DEPENDENCY_PROPERTY_OWNER(CalculatorScientificOperators);
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(bool, IsErrorVisualState, false);
DEPENDENCY_PROPERTY_WITH_DEFAULT(bool, IsWideLayout, false);
bool IsShiftEnabled(bool isWideLayout, bool isErrorState)
{
return !(isWideLayout || isErrorState);
}
void OpenParenthesisButton_GotFocus(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
Platform::String ^ ParenthesisCountToString(unsigned int count);
private:
void ShortLayout_Completed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
void WideLayout_Completed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
void OnIsErrorVisualStatePropertyChanged(bool oldValue, bool newValue);
void shiftButton_Check(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void shiftButton_IsEnabledChanged(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ e);
void ShiftButton_Check(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void ShiftButton_Uncheck(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void TrigFlyoutShift_Toggle(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void TrigFlyoutHyp_Toggle(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void FlyoutButton_Clicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void ShiftButton_IsEnabledChanged(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ e);
void SetOperatorRowVisibility();
void SetTrigRowVisibility();
};
}

View File

@ -6,7 +6,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:CalculatorApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:triggers="using:CalculatorApp.Views.StateTriggers"
x:Name="ControlRoot"
XYFocusKeyboardNavigation="Enabled"
mc:Ignorable="d">
<Grid x:Name="Root">
@ -36,7 +38,6 @@
<Setter Target="PercentButton.IsEnabled" Value="False"/>
<Setter Target="SquareRootButton.IsEnabled" Value="False"/>
<Setter Target="XPower2Button.IsEnabled" Value="False"/>
<Setter Target="XPower3Button.IsEnabled" Value="False"/>
<Setter Target="InvertButton.IsEnabled" Value="False"/>
<Setter Target="DivideButton.IsEnabled" Value="False"/>
<Setter Target="MultiplyButton.IsEnabled" Value="False"/>
@ -47,37 +48,77 @@
</VisualState>
</VisualStateGroup>
<VisualStateGroup>
<VisualState x:Name="NormalFontSize">
<VisualState x:Name="Large">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="440" MinWindowWidth="0"/>
<triggers:ControlSizeTrigger MinWidth="780"
MinHeight="814"
Source="{x:Bind Root}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="SquareRootButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="XPower2Button.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="InvertButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="NegateButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="ClearEntryButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
<Setter Target="ClearButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
<Setter Target="BackSpaceButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="DivideButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="MultiplyButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="MinusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="PlusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="EqualButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcButtonCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle38}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Medium">
<VisualState.StateTriggers>
<triggers:ControlSizeTrigger MinWidth="468"
MinHeight="500"
Source="{x:Bind Root}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="SmallFontSize">
<VisualState x:Name="Small">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="260" MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle18}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="TinyFontSize">
<VisualState x:Name="Tiny">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
</VisualState.StateTriggers>
@ -101,239 +142,81 @@
</VisualState>
</VisualStateGroup>
<VisualStateGroup>
<VisualState x:Name="Portrait768x1366">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="1366" MinWindowWidth="768"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower3Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle46}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Landscape13InchLaptop">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="768" MinWindowWidth="1366"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="C0.Width" Value="1*"/>
<Setter Target="R0.Height" Value="0"/>
<Setter Target="StandardFunctions.(Grid.Row)" Value="1"/>
<Setter Target="StandardFunctions.(Grid.Column)" Value="1"/>
<Setter Target="StandardFunctions.(Grid.RowSpan)" Value="5"/>
<Setter Target="StandardFunctions.(Grid.ColumnSpan)" Value="1"/>
<Setter Target="FnR1.Height" Value="1*"/>
<Setter Target="FnR2.Height" Value="1*"/>
<Setter Target="FnR3.Height" Value="1*"/>
<Setter Target="FnR4.Height" Value="1*"/>
<Setter Target="FnC1.Width" Value="0"/>
<Setter Target="FnC2.Width" Value="0"/>
<Setter Target="FnC3.Width" Value="0"/>
<Setter Target="SquareRootButton.(Grid.Row)" Value="1"/>
<Setter Target="SquareRootButton.(Grid.Column)" Value="0"/>
<Setter Target="XPower2Button.(Grid.Row)" Value="2"/>
<Setter Target="XPower2Button.(Grid.Column)" Value="0"/>
<Setter Target="XPower3Button.Visibility" Value="Visible"/>
<Setter Target="InvertButton.(Grid.Row)" Value="4"/>
<Setter Target="InvertButton.(Grid.Column)" Value="0"/>
<Setter Target="NegateButton.(Grid.Row)" Value="5"/>
<Setter Target="NegateButton.(Grid.Column)" Value="2"/>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle34}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Landscape8InchTab">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="640" MinWindowWidth="1024"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="C0.Width" Value="1*"/>
<Setter Target="R0.Height" Value="0"/>
<Setter Target="StandardFunctions.(Grid.Row)" Value="1"/>
<Setter Target="StandardFunctions.(Grid.Column)" Value="1"/>
<Setter Target="StandardFunctions.(Grid.RowSpan)" Value="5"/>
<Setter Target="StandardFunctions.(Grid.ColumnSpan)" Value="1"/>
<Setter Target="FnR1.Height" Value="1*"/>
<Setter Target="FnR2.Height" Value="1*"/>
<Setter Target="FnR3.Height" Value="1*"/>
<Setter Target="FnR4.Height" Value="1*"/>
<Setter Target="FnC1.Width" Value="0"/>
<Setter Target="FnC2.Width" Value="0"/>
<Setter Target="FnC3.Width" Value="0"/>
<Setter Target="SquareRootButton.(Grid.Row)" Value="1"/>
<Setter Target="SquareRootButton.(Grid.Column)" Value="0"/>
<Setter Target="XPower2Button.(Grid.Row)" Value="2"/>
<Setter Target="XPower2Button.(Grid.Column)" Value="0"/>
<Setter Target="XPower3Button.Visibility" Value="Visible"/>
<Setter Target="InvertButton.(Grid.Row)" Value="4"/>
<Setter Target="InvertButton.(Grid.Column)" Value="0"/>
<Setter Target="NegateButton.(Grid.Row)" Value="5"/>
<Setter Target="NegateButton.(Grid.Column)" Value="2"/>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower3Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle28}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Portrait8InchTab">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="1024" MinWindowWidth="640"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower3Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle28}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Portrait6InchPhone">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="854" MinWindowWidth="480"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle34}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Portrait5InchPhone">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="640" MinWindowWidth="360"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle28}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="MinSizeLayout">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}" MinWindowWidth="{StaticResource AppMinWindowWidth}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="PercentButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="SquareRootButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="XPower2Button.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="InvertButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="NegateButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="ClearEntryButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
<Setter Target="ClearButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
<Setter Target="BackSpaceButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="DivideButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="MultiplyButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="MinusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="PlusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="EqualButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
<Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="ShowStandardFunctions">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="394" MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="R0.Height" Value="1*"/>
<Setter Target="R1.Height" Value="1*"/>
<Setter Target="StandardFunctions.Visibility" Value="Visible"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="DefaultLayout">
<VisualState x:Name="HideStandardFunctions">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="R0.Height" Value="0*"/>
<Setter Target="R1.Height" Value="0*"/>
<Setter Target="StandardFunctions.Visibility" Value="Collapsed"/>
<Setter Target="PercentButton.Visibility" Value="Collapsed"/>
<Setter Target="PercentColumn.Width" Value="0"/>
<Setter Target="DisplayControls.Column" Value="1"/>
<Setter Target="DisplayControls.ColumnSpan" Value="4"/>
<Setter Target="StandardOperators.Row" Value="0"/>
<Setter Target="StandardOperators.RowSpan" Value="6"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="DisplayControls"
x:Uid="DisplayControls"
Grid.Row="0"
Grid.Column="2"
Grid.ColumnSpan="4"
AutomationProperties.HeadingLevel="Level1">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="PercentColumn"/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<controls:CalculatorButton x:Name="PercentButton"
x:Uid="percentButton"
Grid.Column="0"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="percentButton"
ButtonId="Percent"
Content="&#xE94C;"/>
<controls:CalculatorButton x:Name="ClearEntryButton"
x:Uid="clearEntryButton"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
FontSize="16"
AutomationProperties.AutomationId="clearEntryButton"
ButtonId="ClearEntry"
Content="CE"/>
<controls:CalculatorButton x:Name="ClearButton"
x:Uid="clearButton"
Grid.Column="2"
Style="{StaticResource OperatorButtonStyle}"
FontSize="16"
AutomationProperties.AutomationId="clearButton"
ButtonId="Clear"
Content="C"/>
<controls:CalculatorButton x:Name="BackSpaceButton"
x:Uid="backSpaceButton"
Grid.Column="3"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="16"
AutomationProperties.AutomationId="backSpaceButton"
ButtonId="Backspace"
Content="&#xE94F;"/>
</Grid>
<Grid x:Name="StandardFunctions"
x:Uid="StandardFunctions"
Grid.Row="0"
Grid.Row="1"
Grid.Column="2"
Grid.ColumnSpan="4"
AutomationProperties.HeadingLevel="Level1">
@ -350,45 +233,28 @@
<ColumnDefinition x:Name="FnC2" Width="1*"/>
<ColumnDefinition x:Name="FnC3" Width="1*"/>
</Grid.ColumnDefinitions>
<controls:CalculatorButton x:Name="PercentButton"
x:Uid="percentButton"
Grid.Column="0"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="percentButton"
ButtonId="Percent"
Content="&#xE94C;"/>
<controls:CalculatorButton x:Name="SquareRootButton"
x:Uid="squareRootButton"
Grid.Column="1"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="squareRootButton"
ButtonId="Sqrt"
Content="&#xF899;"/>
<controls:CalculatorButton x:Name="XPower2Button"
x:Uid="xpower2Button"
Grid.Column="2"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="xpower2Button"
ButtonId="XPower2"
Content="&#xf7c8;"/>
<controls:CalculatorButton x:Name="XPower3Button"
x:Uid="xpower3Button"
Grid.Row="3"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="xpower3Button"
ButtonId="Cube"
Content="&#xf7cb;"
Visibility="Collapsed"/>
<controls:CalculatorButton x:Name="InvertButton"
x:Uid="invertButton"
Grid.Column="3"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="invertButton"
ButtonId="Invert"
Content="&#xf7c9;"/>
<controls:CalculatorButton x:Name="XPower2Button"
x:Uid="xpower2Button"
Grid.Column="1"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="18"
AutomationProperties.AutomationId="xpower2Button"
ButtonId="XPower2"
Content="&#xf7c8;"/>
<controls:CalculatorButton x:Name="SquareRootButton"
x:Uid="squareRootButton"
Grid.Column="2"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="squareRootButton"
ButtonId="Sqrt"
Content="&#xF899;"/>
</Grid>
<Grid x:Name="StandardOperators"
@ -407,77 +273,40 @@
<controls:CalculatorButton x:Name="DivideButton"
x:Uid="divideButton"
Grid.Row="0"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="divideButton"
ButtonId="Divide"
Content="&#xE94A;"/>
<controls:CalculatorButton x:Name="MultiplyButton"
x:Uid="multiplyButton"
Grid.Row="1"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="multiplyButton"
ButtonId="Multiply"
Content="&#xE947;"/>
<controls:CalculatorButton x:Name="MinusButton"
x:Uid="minusButton"
Grid.Row="2"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="minusButton"
ButtonId="Subtract"
Content="&#xE949;"/>
<controls:CalculatorButton x:Name="PlusButton"
x:Uid="plusButton"
Grid.Row="3"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource SymbolOperatorButtonStyle}"
AutomationProperties.AutomationId="plusButton"
ButtonId="Add"
Content="&#xE948;"/>
<controls:CalculatorButton x:Name="EqualButton"
x:Uid="equalButton"
Grid.Row="4"
Style="{StaticResource AccentCalcButtonStyle}"
Style="{StaticResource AccentEmphasizedCalcButtonStyle}"
AutomationProperties.AutomationId="equalButton"
ButtonId="Equals"
Content="&#xE94E;"/>
</Grid>
<Grid x:Name="DisplayControls"
x:Uid="DisplayControls"
Grid.Row="1"
Grid.Column="2"
Grid.ColumnSpan="3"
AutomationProperties.HeadingLevel="Level1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<controls:CalculatorButton x:Name="ClearEntryButton"
x:Uid="clearEntryButton"
Grid.Column="0"
Style="{StaticResource OperatorButtonStyle}"
FontSize="16"
AutomationProperties.AutomationId="clearEntryButton"
ButtonId="ClearEntry"
Content="CE"/>
<controls:CalculatorButton x:Name="ClearButton"
x:Uid="clearButton"
Grid.Column="1"
Style="{StaticResource OperatorButtonStyle}"
FontSize="16"
AutomationProperties.AutomationId="clearButton"
ButtonId="Clear"
Content="C"/>
<controls:CalculatorButton x:Name="BackSpaceButton"
x:Uid="backSpaceButton"
Grid.Column="2"
Style="{StaticResource SymbolOperatorButtonStyle}"
FontSize="16"
AutomationProperties.AutomationId="backSpaceButton"
ButtonId="Backspace"
Content="&#xE94F;"/>
</Grid>
<local:NumberPad x:Name="NumberPad"
x:Uid="NumberPad"
Grid.Row="2"
@ -491,7 +320,8 @@
x:Uid="negateButton"
Grid.Row="5"
Grid.Column="2"
Style="{StaticResource SymbolOperatorButtonStyle}"
Style="{StaticResource SymbolOperatorKeypadButtonStyle}"
FontWeight="Normal"
AutomationProperties.AutomationId="negateButton"
ButtonId="Negate"
Content="&#xF898;"/>

View File

@ -8,6 +8,7 @@
#include "pch.h"
#include "CalculatorStandardOperators.xaml.h"
#include "Controls/CalculatorButton.h"
using namespace CalculatorApp;

View File

@ -1,4 +1,4 @@
<UserControl x:Class="CalculatorApp.NumberPad"
<UserControl x:Class="CalculatorApp.NumberPad"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="using:CalculatorApp.Common"
@ -112,7 +112,6 @@
Grid.Row="3"
Grid.Column="2"
Style="{Binding ElementName=ControlRoot, Path=ButtonStyle}"
Background="{ThemeResource AppBackgroundAltMediumLowBrush}"
common:KeyboardShortcutManager.Character="."
AutomationProperties.AutomationId="decimalSeparatorButton"
ButtonId="Decimal"

View File

@ -10,26 +10,26 @@
mc:Ignorable="d">
<Grid>
<local:CalculatorStandardOperators x:Name="StandardOperators"
x:Load="{x:Bind Model.IsStandard, Mode=OneWay}"
TabIndex="17"
IsEnabled="{x:Bind Model.IsStandard, Mode=OneWay}"
TabIndex="17"/>
x:Load="{x:Bind Model.IsStandard, Mode=OneWay}"/>
<local:CalculatorScientificOperators x:Name="ScientificOperators"
x:Load="False"
IsEnabled="{x:Bind Model.IsScientific, Mode=OneWay}"
TabIndex="16"
Visibility="{x:Bind Model.IsScientific, Mode=OneWay}"/>
Visibility="{x:Bind Model.IsScientific, Mode=OneWay}"
IsEnabled="{x:Bind Model.IsScientific, Mode=OneWay}"
x:Load="False"/>
<local:CalculatorProgrammerBitFlipPanel x:Name="BitFlipPanel"
x:Load="False"
Visibility="{x:Bind Model.IsBinaryBitFlippingEnabled, Mode=OneWay}"
IsEnabled="{x:Bind Model.IsBinaryBitFlippingEnabled, Mode=OneWay}"
Visibility="{x:Bind Model.IsBinaryBitFlippingEnabled, Mode=OneWay}"/>
x:Load="False"/>
<local:CalculatorProgrammerRadixOperators x:Name="ProgrammerRadixOperators"
x:Load="False"
IsEnabled="{x:Bind Model.AreProgrammerRadixOperatorsEnabled, Mode=OneWay}"
TabIndex="16"
Visibility="{x:Bind Model.AreProgrammerRadixOperatorsEnabled, Mode=OneWay}"/>
Visibility="{x:Bind Model.AreProgrammerRadixOperatorsEnabled, Mode=OneWay}"
IsEnabled="{x:Bind Model.AreProgrammerRadixOperatorsEnabled, Mode=OneWay}"
x:Load="False"/>
</Grid>
</UserControl>

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"
@ -71,6 +71,11 @@ void OperatorsPanel::EnsureProgrammerRadixOps()
{
this->FindName(L"ProgrammerRadixOperators");
}
if (ProgrammerRadixOperators)
{
ProgrammerRadixOperators->checkDefaultBitShift();
}
}
void OperatorsPanel::EnsureProgrammerBitFlipPanel()

View File

@ -0,0 +1,80 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "ControlSizeTrigger.h"
using namespace CalculatorApp::Views::StateTriggers;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::UI::Xaml;
DEPENDENCY_PROPERTY_INITIALIZATION(ControlSizeTrigger, Source);
DEPENDENCY_PROPERTY_INITIALIZATION(ControlSizeTrigger, MinHeight);
DEPENDENCY_PROPERTY_INITIALIZATION(ControlSizeTrigger, MinWidth);
ControlSizeTrigger::ControlSizeTrigger()
{
SetActive(false);
}
ControlSizeTrigger::~ControlSizeTrigger()
{
UnregisterSizeChanged(Source);
}
void ControlSizeTrigger::OnSourcePropertyChanged(FrameworkElement^ oldValue, FrameworkElement^ newValue)
{
UnregisterSizeChanged(oldValue);
RegisterSizeChanged(newValue);
}
void ControlSizeTrigger::RegisterSizeChanged(FrameworkElement^ element)
{
if (element == nullptr) { return; }
if (element != Source)
{
UnregisterSizeChanged(Source);
}
m_sizeChangedToken =
element->SizeChanged += ref new SizeChangedEventHandler(this, &ControlSizeTrigger::OnSizeChanged);
}
void ControlSizeTrigger::UnregisterSizeChanged(FrameworkElement^ element)
{
if ((element != nullptr) && (m_sizeChangedToken.Value != 0))
{
element->SizeChanged -= m_sizeChangedToken;
m_sizeChangedToken.Value = 0;
}
}
void ControlSizeTrigger::OnSizeChanged(Object^ sender, SizeChangedEventArgs^ e)
{
UpdateIsActive(e->NewSize);
}
void ControlSizeTrigger::UpdateIsActive(Size sourceSize)
{
if (Source != nullptr && MinWidth > 0 || MinHeight > 0)
{
if (MinHeight > 0 && MinWidth > 0)
{
SetActive((sourceSize.Height >= MinHeight) && (sourceSize.Width >= MinWidth));
}
else if (MinHeight > 0)
{
SetActive(sourceSize.Height >= MinHeight);
}
else
{
SetActive(sourceSize.Width >= MinWidth);
}
}
else
{
SetActive(false);
}
}

View File

@ -0,0 +1,37 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "CalcViewModel/Common/Utils.h"
namespace CalculatorApp::Views::StateTriggers
{
public ref class ControlSizeTrigger sealed : public Windows::UI::Xaml::StateTriggerBase
{
public:
ControlSizeTrigger();
DEPENDENCY_PROPERTY_OWNER(ControlSizeTrigger);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Windows::UI::Xaml::FrameworkElement^, Source);
DEPENDENCY_PROPERTY_WITH_DEFAULT(double, MinHeight, 0.0);
DEPENDENCY_PROPERTY_WITH_DEFAULT(double, MinWidth, 0.0);
private:
~ControlSizeTrigger();
void OnSourcePropertyChanged(Windows::UI::Xaml::FrameworkElement^ oldValue, Windows::UI::Xaml::FrameworkElement^ newValue);
void RegisterSizeChanged(Windows::UI::Xaml::FrameworkElement^ element);
void UnregisterSizeChanged(Windows::UI::Xaml::FrameworkElement^ element);
void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
void UpdateIsActive(Windows::Foundation::Size sourceSize);
private:
Windows::Foundation::EventRegistrationToken m_sizeChangedToken;
};
}

View File

@ -702,7 +702,8 @@
Grid.Column="1"
Margin="3,0,3,3"
FlowDirection="LeftToRight"
RenderTransformOrigin="0.5,0.5">
RenderTransformOrigin="0.5,0.5"
XYFocusKeyboardNavigation="Enabled">
<Grid.RenderTransform>
<CompositeTransform/>
</Grid.RenderTransform>
@ -761,7 +762,7 @@
x:Uid="converterNegateButton"
Grid.Row="4"
Grid.Column="0"
Style="{StaticResource SymbolOperatorButtonStyle}"
Style="{StaticResource SymbolOperatorKeypadButtonStyle}"
FontSize="16"
ButtonId="Negate"
Content="&#xF898;"

View File

@ -165,14 +165,6 @@ public void Operator_SquareRoot()
Assert.AreEqual("12", page.GetCalculatorResultText());
}
[TestMethod]
public void Operator_Cubed()
{
page.StandardOperators.NumberPad.Input(-3);
page.StandardOperators.XPower3Button.Click();
Assert.AreEqual("-27", page.GetCalculatorResultText());
}
[TestMethod]
public void Operator_Percent()
{
@ -242,13 +234,6 @@ public void KeyboardInput_SquareRoot()
Assert.AreEqual("10", page.GetCalculatorResultText());
}
[TestMethod]
public void KeyboardInput_Cubed()
{
page.Header.SendKeys("3#");
Assert.AreEqual("27", page.GetCalculatorResultText());
}
[TestMethod]
public void KeyboardInput_Percent()
{

View File

@ -18,7 +18,8 @@
"FontFamily, FontSize, LineHeight, FontWeight, FontStyle, FontStretch",
"*:*, *",
"PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint",
"mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText"
"mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText",
"IsEnabled, x:Load, Load"
],
"OrderAttributesByName": true,
"PutEndingBracketOnNewLine": false,