mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-24 06:55:19 -07:00
Added narrator announcements when right parenthesis is clicked
This commit is contained in:
parent
67fa2286eb
commit
3796201cce
12 changed files with 109 additions and 31 deletions
|
@ -544,6 +544,11 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
|
||||||
if ((m_openParenCount >= MAXPRECDEPTH && nx) || (!m_openParenCount && !nx)
|
if ((m_openParenCount >= MAXPRECDEPTH && nx) || (!m_openParenCount && !nx)
|
||||||
|| ((m_precedenceOpCount >= MAXPRECDEPTH && m_nPrecOp[m_precedenceOpCount - 1] != 0)))
|
|| ((m_precedenceOpCount >= MAXPRECDEPTH && m_nPrecOp[m_precedenceOpCount - 1] != 0)))
|
||||||
{
|
{
|
||||||
|
if (!m_openParenCount && !nx)
|
||||||
|
{
|
||||||
|
m_pCalcDisplay->OnNoParenAdded();
|
||||||
|
}
|
||||||
|
|
||||||
HandleErrorCommand(wParam);
|
HandleErrorCommand(wParam);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,15 @@ namespace CalculationManager
|
||||||
m_displayCallback->SetParenDisplayText(parenthesisCount);
|
m_displayCallback->SetParenDisplayText(parenthesisCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback from the engine
|
||||||
|
/// Used to set the narrator text when no parenthesis can be added
|
||||||
|
/// </summary>
|
||||||
|
void CalculatorManager::OnNoParenAdded()
|
||||||
|
{
|
||||||
|
m_displayCallback->OnNoParenAdded();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reset CalculatorManager.
|
/// Reset CalculatorManager.
|
||||||
/// Set the mode to the standard calculator
|
/// Set the mode to the standard calculator
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace CalculationManager
|
||||||
MemorizedNumberClear = 335
|
MemorizedNumberClear = 335
|
||||||
};
|
};
|
||||||
|
|
||||||
class CalculatorManager sealed : public virtual ICalcDisplay
|
class CalculatorManager sealed : public ICalcDisplay
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
ICalcDisplay* const m_displayCallback;
|
ICalcDisplay* const m_displayCallback;
|
||||||
|
@ -94,7 +94,8 @@ namespace CalculationManager
|
||||||
void SetExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &commands) override;
|
void SetExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &commands) override;
|
||||||
void SetMemorizedNumbers(_In_ const std::vector<std::wstring>& memorizedNumbers) override;
|
void SetMemorizedNumbers(_In_ const std::vector<std::wstring>& memorizedNumbers) override;
|
||||||
void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) override;
|
void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) override;
|
||||||
void SetParenDisplayText(const std::wstring& parenthesisCount);
|
void SetParenDisplayText(const std::wstring& parenthesisCount) override;
|
||||||
|
void OnNoParenAdded() override;
|
||||||
void DisplayPasteError();
|
void DisplayPasteError();
|
||||||
void MaxDigitsReached() override;
|
void MaxDigitsReached() override;
|
||||||
void BinaryOperatorReceived() override;
|
void BinaryOperatorReceived() override;
|
||||||
|
|
|
@ -13,6 +13,7 @@ public:
|
||||||
virtual void SetIsInError(bool isInError) = 0;
|
virtual void SetIsInError(bool isInError) = 0;
|
||||||
virtual void SetExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &commands) = 0;
|
virtual void SetExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &commands) = 0;
|
||||||
virtual void SetParenDisplayText(const std::wstring& pszText) = 0;
|
virtual void SetParenDisplayText(const std::wstring& pszText) = 0;
|
||||||
|
virtual void OnNoParenAdded() = 0;
|
||||||
virtual void MaxDigitsReached() = 0; // not an error but still need to inform UI layer.
|
virtual void MaxDigitsReached() = 0; // not an error but still need to inform UI layer.
|
||||||
virtual void BinaryOperatorReceived() = 0;
|
virtual void BinaryOperatorReceived() = 0;
|
||||||
virtual void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) = 0;
|
virtual void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) = 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
@ -20,6 +20,8 @@ namespace CalculatorApp::Common::Automation
|
||||||
StringReference CategoryNameChanged(L"CategoryNameChanged");
|
StringReference CategoryNameChanged(L"CategoryNameChanged");
|
||||||
StringReference UpdateCurrencyRates(L"UpdateCurrencyRates");
|
StringReference UpdateCurrencyRates(L"UpdateCurrencyRates");
|
||||||
StringReference DisplayCopied(L"DisplayCopied");
|
StringReference DisplayCopied(L"DisplayCopied");
|
||||||
|
StringReference OpenParenthesisCountChanged(L"OpenParenthesisCountChanged");
|
||||||
|
StringReference NoParenthesisAdded(L"NoParenthesisAdded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,3 +144,21 @@ NarratorAnnouncement^ CalculatorAnnouncement::GetDisplayCopiedAnnouncement(Strin
|
||||||
AutomationNotificationKind::ActionCompleted,
|
AutomationNotificationKind::ActionCompleted,
|
||||||
AutomationNotificationProcessing::ImportantMostRecent);
|
AutomationNotificationProcessing::ImportantMostRecent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NarratorAnnouncement^ CalculatorAnnouncement::GetOpenParenethisCount(String^ announcement)
|
||||||
|
{
|
||||||
|
return ref new NarratorAnnouncement(
|
||||||
|
announcement,
|
||||||
|
CalculatorActivityIds::OpenParenthesisCountChanged,
|
||||||
|
AutomationNotificationKind::ActionCompleted,
|
||||||
|
AutomationNotificationProcessing::ImportantMostRecent);
|
||||||
|
}
|
||||||
|
|
||||||
|
NarratorAnnouncement^ CalculatorAnnouncement::GetNoParenthesisAddedAnnouncement(String^ announcement)
|
||||||
|
{
|
||||||
|
return ref new NarratorAnnouncement(
|
||||||
|
announcement,
|
||||||
|
CalculatorActivityIds::NoParenthesisAdded,
|
||||||
|
AutomationNotificationKind::ActionCompleted,
|
||||||
|
AutomationNotificationProcessing::ImportantMostRecent);
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -90,5 +90,8 @@ namespace CalculatorApp::Common::Automation
|
||||||
static NarratorAnnouncement^ GetUpdateCurrencyRatesAnnouncement(Platform::String^ announcement);
|
static NarratorAnnouncement^ GetUpdateCurrencyRatesAnnouncement(Platform::String^ announcement);
|
||||||
|
|
||||||
static NarratorAnnouncement^ GetDisplayCopiedAnnouncement(Platform::String^ announcement);
|
static NarratorAnnouncement^ GetDisplayCopiedAnnouncement(Platform::String^ announcement);
|
||||||
|
|
||||||
|
static NarratorAnnouncement^ GetOpenParenethisCount(Platform::String^ announcement);
|
||||||
|
static NarratorAnnouncement^ GetNoParenthesisAddedAnnouncement(Platform::String ^ announcement);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,18 @@ void CalculatorDisplay::SetParenDisplayText(_In_ const std::wstring& parenthesis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalculatorDisplay::OnNoParenAdded()
|
||||||
|
{
|
||||||
|
if (m_callbackReference != nullptr)
|
||||||
|
{
|
||||||
|
auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>();
|
||||||
|
if (calcVM)
|
||||||
|
{
|
||||||
|
calcVM->SetNoParenAddedNarratorAnnouncement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CalculatorDisplay::SetIsInError(bool isError)
|
void CalculatorDisplay::SetIsInError(bool isError)
|
||||||
{
|
{
|
||||||
if (m_callbackReference != nullptr)
|
if (m_callbackReference != nullptr)
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace CalculatorApp
|
||||||
void SetMemorizedNumbers(_In_ const std::vector<std::wstring>& memorizedNumbers) override;
|
void SetMemorizedNumbers(_In_ const std::vector<std::wstring>& memorizedNumbers) override;
|
||||||
void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) override;
|
void OnHistoryItemAdded(_In_ unsigned int addedItemIndex) override;
|
||||||
void SetParenDisplayText(_In_ const std::wstring& parenthesisCount) override;
|
void SetParenDisplayText(_In_ const std::wstring& parenthesisCount) override;
|
||||||
|
void OnNoParenAdded() override;
|
||||||
void MaxDigitsReached() override;
|
void MaxDigitsReached() override;
|
||||||
void BinaryOperatorReceived() override;
|
void BinaryOperatorReceived() override;
|
||||||
void MemoryItemChanged(unsigned int indexOfMemory) override;
|
void MemoryItemChanged(unsigned int indexOfMemory) override;
|
||||||
|
|
|
@ -52,7 +52,8 @@ namespace CalculatorApp::ViewModel
|
||||||
StringReference DecButton(L"Format_DecButtonValue");
|
StringReference DecButton(L"Format_DecButtonValue");
|
||||||
StringReference OctButton(L"Format_OctButtonValue");
|
StringReference OctButton(L"Format_OctButtonValue");
|
||||||
StringReference BinButton(L"Format_BinButtonValue");
|
StringReference BinButton(L"Format_BinButtonValue");
|
||||||
StringReference LeftParenthesisAutomationFormat(L"Format_OpenParenthesisAutomationNamePrefix");
|
StringReference OpenParenthesisCountAutomationFormat(L"Format_OpenParenthesisCountAutomationNamePrefix");
|
||||||
|
StringReference NoParenthesisAdded(L"NoParenthesisAdded_Announcement");
|
||||||
StringReference MaxDigitsReachedFormat(L"Format_MaxDigitsReached");
|
StringReference MaxDigitsReachedFormat(L"Format_MaxDigitsReached");
|
||||||
StringReference ButtonPressFeedbackFormat(L"Format_ButtonPressAuditoryFeedback");
|
StringReference ButtonPressFeedbackFormat(L"Format_ButtonPressAuditoryFeedback");
|
||||||
StringReference MemorySave(L"Format_MemorySave");
|
StringReference MemorySave(L"Format_MemorySave");
|
||||||
|
@ -92,7 +93,9 @@ StandardCalculatorViewModel::StandardCalculatorViewModel() :
|
||||||
m_localizedMemorySavedAutomationFormat(nullptr),
|
m_localizedMemorySavedAutomationFormat(nullptr),
|
||||||
m_localizedMemoryItemChangedAutomationFormat(nullptr),
|
m_localizedMemoryItemChangedAutomationFormat(nullptr),
|
||||||
m_localizedMemoryItemClearedAutomationFormat(nullptr),
|
m_localizedMemoryItemClearedAutomationFormat(nullptr),
|
||||||
m_localizedMemoryCleared(nullptr)
|
m_localizedMemoryCleared(nullptr),
|
||||||
|
m_localizedOpenParenthesisCountChangedAutomationFormat(nullptr),
|
||||||
|
m_localizaedNoParenthesisAddedAutomationFormat(nullptr)
|
||||||
{
|
{
|
||||||
WeakReference calculatorViewModel(this);
|
WeakReference calculatorViewModel(this);
|
||||||
m_calculatorDisplay.SetCallback(calculatorViewModel);
|
m_calculatorDisplay.SetCallback(calculatorViewModel);
|
||||||
|
@ -103,7 +106,6 @@ StandardCalculatorViewModel::StandardCalculatorViewModel() :
|
||||||
m_localizedDecimalAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::DecButton);
|
m_localizedDecimalAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::DecButton);
|
||||||
m_localizedOctalAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::OctButton);
|
m_localizedOctalAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::OctButton);
|
||||||
m_localizedBinaryAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::BinButton);
|
m_localizedBinaryAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::BinButton);
|
||||||
m_leftParenthesisAutomationFormat = AppResourceProvider::GetInstance().GetResourceString(CalculatorResourceKeys::LeftParenthesisAutomationFormat);
|
|
||||||
|
|
||||||
// Initialize the Automation Name
|
// Initialize the Automation Name
|
||||||
CalculationResultAutomationName = GetLocalizedStringFormat(m_localizedCalculationResultAutomationFormat, m_DisplayValue);
|
CalculationResultAutomationName = GetLocalizedStringFormat(m_localizedCalculationResultAutomationFormat, m_DisplayValue);
|
||||||
|
@ -222,10 +224,32 @@ void StandardCalculatorViewModel::SetParenthesisCount(_In_ const wstring& parent
|
||||||
if (IsProgrammer || IsScientific)
|
if (IsProgrammer || IsScientific)
|
||||||
{
|
{
|
||||||
OpenParenthesisCount = ref new String(parenthesisCount.c_str());
|
OpenParenthesisCount = ref new String(parenthesisCount.c_str());
|
||||||
RaisePropertyChanged("LeftParenthesisAutomationName");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StandardCalculatorViewModel::OpenParenthesisCountNarratorAnnouncment()
|
||||||
|
{
|
||||||
|
String^ parenthesisCount = ((m_OpenParenthesisCount == nullptr) ? "0" : m_OpenParenthesisCount);
|
||||||
|
wstring localizedParenthesisCount = std::wstring(parenthesisCount->Data());
|
||||||
|
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedParenthesisCount);
|
||||||
|
|
||||||
|
String^ announcement = LocalizationStringUtil::GetLocalizedNarratorAnnouncement(
|
||||||
|
CalculatorResourceKeys::OpenParenthesisCountAutomationFormat,
|
||||||
|
m_localizedOpenParenthesisCountChangedAutomationFormat,
|
||||||
|
localizedParenthesisCount.c_str());
|
||||||
|
|
||||||
|
Announcement = CalculatorAnnouncement::GetOpenParenethisCount(announcement);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StandardCalculatorViewModel::SetNoParenAddedNarratorAnnouncement()
|
||||||
|
{
|
||||||
|
String^ announcement = LocalizationStringUtil::GetLocalizedNarratorAnnouncement(
|
||||||
|
CalculatorResourceKeys::NoParenthesisAdded,
|
||||||
|
m_localizaedNoParenthesisAddedAutomationFormat);
|
||||||
|
|
||||||
|
Announcement = CalculatorAnnouncement::GetNoParenthesisAddedAnnouncement(announcement);
|
||||||
|
}
|
||||||
|
|
||||||
void StandardCalculatorViewModel::DisableButtons(CommandType selectedExpressionCommandType)
|
void StandardCalculatorViewModel::DisableButtons(CommandType selectedExpressionCommandType)
|
||||||
{
|
{
|
||||||
if (selectedExpressionCommandType == CommandType::OperandCommand)
|
if (selectedExpressionCommandType == CommandType::OperandCommand)
|
||||||
|
@ -254,15 +278,6 @@ void StandardCalculatorViewModel::DisableButtons(CommandType selectedExpressionC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String ^ StandardCalculatorViewModel::GetLeftParenthesisAutomationName()
|
|
||||||
{
|
|
||||||
String^ parenthesisCount = ((m_OpenParenthesisCount == nullptr) ? "0" : m_OpenParenthesisCount);
|
|
||||||
wstring localizedParenthesisCount = std::wstring(parenthesisCount->Data());
|
|
||||||
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedParenthesisCount);
|
|
||||||
|
|
||||||
return GetLocalizedStringFormat(m_leftParenthesisAutomationFormat, ref new String(localizedParenthesisCount.c_str()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void StandardCalculatorViewModel::SetExpressionDisplay(_Inout_ shared_ptr<CalculatorVector<pair<wstring, int>>> const &tokens, _Inout_ shared_ptr<CalculatorVector <shared_ptr<IExpressionCommand>>> const &commands)
|
void StandardCalculatorViewModel::SetExpressionDisplay(_Inout_ shared_ptr<CalculatorVector<pair<wstring, int>>> const &tokens, _Inout_ shared_ptr<CalculatorVector <shared_ptr<IExpressionCommand>>> const &commands)
|
||||||
{
|
{
|
||||||
m_tokens = tokens;
|
m_tokens = tokens;
|
||||||
|
@ -566,6 +581,8 @@ void StandardCalculatorViewModel::OnButtonPressed(Object^ parameter)
|
||||||
m_feedbackForButtonPress = CalculatorButtonPressedEventArgs::GetAuditoryFeedbackFromCommandParameter(parameter);
|
m_feedbackForButtonPress = CalculatorButtonPressedEventArgs::GetAuditoryFeedbackFromCommandParameter(parameter);
|
||||||
NumbersAndOperatorsEnum numOpEnum = CalculatorButtonPressedEventArgs::GetOperationFromCommandParameter(parameter);
|
NumbersAndOperatorsEnum numOpEnum = CalculatorButtonPressedEventArgs::GetOperationFromCommandParameter(parameter);
|
||||||
Command cmdenum = ConvertToOperatorsEnum(numOpEnum);
|
Command cmdenum = ConvertToOperatorsEnum(numOpEnum);
|
||||||
|
bool isOperator = IsOperator(cmdenum);
|
||||||
|
String^ previousParenthesisCount = m_OpenParenthesisCount;
|
||||||
|
|
||||||
TraceLogger::GetInstance().UpdateFunctionUsage((int)numOpEnum);
|
TraceLogger::GetInstance().UpdateFunctionUsage((int)numOpEnum);
|
||||||
|
|
||||||
|
@ -643,6 +660,11 @@ void StandardCalculatorViewModel::OnButtonPressed(Object^ parameter)
|
||||||
|
|
||||||
m_standardCalculatorManager.SendCommand(cmdenum);
|
m_standardCalculatorManager.SendCommand(cmdenum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numOpEnum == NumbersAndOperatorsEnum::OpenParenthesis || (numOpEnum == NumbersAndOperatorsEnum::CloseParenthesis && previousParenthesisCount) )
|
||||||
|
{
|
||||||
|
OpenParenthesisCountNarratorAnnouncment();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,14 +261,6 @@ namespace CalculatorApp
|
||||||
void set(bool value) { m_completeTextSelection = value; }
|
void set(bool value) { m_completeTextSelection = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
property Platform::String^ LeftParenthesisAutomationName
|
|
||||||
{
|
|
||||||
Platform::String^ get()
|
|
||||||
{
|
|
||||||
return GetLeftParenthesisAutomationName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal:
|
internal:
|
||||||
void OnPaste(Platform::String^ pastedString, CalculatorApp::Common::ViewMode mode);
|
void OnPaste(Platform::String^ pastedString, CalculatorApp::Common::ViewMode mode);
|
||||||
void OnCopyCommand(Platform::Object^ parameter);
|
void OnCopyCommand(Platform::Object^ parameter);
|
||||||
|
@ -284,12 +276,15 @@ namespace CalculatorApp
|
||||||
void OnMemoryClear(_In_ Platform::Object^ memoryItemPosition);
|
void OnMemoryClear(_In_ Platform::Object^ memoryItemPosition);
|
||||||
void OnPinUnpinCommand(Platform::Object^ parameter);
|
void OnPinUnpinCommand(Platform::Object^ parameter);
|
||||||
|
|
||||||
|
void OpenParenthesisCountNarratorAnnouncment();
|
||||||
|
|
||||||
void SetPrimaryDisplay(_In_ std::wstring const&displayString, _In_ bool isError);
|
void SetPrimaryDisplay(_In_ std::wstring const&displayString, _In_ bool isError);
|
||||||
void DisplayPasteError();
|
void DisplayPasteError();
|
||||||
void SetTokens(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens);
|
void SetTokens(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens);
|
||||||
void SetExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &commands);
|
void SetExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector<std::shared_ptr<IExpressionCommand>>> const &commands);
|
||||||
void SetHistoryExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector <std::shared_ptr<IExpressionCommand>>> const &commands);
|
void SetHistoryExpressionDisplay(_Inout_ std::shared_ptr<CalculatorVector<std::pair<std::wstring, int>>> const &tokens, _Inout_ std::shared_ptr<CalculatorVector <std::shared_ptr<IExpressionCommand>>> const &commands);
|
||||||
void SetParenthesisCount(_In_ const std::wstring& parenthesisCount);
|
void SetParenthesisCount(_In_ const std::wstring& parenthesisCount);
|
||||||
|
void SetNoParenAddedNarratorAnnouncement();
|
||||||
void OnMaxDigitsReached();
|
void OnMaxDigitsReached();
|
||||||
void OnBinaryOperatorReceived();
|
void OnBinaryOperatorReceived();
|
||||||
void OnMemoryItemChanged(unsigned int indexOfMemory);
|
void OnMemoryItemChanged(unsigned int indexOfMemory);
|
||||||
|
@ -337,6 +332,8 @@ namespace CalculatorApp
|
||||||
Platform::String^ m_localizedMemoryItemChangedAutomationFormat;
|
Platform::String^ m_localizedMemoryItemChangedAutomationFormat;
|
||||||
Platform::String^ m_localizedMemoryItemClearedAutomationFormat;
|
Platform::String^ m_localizedMemoryItemClearedAutomationFormat;
|
||||||
Platform::String^ m_localizedMemoryCleared;
|
Platform::String^ m_localizedMemoryCleared;
|
||||||
|
Platform::String^ m_localizedOpenParenthesisCountChangedAutomationFormat;
|
||||||
|
Platform::String^ m_localizaedNoParenthesisAddedAutomationFormat;
|
||||||
|
|
||||||
bool m_pinned;
|
bool m_pinned;
|
||||||
bool m_isOperandEnabled;
|
bool m_isOperandEnabled;
|
||||||
|
@ -355,7 +352,6 @@ namespace CalculatorApp
|
||||||
bool m_isLastOperationHistoryLoad;
|
bool m_isLastOperationHistoryLoad;
|
||||||
Platform::String^ m_selectedExpressionLastData;
|
Platform::String^ m_selectedExpressionLastData;
|
||||||
Common::DisplayExpressionToken^ m_selectedExpressionToken;
|
Common::DisplayExpressionToken^ m_selectedExpressionToken;
|
||||||
Platform::String^ m_leftParenthesisAutomationFormat;
|
|
||||||
|
|
||||||
Platform::String^ LocalizeDisplayValue(_In_ std::wstring const &displayValue, _In_ bool isError);
|
Platform::String^ LocalizeDisplayValue(_In_ std::wstring const &displayValue, _In_ bool isError);
|
||||||
Platform::String^ CalculateNarratorDisplayValue(_In_ std::wstring const &displayValue, _In_ Platform::String^ localizedDisplayValue, _In_ bool isError);
|
Platform::String^ CalculateNarratorDisplayValue(_In_ std::wstring const &displayValue, _In_ Platform::String^ localizedDisplayValue, _In_ bool isError);
|
||||||
|
@ -365,7 +361,6 @@ namespace CalculatorApp
|
||||||
|
|
||||||
CalculationManager::Command ConvertToOperatorsEnum(NumbersAndOperatorsEnum operation);
|
CalculationManager::Command ConvertToOperatorsEnum(NumbersAndOperatorsEnum operation);
|
||||||
void DisableButtons(CalculationManager::CommandType selectedExpressionCommandType);
|
void DisableButtons(CalculationManager::CommandType selectedExpressionCommandType);
|
||||||
Platform::String^ GetLeftParenthesisAutomationName();
|
|
||||||
|
|
||||||
Platform::String^ m_feedbackForButtonPress;
|
Platform::String^ m_feedbackForButtonPress;
|
||||||
void OnButtonPressed(Platform::Object^ parameter);
|
void OnButtonPressed(Platform::Object^ parameter);
|
||||||
|
|
|
@ -1313,14 +1313,18 @@
|
||||||
<value>Left parenthesis</value>
|
<value>Left parenthesis</value>
|
||||||
<comment>Screen reader prompt for the Calculator "(" button on the scientific operator keypad</comment>
|
<comment>Screen reader prompt for the Calculator "(" button on the scientific operator keypad</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="Format_OpenParenthesisAutomationNamePrefix" xml:space="preserve">
|
|
||||||
<value>Left parenthesis, open parenthesis count %1</value>
|
|
||||||
<comment>{Locked="%1"} Screen reader prompt for the Calculator "(" button on the scientific operator keypad. %1 is the localized count of open parenthesis, e.g. "2".</comment>
|
|
||||||
</data>
|
|
||||||
<data name="closeParenthesisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
<data name="closeParenthesisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||||
<value>Right parenthesis</value>
|
<value>Right parenthesis</value>
|
||||||
<comment>Screen reader prompt for the Calculator ")" button on the scientific operator keypad</comment>
|
<comment>Screen reader prompt for the Calculator ")" button on the scientific operator keypad</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Format_OpenParenthesisCountAutomationNamePrefix" xml:space="preserve">
|
||||||
|
<value>Open parenthesis count %1</value>
|
||||||
|
<comment>{Locked="%1"} Screen reader prompt for the Calculator "(" button on the scientific operator keypad. %1 is the localized count of open parenthesis, e.g. "2".</comment>
|
||||||
|
</data>
|
||||||
|
<data name="NoParenthesisAdded_Announcement" xml:space="preserve">
|
||||||
|
<value>There are no open parentheses to close.</value>
|
||||||
|
<comment>{Locked="%1"} Screen reader prompt for the Calculator when the ")" button on the scientific or programmer operator keypad cannot be added to the equation. e.g. "1+)".</comment>
|
||||||
|
</data>
|
||||||
<data name="ftoeButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
<data name="ftoeButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||||
<value>Scientific notation</value>
|
<value>Scientific notation</value>
|
||||||
<comment>Screen reader prompt for the Calculator F-E the scientific operator keypad</comment>
|
<comment>Screen reader prompt for the Calculator F-E the scientific operator keypad</comment>
|
||||||
|
|
|
@ -62,6 +62,11 @@ namespace CalculatorManagerTest
|
||||||
m_parenDisplay = parenthesisCount;
|
m_parenDisplay = parenthesisCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnNoParenAdded() override
|
||||||
|
{
|
||||||
|
// This method is used to create a narrator announcement when a close parenthesis cannot be added because there are no open parentheses
|
||||||
|
}
|
||||||
|
|
||||||
const wstring& GetPrimaryDisplay() const
|
const wstring& GetPrimaryDisplay() const
|
||||||
{
|
{
|
||||||
return m_primaryDisplay;
|
return m_primaryDisplay;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue