[apps] Access *DelegateApp() through app()

This commit is contained in:
Ruben Dashyan
2019-06-06 17:01:04 +02:00
committed by EmilieNumworks
parent 2888eddd06
commit 4111927bae
6 changed files with 10 additions and 10 deletions

View File

@@ -69,7 +69,7 @@ bool EditExpressionController::textFieldDidReceiveEvent(::TextField * textField,
if (inputViewDidReceiveEvent(event, shouldDuplicateLastCalculation)) {
return true;
}
return textFieldDelegateApp()->textFieldDidReceiveEvent(textField, event);
return app()->textFieldDidReceiveEvent(textField, event);
}
bool EditExpressionController::textFieldDidFinishEditing(::TextField * textField, const char * text, Ion::Events::Event event) {
@@ -85,7 +85,7 @@ bool EditExpressionController::layoutFieldDidReceiveEvent(::LayoutField * layout
if (inputViewDidReceiveEvent(event, shouldDuplicateLastCalculation)) {
return true;
}
return expressionFieldDelegateApp()->layoutFieldDidReceiveEvent(layoutField, event);
return app()->layoutFieldDidReceiveEvent(layoutField, event);
}
bool EditExpressionController::layoutFieldDidFinishEditing(::LayoutField * layoutField, Layout layoutR, Ion::Events::Event event) {

View File

@@ -33,18 +33,18 @@ void TangentGraphController::viewWillAppear() {
void TangentGraphController::didBecomeFirstResponder() {
if (curveView()->isMainViewSelected()) {
m_bannerView->abscissaValue()->setParentResponder(this);
m_bannerView->abscissaValue()->setDelegates(textFieldDelegateApp(), this);
m_bannerView->abscissaValue()->setDelegates(app(), this);
app()->setFirstResponder(m_bannerView->abscissaValue());
}
}
bool TangentGraphController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
double floatBody;
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
if (app()->hasUndefinedValue(text, floatBody)) {
return false;
}
ExpiringPointer<CartesianFunction> function = app()->functionStore()->modelForRecord(m_record);
double y = function->evaluateAtAbscissa(floatBody, textFieldDelegateApp()->localContext());
double y = function->evaluateAtAbscissa(floatBody, app()->localContext());
m_cursor->moveTo(floatBody, y);
interactiveCurveViewRange()->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
reloadBannerView();

View File

@@ -211,7 +211,7 @@ bool CalculationController::textFieldShouldFinishEditing(TextField * textField,
bool CalculationController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
double floatBody;
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
if (app()->hasUndefinedValue(text, floatBody)) {
return false;
}
if (m_calculation->type() != Calculation::Type::FiniteIntegral && selectedColumn() == 2) {

View File

@@ -62,11 +62,11 @@ float GraphController::interestingXHalfRange() const {
bool GraphController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
double floatBody;
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
if (app()->hasUndefinedValue(text, floatBody)) {
return false;
}
floatBody = std::fmax(0, std::round(floatBody));
double y = yValue(selectedCurveIndex(), floatBody, textFieldDelegateApp()->localContext());
double y = yValue(selectedCurveIndex(), floatBody, app()->localContext());
m_cursor->moveTo(floatBody, y);
interactiveCurveViewRange()->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
reloadBannerView();

View File

@@ -72,7 +72,7 @@ bool ListParameterController::textFieldDidFinishEditing(TextField * textField, c
/* -1 to take into account a double recursive sequence, which has
* SecondIndex = FirstIndex + 1 */
double floatBody;
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
if (app()->hasUndefinedValue(text, floatBody)) {
return false;
}
int index = std::round(floatBody);

View File

@@ -78,7 +78,7 @@ bool DisplayModeController::textFieldShouldFinishEditing(TextField * textField,
bool DisplayModeController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
double floatBody;
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
if (app()->hasUndefinedValue(text, floatBody)) {
return false;
}
if (floatBody < 1) {