diff --git a/apps/regression/store_controller.h b/apps/regression/store_controller.h index 3de9511d9..6da10235c 100644 --- a/apps/regression/store_controller.h +++ b/apps/regression/store_controller.h @@ -11,7 +11,8 @@ namespace Regression { class StoreController : public Shared::StoreController { public: StoreController(Responder * parentResponder, Store * store, ButtonRowController * header); - void fillColumnWithFormula(Poincare::Expression * formula) {} + void setFormulaLabel() override {} //TODO + void fillColumnWithFormula(Poincare::Expression * formula) override {} //TODO void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override; private: HighlightCell * titleCells(int index) override; diff --git a/apps/shared/buffer_text_view_with_text_field.cpp b/apps/shared/buffer_text_view_with_text_field.cpp index 112ca1216..1f27faaef 100644 --- a/apps/shared/buffer_text_view_with_text_field.cpp +++ b/apps/shared/buffer_text_view_with_text_field.cpp @@ -5,11 +5,10 @@ namespace Shared { BufferTextViewWithTextField::BufferTextViewWithTextField(Responder * parentResponder, TextFieldDelegate * delegate, KDText::FontSize size) : View(), Responder(parentResponder), - m_bufferTextView(size, 0.0f, 0.5f), + m_bufferTextView(size, 1.0f, 0.5f), m_textField(this, m_textFieldBuffer, m_textFieldBuffer, k_textFieldBufferSize, delegate, false, size, 0.0f, 0.5f), m_textFieldBuffer{} { - m_bufferTextView.setText("TODO"); } KDSize BufferTextViewWithTextField::minimalSizeForOptimalDisplay() const { diff --git a/apps/shared/store_controller.cpp b/apps/shared/store_controller.cpp index 54752db42..a7e360236 100644 --- a/apps/shared/store_controller.cpp +++ b/apps/shared/store_controller.cpp @@ -58,6 +58,7 @@ StoreController::StoreController(Responder * parentResponder, FloatPairStore * s } void StoreController::displayFormulaInput() { + setFormulaLabel(); contentView()->displayFormulaInput(true); } diff --git a/apps/shared/store_controller.h b/apps/shared/store_controller.h index 2e2b1b5b0..9164c1044 100644 --- a/apps/shared/store_controller.h +++ b/apps/shared/store_controller.h @@ -16,6 +16,7 @@ public: StoreController(Responder * parentResponder, FloatPairStore * store, ButtonRowController * header); void displayFormulaInput(); + virtual void setFormulaLabel() = 0; virtual void fillColumnWithFormula(Poincare::Expression * formula) = 0; // TextFieldDelegate diff --git a/apps/statistics/store_controller.cpp b/apps/statistics/store_controller.cpp index b0ebad399..c17b5974c 100644 --- a/apps/statistics/store_controller.cpp +++ b/apps/statistics/store_controller.cpp @@ -19,12 +19,18 @@ StoreController::StoreController(Responder * parentResponder, Store * store, But { } +void StoreController::setFormulaLabel() { + int series = selectedColumn() / Store::k_numberOfColumnsPerSeries; + int isValueColumn = selectedColumn() % Store::k_numberOfColumnsPerSeries == 0; + char text[] = {isValueColumn ? 'V' : 'N', static_cast('1' + series), '=', 0}; + static_cast(view())->formulaInputView()->setBufferText(text); +} + void StoreController::fillColumnWithFormula(Expression * formula) { int currentColumn = selectedColumn(); // Fetch the series used in the formula to compute the size of the filled in series char variables[7] = {0, 0, 0, 0, 0, 0, 0}; - int numberOfVariables = formula->getVariables(Symbol::isSeriesSymbol, variables); - assert(numberOfVariables >= 0); + formula->getVariables(Symbol::isSeriesSymbol, variables); int numberOfValuesToCompute = -1; int index = 0; while (variables[index] != 0) { diff --git a/apps/statistics/store_controller.h b/apps/statistics/store_controller.h index 6a7d20143..9e81df313 100644 --- a/apps/statistics/store_controller.h +++ b/apps/statistics/store_controller.h @@ -11,6 +11,7 @@ namespace Statistics { class StoreController : public Shared::StoreController { public: StoreController(Responder * parentResponder, Store * store, ButtonRowController * header); + void setFormulaLabel() override; void fillColumnWithFormula(Poincare::Expression * formula) override; void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override; private: