mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-19 21:03:11 -07:00
Add keyboard UI (#855)
This commit is contained in:
parent
5209084bb0
commit
c6d3132ad4
8 changed files with 1355 additions and 200 deletions
|
@ -295,6 +295,9 @@
|
||||||
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h">
|
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h">
|
||||||
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
|
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Views\GraphingCalculator\GraphingNumPad.xaml.h">
|
||||||
|
<DependentUpon>Views\GraphingCalculator\GraphingNumPad.xaml</DependentUpon>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="Views\HistoryList.xaml.h">
|
<ClInclude Include="Views\HistoryList.xaml.h">
|
||||||
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
|
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -357,6 +360,7 @@
|
||||||
<Page Include="Views\GraphingCalculator\EquationInputArea.xaml" />
|
<Page Include="Views\GraphingCalculator\EquationInputArea.xaml" />
|
||||||
<Page Include="Views\GraphingCalculator\GraphingCalculator.xaml" />
|
<Page Include="Views\GraphingCalculator\GraphingCalculator.xaml" />
|
||||||
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml" />
|
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml" />
|
||||||
|
<Page Include="Views\GraphingCalculator\GraphingNumPad.xaml"/>
|
||||||
<Page Include="Views\HistoryList.xaml" />
|
<Page Include="Views\HistoryList.xaml" />
|
||||||
<Page Include="Views\MainPage.xaml" />
|
<Page Include="Views\MainPage.xaml" />
|
||||||
<Page Include="Views\Memory.xaml" />
|
<Page Include="Views\Memory.xaml" />
|
||||||
|
@ -454,6 +458,9 @@
|
||||||
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp">
|
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp">
|
||||||
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
|
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Views\GraphingCalculator\GraphingNumPad.xaml.cpp">
|
||||||
|
<DependentUpon>Views\GraphingCalculator\GraphingNumPad.xaml</DependentUpon>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="Views\HistoryList.xaml.cpp">
|
<ClCompile Include="Views\HistoryList.xaml.cpp">
|
||||||
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
|
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -317,8 +317,8 @@
|
||||||
<Filter>Controls</Filter>
|
<Filter>Controls</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Controls\MathRichEditBox.cpp" />
|
<ClCompile Include="Controls\MathRichEditBox.cpp" />
|
||||||
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp" >
|
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp">
|
||||||
<Filter>Views\GraphingCalculator</Filter>
|
<Filter>Views\GraphingCalculator</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.cpp" />
|
<ClCompile Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -417,7 +417,7 @@
|
||||||
<Filter>Controls</Filter>
|
<Filter>Controls</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Controls\MathRichEditBox.h" />
|
<ClInclude Include="Controls\MathRichEditBox.h" />
|
||||||
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h" >
|
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h">
|
||||||
<Filter>Views\GraphingCalculator</Filter>
|
<Filter>Views\GraphingCalculator</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.h" />
|
<ClInclude Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.h" />
|
||||||
|
@ -497,8 +497,11 @@
|
||||||
<Page Include="Views\TitleBar.xaml">
|
<Page Include="Views\TitleBar.xaml">
|
||||||
<Filter>Views</Filter>
|
<Filter>Views</Filter>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml" >
|
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml">
|
||||||
<Filter>Views\GraphingCalculator</Filter>
|
<Filter>Views\GraphingCalculator</Filter>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\GraphingCalculator\GraphingNumPad.xaml">
|
||||||
|
<Filter>Views\GraphingCalculator</Filter>
|
||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1548,5 +1551,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||||
|
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||||
|
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -3535,6 +3535,10 @@
|
||||||
<value>Function</value>
|
<value>Function</value>
|
||||||
<comment>Displayed on the button that contains a flyout for the general functions in scientific mode.</comment>
|
<comment>Displayed on the button that contains a flyout for the general functions in scientific mode.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="inequalityButton.Text" xml:space="preserve">
|
||||||
|
<value>Inequalities</value>
|
||||||
|
<comment>Displayed on the button that contains a flyout for the inequality functions.</comment>
|
||||||
|
</data>
|
||||||
<data name="bitwiseButton.Text" xml:space="preserve">
|
<data name="bitwiseButton.Text" xml:space="preserve">
|
||||||
<value>Bitwise</value>
|
<value>Bitwise</value>
|
||||||
<comment>Displayed on the button that contains a flyout for the bitwise functions in programmer mode.</comment>
|
<comment>Displayed on the button that contains a flyout for the bitwise functions in programmer mode.</comment>
|
||||||
|
|
|
@ -314,15 +314,6 @@
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="AccentCalcButtonStyle"
|
|
||||||
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}"/>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<converters:BooleanToVisibilityConverter x:Name="BooleanToVisibilityConverter"/>
|
<converters:BooleanToVisibilityConverter x:Name="BooleanToVisibilityConverter"/>
|
||||||
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
|
@ -687,8 +678,8 @@
|
||||||
<TranslateTransform x:Name="TraceValuePopupTransform"/>
|
<TranslateTransform x:Name="TraceValuePopupTransform"/>
|
||||||
</Border.RenderTransform>
|
</Border.RenderTransform>
|
||||||
<TextBlock x:Name="TraceValue"
|
<TextBlock x:Name="TraceValue"
|
||||||
AutomationProperties.LiveSetting="Polite"
|
|
||||||
Foreground="{ThemeResource ToolTipForeground}"
|
Foreground="{ThemeResource ToolTipForeground}"
|
||||||
|
AutomationProperties.LiveSetting="Polite"
|
||||||
Text="x=0,y=0"/>
|
Text="x=0,y=0"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -702,8 +693,8 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Visibility="{x:Bind local:GraphingCalculator.ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:False), Mode=OneWay}">
|
Visibility="{x:Bind local:GraphingCalculator.ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:False), Mode=OneWay}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="5*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="3*"/>
|
<RowDefinition Height="1.8*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Ideally the KeyGraphFeaturesPanel should be a frame so that navigation to and from the panel could be handled nicely -->
|
<!-- Ideally the KeyGraphFeaturesPanel should be a frame so that navigation to and from the panel could be handled nicely -->
|
||||||
|
@ -721,190 +712,10 @@
|
||||||
KeyGraphFeaturesRequested="OnEquationKeyGraphFeaturesRequested"
|
KeyGraphFeaturesRequested="OnEquationKeyGraphFeaturesRequested"
|
||||||
Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
|
Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
|
||||||
|
|
||||||
<Grid x:Name="ButtonContainerGrid"
|
<local:GraphingNumPad Grid.Row="1"
|
||||||
Grid.Row="1"
|
Margin="2,0,2,2"
|
||||||
Margin="2,0,2,2"
|
Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
|
||||||
UseLayoutRounding="False"
|
|
||||||
Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="XButton"
|
|
||||||
x:Uid="xButton"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="0"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
FontSize="16"
|
|
||||||
ButtonId="X"
|
|
||||||
Content="𝑥"
|
|
||||||
FlowDirection="LeftToRight"/>
|
|
||||||
<controls:CalculatorButton x:Name="YButton"
|
|
||||||
x:Uid="yButton"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
FontSize="16"
|
|
||||||
ButtonId="Y"
|
|
||||||
Content="𝑦"
|
|
||||||
FlowDirection="LeftToRight"/>
|
|
||||||
<controls:CalculatorButton x:Name="PowerButton"
|
|
||||||
x:Uid="graphingPowerButton"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="2"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
ButtonId="XPowerY"
|
|
||||||
Content="^"/>
|
|
||||||
<controls:CalculatorButton x:Name="squareRootButton"
|
|
||||||
x:Uid="squareRootButton"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="3"
|
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
|
||||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
|
||||||
ButtonId="Sqrt"
|
|
||||||
Content=""/>
|
|
||||||
|
|
||||||
<!-- Display controls -->
|
|
||||||
<controls:CalculatorButton x:Name="ClearButton"
|
|
||||||
x:Uid="clearButton"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="2"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
FontSize="16"
|
|
||||||
ButtonId="Clear"
|
|
||||||
Content="C"/>
|
|
||||||
<controls:CalculatorButton x:Name="BackSpaceButton"
|
|
||||||
x:Uid="backSpaceButton"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="3"
|
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
|
||||||
FontSize="16"
|
|
||||||
ButtonId="Backspace"
|
|
||||||
Content=""/>
|
|
||||||
|
|
||||||
<!-- Basic operators -->
|
|
||||||
<controls:CalculatorButton x:Name="EqualButton"
|
|
||||||
x:Uid="graphingEqualButton"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="4"
|
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
|
||||||
ButtonId="Equals"
|
|
||||||
Content=""/>
|
|
||||||
<controls:CalculatorButton x:Name="DivideButton"
|
|
||||||
x:Uid="divideButton"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="4"
|
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
|
||||||
ButtonId="Divide"
|
|
||||||
Content=""/>
|
|
||||||
<controls:CalculatorButton x:Name="MultiplyButton"
|
|
||||||
x:Uid="multiplyButton"
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.Column="4"
|
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
|
||||||
ButtonId="Multiply"
|
|
||||||
Content=""/>
|
|
||||||
<controls:CalculatorButton x:Name="MinusButton"
|
|
||||||
x:Uid="minusButton"
|
|
||||||
Grid.Row="3"
|
|
||||||
Grid.Column="4"
|
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
|
||||||
ButtonId="Subtract"
|
|
||||||
Content=""/>
|
|
||||||
<controls:CalculatorButton x:Name="PlusButton"
|
|
||||||
x:Uid="plusButton"
|
|
||||||
Grid.Row="4"
|
|
||||||
Grid.Column="4"
|
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
|
||||||
ButtonId="Add"
|
|
||||||
Content=""/>
|
|
||||||
|
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="logBase10Button"
|
|
||||||
x:Uid="logBase10Button"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="0"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
ButtonId="LogBase10"
|
|
||||||
Content="log"/>
|
|
||||||
<controls:CalculatorButton x:Name="logBaseEButton"
|
|
||||||
x:Uid="logBaseEButton"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
ButtonId="LogBaseE"
|
|
||||||
Content="ln"/>
|
|
||||||
<controls:CalculatorButton x:Name="powerOf10Button"
|
|
||||||
x:Uid="powerOf10Button"
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.Column="0"
|
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
|
||||||
AutomationProperties.AutomationId="powerOf10Button"
|
|
||||||
ButtonId="TenPowerX"
|
|
||||||
Content=""/>
|
|
||||||
<controls:CalculatorButton x:Name="powerOfEButton"
|
|
||||||
x:Uid="powerOfEButton"
|
|
||||||
Grid.Row="3"
|
|
||||||
Grid.Column="0"
|
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
|
||||||
ButtonId="EPowerX"
|
|
||||||
Content=""/>
|
|
||||||
<controls:CalculatorButton x:Name="piButton"
|
|
||||||
x:Uid="piButton"
|
|
||||||
Grid.Row="4"
|
|
||||||
Grid.Column="0"
|
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
|
||||||
FontSize="14"
|
|
||||||
ButtonId="Pi"
|
|
||||||
Content=""/>
|
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="openParenthesisButton"
|
|
||||||
x:Uid="openParenthesisButton"
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="0"
|
|
||||||
Style="{StaticResource ParenthesisCalcButtonStyle}"
|
|
||||||
FontSize="19"
|
|
||||||
ButtonId="OpenParenthesis"
|
|
||||||
Content="("/>
|
|
||||||
<controls:CalculatorButton x:Name="closeParenthesisButton"
|
|
||||||
x:Uid="closeParenthesisButton"
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="1"
|
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
|
||||||
FontSize="19"
|
|
||||||
ButtonId="CloseParenthesis"
|
|
||||||
Content=")"/>
|
|
||||||
|
|
||||||
<!-- The Numberpad -->
|
|
||||||
<local:NumberPad x:Name="NumberPad"
|
|
||||||
x:Uid="NumberPad"
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.RowSpan="4"
|
|
||||||
Grid.Column="1"
|
|
||||||
Grid.ColumnSpan="3"
|
|
||||||
ButtonStyle="{StaticResource NumericButtonStyle24}"/>
|
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="PlotButton"
|
|
||||||
x:Uid="plotButton"
|
|
||||||
Grid.Row="5"
|
|
||||||
Grid.Column="4"
|
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
|
||||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
|
||||||
ButtonId="Plot"
|
|
||||||
Content=""/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.h"
|
#include "CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.h"
|
||||||
#include "Views\NumberPad.xaml.h"
|
#include "Views\NumberPad.xaml.h"
|
||||||
#include "Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h"
|
#include "Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h"
|
||||||
|
#include "Views\GraphingCalculator\GraphingNumPad.xaml.h"
|
||||||
|
|
||||||
namespace CalculatorApp
|
namespace CalculatorApp
|
||||||
{
|
{
|
||||||
|
|
1194
src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml
Normal file
1194
src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml
Normal file
File diff suppressed because it is too large
Load diff
106
src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.cpp
Normal file
106
src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.cpp
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "GraphingNumPad.xaml.h"
|
||||||
|
#include "Views/NumberPad.xaml.h"
|
||||||
|
|
||||||
|
using namespace CalculatorApp;
|
||||||
|
|
||||||
|
using namespace Platform;
|
||||||
|
using namespace Windows::Foundation;
|
||||||
|
using namespace Windows::Foundation::Collections;
|
||||||
|
using namespace Windows::UI::Xaml;
|
||||||
|
using namespace Windows::UI::Xaml::Controls;
|
||||||
|
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||||
|
using namespace Windows::UI::Xaml::Data;
|
||||||
|
using namespace Windows::UI::Xaml::Input;
|
||||||
|
using namespace Windows::UI::Xaml::Media;
|
||||||
|
using namespace Windows::UI::Xaml::Navigation;
|
||||||
|
|
||||||
|
GraphingNumPad::GraphingNumPad()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::ShiftButton_Check(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
|
||||||
|
{
|
||||||
|
SetOperatorRowVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::ShiftButton_Uncheck(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
|
||||||
|
{
|
||||||
|
ShiftButton->IsChecked = false;
|
||||||
|
SetOperatorRowVisibility();
|
||||||
|
ShiftButton->Focus(::FocusState::Programmatic);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::TrigFlyoutShift_Toggle(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
|
||||||
|
{
|
||||||
|
SetTrigRowVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::TrigFlyoutHyp_Toggle(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::RoutedEventArgs ^ /*e*/)
|
||||||
|
{
|
||||||
|
SetTrigRowVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::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();
|
||||||
|
this->InequalityFlyout->Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::ShiftButton_IsEnabledChanged(_In_ Platform::Object ^ /*sender*/, _In_ Windows::UI::Xaml::DependencyPropertyChangedEventArgs ^ /*e*/)
|
||||||
|
{
|
||||||
|
SetOperatorRowVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingNumPad::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 GraphingNumPad::SetOperatorRowVisibility()
|
||||||
|
{
|
||||||
|
::Visibility rowVis, invRowVis;
|
||||||
|
if (ShiftButton->IsChecked->Value)
|
||||||
|
{
|
||||||
|
rowVis = ::Visibility::Collapsed;
|
||||||
|
invRowVis = ::Visibility::Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rowVis = ::Visibility::Visible;
|
||||||
|
invRowVis = ::Visibility::Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
Row1->Visibility = rowVis;
|
||||||
|
InvRow1->Visibility = invRowVis;
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Views\GraphingCalculator\GraphingNumPad.g.h"
|
||||||
|
#include "CalcViewModel/GraphingCalculator/GraphingCalculatorViewModel.h"
|
||||||
|
|
||||||
|
namespace CalculatorApp
|
||||||
|
{
|
||||||
|
[Windows::Foundation::Metadata::WebHostHidden]
|
||||||
|
public ref class GraphingNumPad sealed
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GraphingNumPad();
|
||||||
|
|
||||||
|
private:
|
||||||
|
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();
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue