mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-19 21:03:11 -07:00
Added narrator announcement when a function is removed (#1136)
This commit is contained in:
parent
6887c66be0
commit
0ed876db43
4 changed files with 28 additions and 2 deletions
|
@ -25,6 +25,7 @@ namespace CalculatorApp::Common::Automation
|
||||||
StringReference NoParenthesisAdded(L"NoParenthesisAdded");
|
StringReference NoParenthesisAdded(L"NoParenthesisAdded");
|
||||||
StringReference GraphModeChanged(L"GraphModeChanged");
|
StringReference GraphModeChanged(L"GraphModeChanged");
|
||||||
StringReference GraphViewChanged(L"GraphViewChanged");
|
StringReference GraphViewChanged(L"GraphViewChanged");
|
||||||
|
StringReference FunctionRemoved(L"FunctionRemoved");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +144,7 @@ NarratorAnnouncement ^ CalculatorAnnouncement::GetNoRightParenthesisAddedAnnounc
|
||||||
AutomationNotificationProcessing::ImportantMostRecent);
|
AutomationNotificationProcessing::ImportantMostRecent);
|
||||||
}
|
}
|
||||||
|
|
||||||
NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphModeChangedAnnouncement(Platform::String ^ announcement)
|
NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphModeChangedAnnouncement(String ^ announcement)
|
||||||
{
|
{
|
||||||
return ref new NarratorAnnouncement(
|
return ref new NarratorAnnouncement(
|
||||||
announcement,
|
announcement,
|
||||||
|
@ -152,7 +153,7 @@ NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphModeChangedAnnouncement(P
|
||||||
AutomationNotificationProcessing::ImportantMostRecent);
|
AutomationNotificationProcessing::ImportantMostRecent);
|
||||||
}
|
}
|
||||||
|
|
||||||
NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphViewChangedAnnouncement(Platform::String ^ announcement)
|
NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphViewChangedAnnouncement(String ^ announcement)
|
||||||
{
|
{
|
||||||
return ref new NarratorAnnouncement(
|
return ref new NarratorAnnouncement(
|
||||||
announcement,
|
announcement,
|
||||||
|
@ -160,3 +161,12 @@ NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphViewChangedAnnouncement(P
|
||||||
AutomationNotificationKind::ActionCompleted,
|
AutomationNotificationKind::ActionCompleted,
|
||||||
AutomationNotificationProcessing::MostRecent);
|
AutomationNotificationProcessing::MostRecent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NarratorAnnouncement ^ CalculatorAnnouncement::GetFunctionRemovedAnnouncement(String ^ announcement)
|
||||||
|
{
|
||||||
|
return ref new NarratorAnnouncement(
|
||||||
|
announcement,
|
||||||
|
CalculatorActivityIds::FunctionRemoved,
|
||||||
|
AutomationNotificationKind::ItemRemoved,
|
||||||
|
AutomationNotificationProcessing::MostRecent);
|
||||||
|
}
|
||||||
|
|
|
@ -70,5 +70,7 @@ public
|
||||||
static NarratorAnnouncement ^ GetGraphModeChangedAnnouncement(Platform::String ^ announcement);
|
static NarratorAnnouncement ^ GetGraphModeChangedAnnouncement(Platform::String ^ announcement);
|
||||||
static NarratorAnnouncement ^ GetGraphViewChangedAnnouncement(Platform::String ^ announcement);
|
static NarratorAnnouncement ^ GetGraphViewChangedAnnouncement(Platform::String ^ announcement);
|
||||||
|
|
||||||
|
static NarratorAnnouncement ^ GetFunctionRemovedAnnouncement(Platform::String ^ announcement);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4562,4 +4562,8 @@
|
||||||
<value>Match app theme</value>
|
<value>Match app theme</value>
|
||||||
<comment>This is the automation name text for the Graph settings option to set graph to match the app theme</comment>
|
<comment>This is the automation name text for the Graph settings option to set graph to match the app theme</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="FunctionRemovedAnnouncement" xml:space="preserve">
|
||||||
|
<value>Function removed</value>
|
||||||
|
<comment>Announcement used in Graphing Calculator when a function is removed from the function list</comment>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -4,9 +4,13 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "EquationInputArea.xaml.h"
|
#include "EquationInputArea.xaml.h"
|
||||||
#include "Utils/VisualTree.h"
|
#include "Utils/VisualTree.h"
|
||||||
|
#include "CalcViewModel/Common/AppResourceProvider.h"
|
||||||
|
#include "CalcViewModel/Common/Automation/NarratorAnnouncement.h"
|
||||||
|
#include "CalcViewModel/Common/Automation/NarratorNotifier.h"
|
||||||
|
|
||||||
using namespace CalculatorApp;
|
using namespace CalculatorApp;
|
||||||
using namespace CalculatorApp::Common;
|
using namespace CalculatorApp::Common;
|
||||||
|
using namespace CalculatorApp::Common::Automation;
|
||||||
using namespace GraphControl;
|
using namespace GraphControl;
|
||||||
using namespace CalculatorApp::ViewModel;
|
using namespace CalculatorApp::ViewModel;
|
||||||
using namespace CalculatorApp::Controls;
|
using namespace CalculatorApp::Controls;
|
||||||
|
@ -199,6 +203,12 @@ void EquationInputArea::EquationTextBox_RemoveButtonClicked(Object ^ sender, Rou
|
||||||
}
|
}
|
||||||
|
|
||||||
Equations->RemoveAt(index);
|
Equations->RemoveAt(index);
|
||||||
|
|
||||||
|
auto narratorNotifier = ref new NarratorNotifier();
|
||||||
|
auto announcement = CalculatorAnnouncement::GetFunctionRemovedAnnouncement(
|
||||||
|
AppResourceProvider::GetInstance()->GetResourceString(L"FunctionRemovedAnnouncement"));
|
||||||
|
narratorNotifier->Announce(announcement);
|
||||||
|
|
||||||
int lastIndex = Equations->Size - 1;
|
int lastIndex = Equations->Size - 1;
|
||||||
|
|
||||||
if (Equations->Size <= 1)
|
if (Equations->Size <= 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue