diff --git a/src/Calculator/App.xaml b/src/Calculator/App.xaml index 7120ab1..208182b 100644 --- a/src/Calculator/App.xaml +++ b/src/Calculator/App.xaml @@ -1669,6 +1669,7 @@ IsTabStop="False" Visibility="Collapsed"/> Controls - + + Views\GraphingCalculator + @@ -397,7 +399,9 @@ Controls - + + Views\GraphingCalculator + @@ -476,7 +480,9 @@ Views\GraphingCalculator - + + Views\GraphingCalculator + diff --git a/src/Calculator/Controls/EquationTextBox.cpp b/src/Calculator/Controls/EquationTextBox.cpp index b066175..1b559f5 100644 --- a/src/Calculator/Controls/EquationTextBox.cpp +++ b/src/Calculator/Controls/EquationTextBox.cpp @@ -2,6 +2,8 @@ // Licensed under the MIT License. #include "pch.h" +#include "CalcViewModel/Common/AppResourceProvider.h" +#include "CalcViewModel/Common/LocalizationStringUtil.h" #include "EquationTextBox.h" using namespace std; @@ -27,6 +29,7 @@ DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, EquationButtonContentIndex); void EquationTextBox::OnApplyTemplate() { m_equationButton = dynamic_cast(GetTemplateChild("EquationButton")); + m_kgfEquationButton = dynamic_cast(GetTemplateChild("KGFEquationButton")); m_richEditBox = dynamic_cast(GetTemplateChild("EquationTextBox")); m_deleteButton = dynamic_cast(GetTemplateChild("DeleteButton")); m_removeButton = dynamic_cast(GetTemplateChild("RemoveButton")); @@ -44,6 +47,16 @@ void EquationTextBox::OnApplyTemplate() if (m_equationButton != nullptr) { m_equationButton->Click += ref new RoutedEventHandler(this, &EquationTextBox::OnEquationButtonClicked); + + auto toolTip = ref new ToolTip(); + auto resProvider = AppResourceProvider::GetInstance(); + toolTip->Content = m_equationButton->IsChecked->Value ? resProvider.GetResourceString(L"showEquationButtonToolTip") : resProvider.GetResourceString(L"hideEquationButtonToolTip"); + ToolTipService::SetToolTip(m_equationButton, toolTip); + } + + if (m_kgfEquationButton != nullptr) + { + m_kgfEquationButton->Click += ref new RoutedEventHandler(this, &EquationTextBox::OnKGFEquationButtonClicked); } if (m_deleteButton != nullptr) @@ -172,6 +185,17 @@ void EquationTextBox::OnDeleteButtonClicked(Object ^ sender, RoutedEventArgs ^ e } void EquationTextBox::OnEquationButtonClicked(Object ^ sender, RoutedEventArgs ^ e) +{ + EquationButtonClicked(this, ref new RoutedEventArgs()); + + auto toolTip = ref new ToolTip(); + auto resProvider = AppResourceProvider::GetInstance(); + toolTip->Content = m_equationButton->IsChecked->Value ? resProvider.GetResourceString(L"showEquationButtonToolTip") : resProvider.GetResourceString(L"hideEquationButtonToolTip"); + + ToolTipService::SetToolTip(m_equationButton, toolTip); +} + +void EquationTextBox::OnKGFEquationButtonClicked(Object ^ sender, RoutedEventArgs ^ e) { EquationButtonClicked(this, ref new RoutedEventArgs()); } diff --git a/src/Calculator/Controls/EquationTextBox.h b/src/Calculator/Controls/EquationTextBox.h index d4b5066..8bccf02 100644 --- a/src/Calculator/Controls/EquationTextBox.h +++ b/src/Calculator/Controls/EquationTextBox.h @@ -53,6 +53,7 @@ namespace CalculatorApp void OnDeleteButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void OnEquationButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void OnKGFEquationButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e); void OnRemoveButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void OnColorChooserButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void OnFunctionButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); @@ -62,6 +63,7 @@ namespace CalculatorApp CalculatorApp::Controls::MathRichEditBox^ m_richEditBox; Windows::UI::Xaml::Controls::Primitives::ToggleButton^ m_equationButton; + Windows::UI::Xaml::Controls::Button^ m_kgfEquationButton; Windows::UI::Xaml::Controls::Button^ m_deleteButton; Windows::UI::Xaml::Controls::Button^ m_removeButton; Windows::UI::Xaml::Controls::Button^ m_functionButton; diff --git a/src/Calculator/Resources/en-US/Resources.resw b/src/Calculator/Resources/en-US/Resources.resw index 6a1b8c0..215d544 100644 --- a/src/Calculator/Resources/en-US/Resources.resw +++ b/src/Calculator/Resources/en-US/Resources.resw @@ -3698,6 +3698,50 @@ Unable to calculate the range for this function. Error displayed when Range is not returned from the analyzer. + + Back + This is the tooltip contents for the back button in the equation analysis page in the graphing calculator + + + Analyze equation + This is the tooltip automation name for the analyze equation button + + + Remove equation + This is the tool tip automation name for the graphing calculator remove equation buttons + + + Share + This is the tool tip automation name for the graphing calculator share button. + + + Change equation style + This is the tool tip automation name for the graphing calculator equation style button + + + Show + This is the tooltip shown when visibility is set to hidden in the graphing calculator + + + Hide + This is the tooltip shown when visibility is set to visible in the graphing calculator + + + Stop tracing + This is the tool tip automation name for the graphing calculator stop tracing button + + + Start tracing + This is the tool tip automation name for the graphing calculator start tracing button + + + Variables + This is the tool tip automation name for the Calculator variables button. + + + Configure slider + This is the tool tip text for teh slider options button in Graphing Calculator + Switch to equation mode Used in Graphing Calculator to switch the view to the equation mode diff --git a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml index 8947a61..a336edd 100644 --- a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml +++ b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml @@ -402,6 +402,7 @@ - Content = ActiveTracingOn ? resProvider.GetResourceString(L"disableTracingButtonToolTip") : resProvider.GetResourceString(L"enableTracingButtonToolTip"); + ToolTipService::SetToolTip(ActiveTracing, toolTip); + DataTransferManager ^ dataTransferManager = DataTransferManager::GetForCurrentView(); // Register the current control as a share source. @@ -340,6 +346,11 @@ void GraphingCalculator::OnActiveTracingClick(Object ^ sender, RoutedEventArgs ^ // The focus change to this button will have turned off the tracing if it was on ActiveTracingOn = !ActiveTracingOn; GraphingControl->ActiveTracing = ActiveTracingOn; + + auto toolTip = ref new ToolTip(); + auto resProvider = AppResourceProvider::GetInstance(); + toolTip->Content = ActiveTracingOn ? resProvider.GetResourceString(L"disableTracingButtonToolTip") : resProvider.GetResourceString(L"enableTracingButtonToolTip"); + ToolTipService::SetToolTip(ActiveTracing, toolTip); } void GraphingCalculator::GraphingControl_LostFocus(Object ^ sender, RoutedEventArgs ^ e) diff --git a/src/Calculator/Views/GraphingCalculator/KeyGraphFeaturesPanel.xaml b/src/Calculator/Views/GraphingCalculator/KeyGraphFeaturesPanel.xaml index 39fe252..a0e09f9 100644 --- a/src/Calculator/Views/GraphingCalculator/KeyGraphFeaturesPanel.xaml +++ b/src/Calculator/Views/GraphingCalculator/KeyGraphFeaturesPanel.xaml @@ -150,14 +150,15 @@ - - + - - + + - - + +