mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps] Don't forget to call viewWillAppear
At the moment ViewController::viewWillAppear doesn't do anything, so there is no real impact. But if we want to use it it needs to be called from subclasses.
This commit is contained in:
@@ -37,6 +37,7 @@ void HistoryController::reload() {
|
||||
}
|
||||
|
||||
void HistoryController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
@@ -162,6 +162,7 @@ const char * ConsoleController::inputText(const char * prompt) {
|
||||
}
|
||||
|
||||
void ConsoleController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
loadPythonEnvironment();
|
||||
if (m_importScriptsWhenViewAppears) {
|
||||
m_importScriptsWhenViewAppears = false;
|
||||
|
||||
@@ -59,6 +59,7 @@ void EditorController::didBecomeFirstResponder() {
|
||||
}
|
||||
|
||||
void EditorController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
m_editorView.loadSyntaxHighlighter();
|
||||
m_editorView.setCursorLocation(m_editorView.text() + strlen(m_editorView.text()));
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ void MenuController::didBecomeFirstResponder() {
|
||||
}
|
||||
|
||||
void MenuController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
updateAddScriptRowDisplay();
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ bool ScriptParameterController::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
|
||||
void ScriptParameterController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
m_selectableTableView.reloadData();
|
||||
m_selectableTableView.selectCellAtLocation(0,0);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ CalculationGraphController::CalculationGraphController(Responder * parentRespond
|
||||
}
|
||||
|
||||
void CalculationGraphController::viewWillAppear() {
|
||||
Shared::SimpleInteractiveCurveViewController::viewWillAppear();
|
||||
assert(!m_record.isNull());
|
||||
Coordinate2D<double> pointOfInterest = computeNewPointOfInterestFromAbscissa(m_graphRange->xMin(), 1);
|
||||
if (std::isnan(pointOfInterest.x1())) {
|
||||
|
||||
@@ -33,6 +33,7 @@ View * CalculationParameterController::view() {
|
||||
}
|
||||
|
||||
void CalculationParameterController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
m_selectableTableView.reloadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ int CurveParameterController::reusableCellCount() const {
|
||||
}
|
||||
|
||||
void CurveParameterController::viewWillAppear() {
|
||||
Shared::FunctionCurveParameterController::viewWillAppear();
|
||||
m_selectableTableView.reloadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ const char * TangentGraphController::title() {
|
||||
}
|
||||
|
||||
void TangentGraphController::viewWillAppear() {
|
||||
Shared::SimpleInteractiveCurveViewController::viewWillAppear();
|
||||
m_graphRange->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
|
||||
m_graphView->drawTangent(true);
|
||||
m_graphView->setOkView(nullptr);
|
||||
|
||||
@@ -42,6 +42,7 @@ const char * TypeParameterController::title() {
|
||||
}
|
||||
|
||||
void TypeParameterController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
App * myApp = App::app();
|
||||
assert(!m_record.isNull());
|
||||
Shared::ExpiringPointer<Shared::ContinuousFunction> function = myApp->functionStore()->modelForRecord(m_record);
|
||||
|
||||
@@ -72,6 +72,7 @@ DistributionController::DistributionController(Responder * parentResponder, Dist
|
||||
}
|
||||
|
||||
void Probability::DistributionController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
selectRow((int)m_distribution->type());
|
||||
}
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
}
|
||||
|
||||
void MainController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
m_selectableTableView.reloadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ void GenericSubController::didBecomeFirstResponder() {
|
||||
}
|
||||
|
||||
void GenericSubController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
/* This can't be done in didEnterResponderChain because we don't want it to
|
||||
* be done everytime the pop-up disappears. For example, if we are editing a
|
||||
* field and a pop-up shows up with a warning, we don't want to reload the
|
||||
|
||||
@@ -34,6 +34,7 @@ void FloatParameterController<T>::didBecomeFirstResponder() {
|
||||
|
||||
template<typename T>
|
||||
void FloatParameterController<T>::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
if (selectedRow() == -1 || selectedRow() == numberOfRows()-1) {
|
||||
selectCellAtLocation(0, 0);
|
||||
} else {
|
||||
|
||||
@@ -38,6 +38,7 @@ FunctionListController::FunctionListController(Responder * parentResponder, Butt
|
||||
/* TableViewDataSource */
|
||||
|
||||
void FunctionListController::viewWillAppear() {
|
||||
ExpressionModelListController::viewWillAppear();
|
||||
computeTitlesColumnWidth();
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ Responder * InteractiveCurveViewController::defaultController() {
|
||||
}
|
||||
|
||||
void InteractiveCurveViewController::viewWillAppear() {
|
||||
SimpleInteractiveCurveViewController::viewWillAppear();
|
||||
uint32_t newModelVersion = modelVersion();
|
||||
if (*m_modelVersion != newModelVersion) {
|
||||
if (*m_modelVersion == 0 || numberOfCurves() == 1 || shouldSetDefaultOnModelChange()) {
|
||||
|
||||
@@ -35,6 +35,7 @@ void LanguageController::didBecomeFirstResponder() {
|
||||
}
|
||||
|
||||
void LanguageController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
resetSelection();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ SumGraphController::SumGraphController(Responder * parentResponder, InputEventHa
|
||||
}
|
||||
|
||||
void SumGraphController::viewWillAppear() {
|
||||
SimpleInteractiveCurveViewController::viewWillAppear();
|
||||
m_graphRange->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
|
||||
m_graphView->setBannerView(&m_legendView);
|
||||
m_graphView->setCursorView(&m_cursorView);
|
||||
|
||||
@@ -12,6 +12,7 @@ void TabTableController::didBecomeFirstResponder() {
|
||||
}
|
||||
|
||||
void TabTableController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
selectableTableView()->reloadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ bool ZoomParameterController::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
|
||||
void ZoomParameterController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
m_contentView.curveView()->setOkView(nullptr);
|
||||
/* We need to change the curve range to keep the same visual aspect of the
|
||||
* view. */
|
||||
|
||||
@@ -27,6 +27,7 @@ Responder * MultipleDataViewController::defaultController() {
|
||||
}
|
||||
|
||||
void MultipleDataViewController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
if (*m_selectedSeriesIndex < 0 || m_store->sumOfOccurrences(*m_selectedSeriesIndex) == 0) {
|
||||
*m_selectedSeriesIndex = multipleDataView()->seriesOfSubviewAtIndex(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user