Numworks Epsilon  1.4.1
Graphing Calculator Operating System
store_parameter_controller.cpp
Go to the documentation of this file.
2 #include <assert.h>
3 
4 namespace Shared {
5 
7  ViewController(parentResponder),
8  m_deleteColumn(I18n::Message::ClearColumn),
9 #if COPY_IMPORT_LIST
10  m_copyColumn(I18n::Message::CopyColumnInList),
11  m_importList(I18n::Message::ImportList),
12 #endif
13  m_selectableTableView(this, this, this),
14  m_store(store),
15  m_xColumnSelected(true)
16 {
17 }
18 
19 void StoreParameterController::selectXColumn(bool xColumnSelected) {
20  m_xColumnSelected = xColumnSelected;
21 }
22 
24  return I18n::translate(I18n::Message::ColumnOptions);
25 }
26 
28  return &m_selectableTableView;
29 }
30 
33  app()->setFirstResponder(&m_selectableTableView);
34 }
35 
37  if (event == Ion::Events::OK || event == Ion::Events::EXE) {
38  switch (selectedRow()) {
39  case 0:
40  {
41  if (m_xColumnSelected) {
42  m_store->deleteAllPairs();
43  } else {
44  m_store->resetColumn(!m_xColumnSelected);
45  }
47  stack->pop();
48  return true;
49  }
50 #if COPY_IMPORT_LIST
51  /* TODO: implement copy column and import list */
52  case 1:
53  return true;
54  case 2:
55  return true;
56 #endif
57  default:
58  assert(false);
59  return false;
60  }
61  }
62  return false;
63 }
64 
66  return k_totalNumberOfCell;
67 };
68 
70  assert(index >= 0);
71  assert(index < k_totalNumberOfCell);
72  HighlightCell * cells[] = {&m_deleteColumn};// {&m_deleteColumn, &m_copyColumn, &m_importList};
73  return cells[index];
74 }
75 
77  return k_totalNumberOfCell;
78 }
79 
82 }
83 
84 }
Definition: i18n.h:6
#define assert(e)
Definition: assert.h:9
constexpr Event EXE
Definition: events.h:114
int16_t KDCoordinate
Definition: coordinate.h:6
Responder * parentResponder() const
Definition: responder.cpp:12
StoreParameterController(Responder *parentResponder, FloatPairStore *store)
bool handleEvent(Ion::Events::Event event) override
enum Message uint16_t enum Language uint16_t const char * translate(Message m, Language l=(Language) 0)
Definition: i18n.cpp:5
HighlightCell * reusableCell(int index) override
static constexpr KDCoordinate ParameterCellHeight
Definition: metric.h:15
void setFirstResponder(Responder *responder)
Definition: app.cpp:62
Definition: view.h:23
App * app()
Definition: responder.cpp:77
constexpr Event OK
Definition: events.h:65
#define true
Definition: stdbool.h:8