diff --git a/src/Calculator/Calculator.vcxproj b/src/Calculator/Calculator.vcxproj index 6f54e0d2f..632b46012 100644 --- a/src/Calculator/Calculator.vcxproj +++ b/src/Calculator/Calculator.vcxproj @@ -295,6 +295,9 @@ Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml + + Views\GraphingCalculator\GraphingNumPad.xaml + Views\HistoryList.xaml @@ -357,6 +360,7 @@ + @@ -454,6 +458,9 @@ Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml + + Views\GraphingCalculator\GraphingNumPad.xaml + Views\HistoryList.xaml diff --git a/src/Calculator/Calculator.vcxproj.filters b/src/Calculator/Calculator.vcxproj.filters index 17795d773..90ec720b1 100644 --- a/src/Calculator/Calculator.vcxproj.filters +++ b/src/Calculator/Calculator.vcxproj.filters @@ -317,8 +317,8 @@ Controls - - Views\GraphingCalculator + + Views\GraphingCalculator @@ -417,7 +417,7 @@ Controls - + Views\GraphingCalculator @@ -497,8 +497,11 @@ Views - - Views\GraphingCalculator + + Views\GraphingCalculator + + + Views\GraphingCalculator @@ -1548,5 +1551,7 @@ + + \ No newline at end of file diff --git a/src/Calculator/Resources/en-US/Resources.resw b/src/Calculator/Resources/en-US/Resources.resw index 58e17573c..08b4ba5fe 100644 --- a/src/Calculator/Resources/en-US/Resources.resw +++ b/src/Calculator/Resources/en-US/Resources.resw @@ -3535,6 +3535,10 @@ Function Displayed on the button that contains a flyout for the general functions in scientific mode. + + Inequalities + Displayed on the button that contains a flyout for the inequality functions. + Bitwise Displayed on the button that contains a flyout for the bitwise functions in programmer mode. diff --git a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml index 34506e5d7..458c212c2 100644 --- a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml +++ b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml @@ -314,15 +314,6 @@ - - @@ -687,8 +678,8 @@ @@ -702,8 +693,8 @@ Grid.Column="1" Visibility="{x:Bind local:GraphingCalculator.ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:False), Mode=OneWay}"> - - + + @@ -721,190 +712,10 @@ KeyGraphFeaturesRequested="OnEquationKeyGraphFeaturesRequested" Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h index b6358bf55..2e2cf70db 100644 --- a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h +++ b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.h @@ -7,6 +7,7 @@ #include "CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.h" #include "Views\NumberPad.xaml.h" #include "Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h" +#include "Views\GraphingCalculator\GraphingNumPad.xaml.h" namespace CalculatorApp { diff --git a/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml b/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml new file mode 100644 index 000000000..e377efff2 --- /dev/null +++ b/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml @@ -0,0 +1,1194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.cpp b/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.cpp new file mode 100644 index 000000000..2de31dc5a --- /dev/null +++ b/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.cpp @@ -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; +} diff --git a/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.h b/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.h new file mode 100644 index 000000000..d6615f901 --- /dev/null +++ b/src/Calculator/Views/GraphingCalculator/GraphingNumPad.xaml.h @@ -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(); + }; +}