Graphing Calculator Diagnostics Instrumentation (#1041)
* Add telemetry for keyboard button usage in graphing mode * Added the diagnostics for EquationAdded and FunctionAnalysis * Added remaining diagnostics events for graphing calculator * Fix proj files to include the IsStoreBuild condition. Move the Delayer class to the Calculator/Utils folder * Ensure the variable textbox has focus before logging diagnostics * Move maxVariableCount check into the tracelogger class * Created enums and updated the slider value changed method to remove the variable from the map after the log method is called * Re-enable hidden lines when the expression is updated * Fixed extra line in grapher.h and removed the conditional logging for variable count * Updated logging per PR feedback * Updated variable logging and fixed issues in the IsEquationLineDisabled binding the EditTextBox control. * Update per PR feedback * Added TraceLogging project to contain shared logging logic. * Updated TraceLogging project and updated tracelogger classes to use the TraceLogging project methods * Updated VariableLogging to log variable name. And updated per PR comments * Updated Variables logging to log count changed instead of variable added and fixed issue with variableSliders not being initialized * Remove outdated tracelogging call caused by rebase * Updated Delayer class to DispatcherTimerDelayer and fixed some small formatting issues * Fixed missing Dalyer class name updates * Removed extra line in traceloger.h
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<AppxDefaultResourceQualifierUAP_Contrast>black</AppxDefaultResourceQualifierUAP_Contrast>
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
<PackageCertificateKeyFile>TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
<AppxPackageSigningEnabled>true</AppxPackageSigningEnabled>
|
||||
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
@@ -262,6 +262,7 @@
|
||||
<ClInclude Include="Controls\OperatorPanelListView.h" />
|
||||
<ClInclude Include="Controls\OperatorPanelButton.h" />
|
||||
<ClInclude Include="Controls\EquationTextBox.h" />
|
||||
<ClInclude Include="Utils\DispatcherTimerDelayer.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="App.xaml.h">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
@@ -431,6 +432,7 @@
|
||||
<ClCompile Include="Controls\OperatorPanelListView.cpp" />
|
||||
<ClCompile Include="Controls\OperatorPanelButton.cpp" />
|
||||
<ClCompile Include="Controls\EquationTextBox.cpp" />
|
||||
<ClCompile Include="Utils\DispatcherTimerDelayer.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
|
@@ -328,6 +328,7 @@
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\ViewState.cpp" />
|
||||
<ClCompile Include="Utils\DispatcherTimerDelayer.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
@@ -435,6 +436,7 @@
|
||||
<Filter>Common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\ViewState.h" />
|
||||
<ClInclude Include="Utils\DispatcherTimerDelayer.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
@@ -1537,5 +1539,7 @@
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -27,6 +27,7 @@ DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, EquationButtonContentIndex);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, HasError);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, IsAddEquationMode);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, MathEquation);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, IsEquationLineDisabled);
|
||||
|
||||
EquationTextBox::EquationTextBox()
|
||||
{
|
||||
@@ -69,9 +70,8 @@ void EquationTextBox::OnApplyTemplate()
|
||||
auto toolTip = ref new ToolTip();
|
||||
|
||||
auto equationButtonMessage = LocalizationStringUtil::GetLocalizedString(
|
||||
m_equationButton->IsChecked->Value ? resProvider->GetResourceString(L"showEquationButtonToolTip")
|
||||
: resProvider->GetResourceString(L"hideEquationButtonToolTip"),
|
||||
EquationButtonContentIndex);
|
||||
IsEquationLineDisabled ? resProvider->GetResourceString(L"showEquationButtonToolTip")
|
||||
: resProvider->GetResourceString(L"hideEquationButtonToolTip"), EquationButtonContentIndex);
|
||||
|
||||
toolTip->Content = equationButtonMessage;
|
||||
ToolTipService::SetToolTip(m_equationButton, toolTip);
|
||||
@@ -238,9 +238,8 @@ void EquationTextBox::OnEquationButtonClicked(Object ^ sender, RoutedEventArgs ^
|
||||
auto resProvider = AppResourceProvider::GetInstance();
|
||||
|
||||
auto equationButtonMessage = LocalizationStringUtil::GetLocalizedString(
|
||||
m_equationButton->IsChecked->Value ? resProvider->GetResourceString(L"showEquationButtonToolTip")
|
||||
: resProvider->GetResourceString(L"hideEquationButtonToolTip"),
|
||||
EquationButtonContentIndex);
|
||||
IsEquationLineDisabled ? resProvider->GetResourceString(L"showEquationButtonToolTip")
|
||||
: resProvider->GetResourceString(L"hideEquationButtonToolTip"), EquationButtonContentIndex);
|
||||
|
||||
toolTip->Content = equationButtonMessage;
|
||||
ToolTipService::SetToolTip(m_equationButton, toolTip);
|
||||
@@ -269,9 +268,11 @@ void EquationTextBox::OnRemoveButtonClicked(Object ^ sender, RoutedEventArgs ^ e
|
||||
|
||||
if (m_equationButton)
|
||||
{
|
||||
m_equationButton->IsChecked = false;
|
||||
IsEquationLineDisabled = false;
|
||||
}
|
||||
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::RemoveFunction);
|
||||
|
||||
VisualStateManager::GoToState(this, "Normal", true);
|
||||
}
|
||||
|
||||
@@ -280,6 +281,7 @@ void EquationTextBox::OnColorChooserButtonClicked(Object ^ sender, RoutedEventAr
|
||||
if (ColorChooserFlyout != nullptr && m_richEditBox != nullptr)
|
||||
{
|
||||
ColorChooserFlyout->ShowAt(m_richEditBox);
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::StylePicker);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "CalcViewModel/Common/Utils.h"
|
||||
#include "CalcViewModel/GraphingCalculator/EquationViewModel.h"
|
||||
#include "Calculator/Controls/MathRichEditBox.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -24,6 +25,7 @@ namespace CalculatorApp
|
||||
DEPENDENCY_PROPERTY(Platform::String ^, MathEquation);
|
||||
DEPENDENCY_PROPERTY_WITH_CALLBACK(bool, HasError);
|
||||
DEPENDENCY_PROPERTY_WITH_CALLBACK(bool, IsAddEquationMode);
|
||||
DEPENDENCY_PROPERTY(bool, IsEquationLineDisabled);
|
||||
|
||||
PROPERTY_R(bool, HasFocus);
|
||||
|
||||
|
@@ -41,6 +41,8 @@ void EquationStylePanelControl::SelectionChanged(Object ^ /*sender */, Selection
|
||||
{
|
||||
SelectedColor = brush->Color;
|
||||
}
|
||||
|
||||
TraceLogger::GetInstance()->LogGraphLineStyleChanged(LineStyleType::Color);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "EquationStylePanelControl.g.h"
|
||||
#include "CalcViewModel/Common/Utils.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
|
39
src/Calculator/Utils/DispatcherTimerDelayer.cpp
Normal file
39
src/Calculator/Utils/DispatcherTimerDelayer.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "DispatcherTimerDelayer.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::Foundation;
|
||||
|
||||
DispatcherTimerDelayer::DispatcherTimerDelayer(TimeSpan timeSpan)
|
||||
{
|
||||
m_timer = ref new DispatcherTimer();
|
||||
m_timer->Interval = timeSpan;
|
||||
auto interval = m_timer->Interval;
|
||||
m_timer->Tick += ref new EventHandler<Object ^>(this, &DispatcherTimerDelayer::Timer_Tick);
|
||||
}
|
||||
|
||||
void DispatcherTimerDelayer::Timer_Tick(Object ^ sender, Object ^ e)
|
||||
{
|
||||
m_timer->Stop();
|
||||
Action(this, nullptr);
|
||||
}
|
||||
|
||||
void DispatcherTimerDelayer::Start()
|
||||
{
|
||||
m_timer->Start();
|
||||
}
|
||||
|
||||
void DispatcherTimerDelayer::ResetAndStart()
|
||||
{
|
||||
m_timer->Stop();
|
||||
m_timer->Start();
|
||||
}
|
||||
|
||||
void DispatcherTimerDelayer::Stop()
|
||||
{
|
||||
m_timer->Stop();
|
||||
}
|
26
src/Calculator/Utils/DispatcherTimerDelayer.h
Normal file
26
src/Calculator/Utils/DispatcherTimerDelayer.h
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
public ref class DispatcherTimerDelayer sealed
|
||||
{
|
||||
public:
|
||||
DispatcherTimerDelayer(Windows::Foundation::TimeSpan timeSpan);
|
||||
|
||||
void Start();
|
||||
void ResetAndStart();
|
||||
void Stop();
|
||||
|
||||
event Windows::Foundation::EventHandler<Platform::Object ^> ^ Action;
|
||||
|
||||
private:
|
||||
void Timer_Tick(Platform::Object ^ sender, Platform::Object ^ e);
|
||||
|
||||
Windows::UI::Xaml::DispatcherTimer ^ m_timer;
|
||||
};
|
||||
}
|
@@ -150,7 +150,6 @@ void Calculator::OnLoaded(_In_ Object ^, _In_ RoutedEventArgs ^)
|
||||
|
||||
Platform::String ^ Calculator::GetCurrentLayoutState()
|
||||
{
|
||||
|
||||
if (IsProgrammer)
|
||||
{
|
||||
return L"Programmer";
|
||||
@@ -195,7 +194,7 @@ void Calculator::UpdateViewState()
|
||||
|
||||
void Calculator::AnimateCalculator(bool resultAnimate)
|
||||
{
|
||||
static auto uiSettings = ref new UISettings();
|
||||
static auto uiSettings = ref new UISettings();
|
||||
if (uiSettings->AnimationsEnabled)
|
||||
{
|
||||
m_doAnimate = true;
|
||||
@@ -703,6 +702,11 @@ void Calculator::OnMemoryAccessKeyInvoked(_In_ UIElement ^ sender, _In_ AccessKe
|
||||
|
||||
void CalculatorApp::Calculator::OnVisualStateChanged(Platform::Object ^ sender, Windows::UI::Xaml::VisualStateChangedEventArgs ^ e)
|
||||
{
|
||||
if (!IsStandard && !IsScientific && !IsProgrammer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto mode = IsStandard ? ViewMode::Standard : IsScientific ? ViewMode::Scientific : ViewMode::Programmer;
|
||||
TraceLogger::GetInstance()->LogVisualStateChanged(mode, e->NewState->Name, IsAlwaysOnTop);
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
||||
<converters:BooleanNegationConverter x:Name="BooleanNegationConverter"/>
|
||||
|
||||
<DataTemplate x:Key="VariableDataTemplate" x:DataType="vm:VariableViewModel">
|
||||
<Grid DataContext="{x:Bind}" Tapped="VariableAreaTapped">
|
||||
@@ -130,9 +131,11 @@
|
||||
<Slider Grid.Column="1"
|
||||
Margin="8,0,8,-6"
|
||||
VerticalAlignment="Center"
|
||||
DataContext="{x:Bind}"
|
||||
Maximum="{x:Bind Max, Mode=TwoWay}"
|
||||
Minimum="{x:Bind Min, Mode=TwoWay}"
|
||||
StepFrequency="{x:Bind Step, Mode=TwoWay}"
|
||||
ValueChanged="Slider_ValueChanged"
|
||||
Value="{x:Bind Value, Mode=TwoWay}"/>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
@@ -391,7 +394,8 @@
|
||||
Grid.Column="1"
|
||||
MinWidth="44"
|
||||
MinHeight="44"
|
||||
VerticalAlignment="Stretch">
|
||||
VerticalAlignment="Stretch"
|
||||
IsChecked="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsEquationLineDisabled, Mode=TwoWay}">
|
||||
<ToggleButton.Content>
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
|
@@ -129,6 +129,7 @@ void EquationInputArea::EquationTextBox_Submitted(Object ^ sender, MathRichEditB
|
||||
|| (submission->Source == EquationSubmissionSource::FOCUS_LOST && submission->HasTextChanged && eq->Expression != nullptr
|
||||
&& eq->Expression->Length() > 0))
|
||||
{
|
||||
eq->IsLineEnabled = true;
|
||||
unsigned int index = 0;
|
||||
if (Equations->IndexOf(eq, &index))
|
||||
{
|
||||
@@ -219,6 +220,8 @@ void EquationInputArea::EquationTextBox_EquationButtonClicked(Object ^ sender, R
|
||||
{
|
||||
auto eq = GetViewModelFromEquationTextBox(sender);
|
||||
eq->IsLineEnabled = !eq->IsLineEnabled;
|
||||
|
||||
TraceLogger::GetInstance()->LogShowHideButtonClicked(eq->IsLineEnabled ? false : true);
|
||||
}
|
||||
|
||||
void EquationInputArea::EquationTextBox_Loaded(Object ^ sender, RoutedEventArgs ^ e)
|
||||
@@ -333,21 +336,25 @@ void EquationInputArea::SubmitTextbox(TextBox ^ sender)
|
||||
{
|
||||
val = validateDouble(sender->Text, variableViewModel->Value);
|
||||
variableViewModel->Value = val;
|
||||
TraceLogger::GetInstance()->LogVariableChanged(L"ValueTextBox", variableViewModel->Name);
|
||||
}
|
||||
else if (sender->Name == "MinTextBox")
|
||||
{
|
||||
val = validateDouble(sender->Text, variableViewModel->Min);
|
||||
variableViewModel->Min = val;
|
||||
TraceLogger::GetInstance()->LogVariableSettingsChanged(L"MinTextBox");
|
||||
}
|
||||
else if (sender->Name == "MaxTextBox")
|
||||
{
|
||||
val = validateDouble(sender->Text, variableViewModel->Max);
|
||||
variableViewModel->Max = val;
|
||||
TraceLogger::GetInstance()->LogVariableSettingsChanged(L"MaxTextBox");
|
||||
}
|
||||
else if (sender->Name == "StepTextBox")
|
||||
{
|
||||
val = validateDouble(sender->Text, variableViewModel->Step);
|
||||
variableViewModel->Step = val;
|
||||
TraceLogger::GetInstance()->LogVariableSettingsChanged(L"StepTextBox");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -419,6 +426,50 @@ void EquationInputArea::EquationTextBox_EquationFormatRequested(Object ^ sender,
|
||||
EquationFormatRequested(sender, e);
|
||||
}
|
||||
|
||||
void EquationInputArea::Slider_ValueChanged(Object ^ sender, RangeBaseValueChangedEventArgs ^ e)
|
||||
{
|
||||
if (variableSliders == nullptr)
|
||||
{
|
||||
variableSliders = ref new Map<String ^, DispatcherTimerDelayer ^>();
|
||||
}
|
||||
|
||||
auto slider = static_cast<Slider ^>(sender);
|
||||
|
||||
// The slider value updates when the user uses the TextBox to change the variable value.
|
||||
// Check the focus state so that we don't trigger the event when the user used the textbox to change the variable value.
|
||||
if (slider->FocusState == Windows::UI::Xaml::FocusState::Unfocused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto variableVM = static_cast<VariableViewModel ^>(slider->DataContext);
|
||||
if (variableVM == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto name = variableVM->Name;
|
||||
|
||||
if (!variableSliders->HasKey(name))
|
||||
{
|
||||
TimeSpan timeSpan;
|
||||
timeSpan.Duration = 10000000; // The duration is 1 second. TimeSpan durations are expressed in 100 nanosecond units.
|
||||
DispatcherTimerDelayer ^ delayer = ref new DispatcherTimerDelayer(timeSpan);
|
||||
delayer->Action += ref new EventHandler<Platform::Object ^>([this, name](Platform::Object ^ sender, Platform::Object ^ e) {
|
||||
TraceLogger::GetInstance()->LogVariableChanged("Slider", name);
|
||||
variableSliders->Remove(name);
|
||||
});
|
||||
delayer->Start();
|
||||
variableSliders->Insert(name, delayer);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
auto delayer = variableSliders->Lookup(name);
|
||||
delayer->ResetAndStart();
|
||||
}
|
||||
}
|
||||
|
||||
EquationViewModel ^ EquationInputArea::GetViewModelFromEquationTextBox(Object ^ sender)
|
||||
{
|
||||
auto tb = static_cast<EquationTextBox ^>(sender);
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#include "Controls/EquationTextBox.h"
|
||||
#include "Converters/BooleanNegationConverter.h"
|
||||
#include "Controls/MathRichEditBox.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
#include "Utils/DispatcherTimerDelayer.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -36,7 +38,6 @@ public
|
||||
|
||||
static Windows::UI::Xaml::Media::SolidColorBrush
|
||||
^ ToSolidColorBrush(Windows::UI::Color color) { return ref new Windows::UI::Xaml::Media::SolidColorBrush(color); }
|
||||
|
||||
private:
|
||||
void OnPropertyChanged(Platform::String ^ propertyName);
|
||||
void OnEquationsPropertyChanged();
|
||||
@@ -65,6 +66,7 @@ public
|
||||
void SubmitTextbox(Windows::UI::Xaml::Controls::TextBox ^ textbox);
|
||||
void VariableAreaTapped(Platform::Object ^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs ^ e);
|
||||
void EquationTextBox_EquationFormatRequested(Platform::Object ^ sender, CalculatorApp::Controls::MathRichEditBoxFormatRequest ^ e);
|
||||
void Slider_ValueChanged(Platform::Object ^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs ^ e);
|
||||
|
||||
CalculatorApp::ViewModel::EquationViewModel ^ GetViewModelFromEquationTextBox(Platform::Object ^ sender);
|
||||
|
||||
@@ -72,5 +74,6 @@ public
|
||||
int m_lastLineColorIndex;
|
||||
int m_lastFunctionLabelIndex;
|
||||
ViewModel::EquationViewModel ^ m_equationToFocus;
|
||||
Platform::Collections::Map<Platform::String ^, CalculatorApp::DispatcherTimerDelayer ^> ^ variableSliders;
|
||||
};
|
||||
}
|
||||
|
@@ -390,7 +390,7 @@
|
||||
MaxWidth="420"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup>
|
||||
<VisualStateGroup CurrentStateChanged="OnVisualStateChanged">
|
||||
<VisualState x:Name="ColumnsState">
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="800"/>
|
||||
|
@@ -217,6 +217,7 @@ void CalculatorApp::GraphingCalculator::OnShareClick(Platform::Object ^ sender,
|
||||
{
|
||||
// Ask the OS to start a share action.
|
||||
DataTransferManager::ShowShareUI();
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::Share);
|
||||
}
|
||||
|
||||
// When share is invoked (by the user or programmatically) the event handler we registered will be called to populate the data package with the
|
||||
@@ -348,16 +349,19 @@ void GraphingCalculator::OnVariableChanged(Platform::Object ^ sender, VariableCh
|
||||
void GraphingCalculator::OnZoomInCommand(Object ^ /* parameter */)
|
||||
{
|
||||
GraphingControl->ZoomFromCenter(zoomInScale);
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::ZoomIn);
|
||||
}
|
||||
|
||||
void GraphingCalculator::OnZoomOutCommand(Object ^ /* parameter */)
|
||||
{
|
||||
GraphingControl->ZoomFromCenter(zoomOutScale);
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::ZoomOut);
|
||||
}
|
||||
|
||||
void GraphingCalculator::OnZoomResetCommand(Object ^ /* parameter */)
|
||||
{
|
||||
GraphingControl->ResetGrid();
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::ZoomReset);
|
||||
}
|
||||
|
||||
String ^ GraphingCalculator::GetTracingLegend(Platform::IBox<bool> ^ isTracing)
|
||||
@@ -525,6 +529,7 @@ void CalculatorApp::GraphingCalculator::ActiveTracing_Checked(Platform::Object ^
|
||||
KeyboardShortcutManager::IgnoreEscape(false);
|
||||
|
||||
TracePointer->Visibility = ::Visibility::Visible;
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::ActiveTracingChecked);
|
||||
}
|
||||
|
||||
void CalculatorApp::GraphingCalculator::ActiveTracing_Unchecked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
|
||||
@@ -543,6 +548,7 @@ void CalculatorApp::GraphingCalculator::ActiveTracing_Unchecked(Platform::Object
|
||||
KeyboardShortcutManager::HonorEscape();
|
||||
|
||||
TracePointer->Visibility = ::Visibility::Collapsed;
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::ActiveTracingUnchecked);
|
||||
}
|
||||
|
||||
void CalculatorApp::GraphingCalculator::ActiveTracing_KeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args)
|
||||
@@ -557,6 +563,7 @@ void CalculatorApp::GraphingCalculator::ActiveTracing_KeyUp(Windows::UI::Core::C
|
||||
void GraphingCalculator::GraphSettingsButton_Click(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
DisplayGraphSettings();
|
||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::GraphSettings);
|
||||
}
|
||||
|
||||
void GraphingCalculator::DisplayGraphSettings()
|
||||
@@ -676,3 +683,8 @@ void GraphingCalculator::GraphMenuFlyoutItem_Click(Object ^ sender, RoutedEventA
|
||||
dataPackage->SetBitmap(bitmapStream);
|
||||
::Clipboard::SetContent(dataPackage);
|
||||
}
|
||||
|
||||
void GraphingCalculator::OnVisualStateChanged(Object ^ sender, VisualStateChangedEventArgs ^ e)
|
||||
{
|
||||
TraceLogger::GetInstance()->LogVisualStateChanged(ViewMode::Graphing, e->NewState->Name, false);
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include "Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h"
|
||||
#include "Views\GraphingCalculator\GraphingNumPad.xaml.h"
|
||||
#include "Views\GraphingCalculator\GraphingSettings.xaml.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -97,6 +98,7 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
||||
void OnHighContrastChanged(Windows::UI::ViewManagement::AccessibilitySettings ^ sender, Platform::Object ^ args);
|
||||
void OnEquationFormatRequested(Platform::Object ^ sender, CalculatorApp::Controls::MathRichEditBoxFormatRequest ^ e);
|
||||
void GraphMenuFlyoutItem_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void OnVisualStateChanged(Platform::Object ^ sender, Windows::UI::Xaml::VisualStateChangedEventArgs ^ e);
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -203,6 +203,7 @@ void GraphingNumPad::Button_Clicked(Platform::Object ^ sender, DependencyPropert
|
||||
if (mathRichEdit != nullptr && sender != nullptr)
|
||||
{
|
||||
auto id = button->ButtonId;
|
||||
TraceLogger::GetInstance()->UpdateButtonUsage(id, CalculatorApp::Common::ViewMode::Graphing);
|
||||
auto output = buttonOutput.find(id);
|
||||
mathRichEdit->InsertText(std::get<0>(output->second), std::get<1>(output->second), std::get<2>(output->second));
|
||||
}
|
||||
@@ -214,6 +215,7 @@ void GraphingNumPad::SubmitButton_Clicked(Platform::Object ^ /*sender*/, RoutedE
|
||||
if (mathRichEdit != nullptr)
|
||||
{
|
||||
mathRichEdit->SubmitEquation(CalculatorApp::Controls::EquationSubmissionSource::ENTER_KEY);
|
||||
TraceLogger::GetInstance()->UpdateButtonUsage(NumbersAndOperatorsEnum::Submit, CalculatorApp::Common::ViewMode::Graphing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +226,7 @@ void GraphingNumPad::ClearButton_Clicked(Platform::Object ^ /*sender*/, RoutedEv
|
||||
{
|
||||
mathRichEdit->MathText = L"<math xmlns=\"http://www.w3.org/1998/Math/MathML\"></math>";
|
||||
mathRichEdit->SubmitEquation(CalculatorApp::Controls::EquationSubmissionSource::PROGRAMMATIC);
|
||||
TraceLogger::GetInstance()->UpdateButtonUsage(NumbersAndOperatorsEnum::Clear, CalculatorApp::Common::ViewMode::Graphing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +236,7 @@ void GraphingNumPad::BackSpaceButton_Clicked(Platform::Object ^ /*sender*/, Rout
|
||||
if (mathRichEdit != nullptr)
|
||||
{
|
||||
mathRichEdit->BackSpace();
|
||||
TraceLogger::GetInstance()->UpdateButtonUsage(NumbersAndOperatorsEnum::Backspace, CalculatorApp::Common::ViewMode::Graphing);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "CalcViewModel/GraphingCalculator/GraphingCalculatorViewModel.h"
|
||||
#include "Views/GraphingCalculator/EquationInputArea.xaml.h"
|
||||
#include "CalcViewModel/Common/CalculatorButtonUser.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "winrt/Windows.System.UserProfile.h"
|
||||
#include "winrt/Windows.UI.ViewManagement.h"
|
||||
#include "winrt/Windows.UI.Xaml.h"
|
||||
#include "winrt/Windows.Foundation.h"
|
||||
|
||||
// Project Headers
|
||||
#include "App.xaml.h"
|
||||
|
Reference in New Issue
Block a user