Fix issues with sin being parsed incorrectly (#1199)
This commit is contained in:
parent
1e302cac58
commit
e9c96c939a
@ -10,6 +10,7 @@ using namespace CalculatorApp::Common;
|
|||||||
using namespace CalculatorApp::Controls;
|
using namespace CalculatorApp::Controls;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Windows::ApplicationModel;
|
using namespace Windows::ApplicationModel;
|
||||||
|
using namespace Windows::UI::Core;
|
||||||
using namespace Windows::UI::Xaml;
|
using namespace Windows::UI::Xaml;
|
||||||
using namespace Windows::UI::Xaml::Controls;
|
using namespace Windows::UI::Xaml::Controls;
|
||||||
using namespace Windows::UI::Text;
|
using namespace Windows::UI::Text;
|
||||||
@ -125,6 +126,16 @@ void CalculatorApp::Controls::MathRichEditBox::OnKeyUp(Platform::Object ^ sender
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalculatorApp::Controls::MathRichEditBox::OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e)
|
||||||
|
{
|
||||||
|
// suppress control + B to prevent bold input from being entered
|
||||||
|
if ((Window::Current->CoreWindow->GetKeyState(VirtualKey::Control) & CoreVirtualKeyStates::Down) != CoreVirtualKeyStates::Down ||
|
||||||
|
e->Key != VirtualKey::B)
|
||||||
|
{
|
||||||
|
Windows::UI::Xaml::Controls::RichEditBox::OnKeyDown(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MathRichEditBox::OnMathTextPropertyChanged(Platform::String ^ oldValue, Platform::String ^ newValue)
|
void MathRichEditBox::OnMathTextPropertyChanged(Platform::String ^ oldValue, Platform::String ^ newValue)
|
||||||
{
|
{
|
||||||
SetMathTextProperty(newValue);
|
SetMathTextProperty(newValue);
|
||||||
@ -189,7 +200,6 @@ void MathRichEditBox::SubmitEquation(EquationSubmissionSource source)
|
|||||||
|
|
||||||
if (range != nullptr)
|
if (range != nullptr)
|
||||||
{
|
{
|
||||||
range->CharacterFormat->Bold = FormatEffect::Off;
|
|
||||||
range->CharacterFormat->Underline = UnderlineType::None;
|
range->CharacterFormat->Underline = UnderlineType::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,9 @@ namespace CalculatorApp
|
|||||||
void SubmitEquation(EquationSubmissionSource source);
|
void SubmitEquation(EquationSubmissionSource source);
|
||||||
void BackSpace();
|
void BackSpace();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Platform::String ^ GetMathTextProperty();
|
Platform::String ^ GetMathTextProperty();
|
||||||
void SetMathTextProperty(Platform::String ^ newValue);
|
void SetMathTextProperty(Platform::String ^ newValue);
|
||||||
|
Loading…
Reference in New Issue
Block a user