Allow rendering the graph on a background thread (#1014)
* Render on background thread * More work * variable fix * Add comments
This commit is contained in:
@@ -319,26 +319,6 @@ void EquationTextBox::OnHasErrorPropertyChanged(bool, bool)
|
||||
UpdateCommonVisualState();
|
||||
}
|
||||
|
||||
Platform::String ^ EquationTextBox::GetEquationText()
|
||||
{
|
||||
String ^ text;
|
||||
if (m_richEditBox != nullptr)
|
||||
{
|
||||
// Clear formatting since the graph control doesn't work with bold/underlines
|
||||
ITextRange ^ range = m_richEditBox->TextDocument->GetRange(0, m_richEditBox->TextDocument->Selection->EndPosition);
|
||||
|
||||
if (range != nullptr)
|
||||
{
|
||||
range->CharacterFormat->Bold = FormatEffect::Off;
|
||||
range->CharacterFormat->Underline = UnderlineType::None;
|
||||
}
|
||||
|
||||
text = m_richEditBox->MathText;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
void EquationTextBox::SetEquationText(Platform::String ^ equationText)
|
||||
{
|
||||
if (m_richEditBox != nullptr)
|
||||
|
@@ -33,7 +33,6 @@ namespace CalculatorApp
|
||||
event Windows::Foundation::EventHandler<MathRichEditBoxFormatRequest ^> ^ EquationFormatRequested;
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ EquationButtonClicked;
|
||||
|
||||
Platform::String ^ GetEquationText();
|
||||
void SetEquationText(Platform::String ^ equationText);
|
||||
void FocusTextBox();
|
||||
|
||||
|
@@ -12,6 +12,7 @@ using namespace std;
|
||||
using namespace Windows::ApplicationModel;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Text;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::System;
|
||||
|
||||
@@ -178,6 +179,15 @@ void MathRichEditBox::BackSpace()
|
||||
|
||||
void MathRichEditBox::SubmitEquation(EquationSubmissionSource source)
|
||||
{
|
||||
// Clear formatting since the graph control doesn't work with bold/underlines
|
||||
auto range = this->TextDocument->GetRange(0, this->TextDocument->Selection->EndPosition);
|
||||
|
||||
if (range != nullptr)
|
||||
{
|
||||
range->CharacterFormat->Bold = FormatEffect::Off;
|
||||
range->CharacterFormat->Underline = UnderlineType::None;
|
||||
}
|
||||
|
||||
auto newVal = GetMathTextProperty();
|
||||
if (MathText != newVal)
|
||||
{
|
||||
|
@@ -330,9 +330,6 @@ void EquationInputArea::SubmitTextbox(TextBox ^ sender)
|
||||
{
|
||||
val = validateDouble(sender->Text, variableViewModel->Value);
|
||||
variableViewModel->Value = val;
|
||||
|
||||
// Assign back to val in case it gets changed due to min/max
|
||||
val = variableViewModel->Value;
|
||||
}
|
||||
else if (sender->Name == "MinTextBox")
|
||||
{
|
||||
|
Reference in New Issue
Block a user