Numworks Epsilon  1.4.1
Graphing Calculator Operating System
prediction_parameter_controller.cpp
Go to the documentation of this file.
2 #include <assert.h>
3 
4 using namespace Shared;
5 
6 namespace Regression {
7 
8 PredictionParameterController::PredictionParameterController(Responder * parentResponder, Store * store, CurveViewCursor * cursor, GraphController * graphController) :
9  ViewController(parentResponder),
10  m_selectableTableView(this),
11  m_goToParameterController(this, store, cursor, graphController)
12 {
13 }
14 
16  return I18n::translate(I18n::Message::RegressionSlope);
17 }
18 
20  return &m_selectableTableView;
21 }
22 
24  if (selectedRow() < 0) {
26  }
27  app()->setFirstResponder(&m_selectableTableView);
28 }
29 
31  if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
32  m_goToParameterController.setXPrediction(selectedRow() == 0);
34  stack->push(&m_goToParameterController);
35  return true;
36  }
37  return false;
38 }
39 
41  return k_totalNumberOfCells;
42 };
43 
45  assert(index >= 0);
46  assert(index < k_totalNumberOfCells);
47  return &m_cells[index];
48 }
49 
51  return k_totalNumberOfCells;
52 }
53 
56 }
57 
60  I18n::Message titles[2] = {I18n::Message::XPrediction, I18n::Message::YPrediction};
61  myCell->setMessage(titles[index]);
62 }
63 
64 }
bool handleEvent(Ion::Events::Event event) override
void willDisplayCellForIndex(HighlightCell *cell, int index) override
#define assert(e)
Definition: assert.h:9
constexpr Event EXE
Definition: events.h:114
int16_t KDCoordinate
Definition: coordinate.h:6
void push(ViewController *vc, KDColor textColor=Palette::SubTab, KDColor backgroundColor=KDColorWhite, KDColor separatorColor=Palette::GreyBright)
Responder * parentResponder() const
Definition: responder.cpp:12
enum Message uint16_t enum Language uint16_t const char * translate(Message m, Language l=(Language) 0)
Definition: i18n.cpp:5
void setMessage(I18n::Message message)
static constexpr KDCoordinate ParameterCellHeight
Definition: metric.h:15
void setFirstResponder(Responder *responder)
Definition: app.cpp:62
Definition: view.h:23
constexpr Event Right
Definition: events.h:64
App * app()
Definition: responder.cpp:77
constexpr Event OK
Definition: events.h:65