Numworks Epsilon  1.4.1
Graphing Calculator Operating System
go_to_parameter_controller.cpp
Go to the documentation of this file.
3 #include <assert.h>
4 
5 namespace Shared {
6 
7 GoToParameterController::GoToParameterController(Responder * parentResponder, InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor, I18n::Message symbol) :
8  FloatParameterController(parentResponder),
9  m_cursor(cursor),
10  m_graphRange(graphRange),
11  m_abscisseCell(nullptr),
12  m_abscissaSymbol(symbol)
13 {
14 }
15 
17  return 2;
18 }
19 
20 HighlightCell * GoToParameterController::reusableParameterCell(int index, int type) {
21  assert(index == 0);
22  return m_abscisseCell;
23 }
24 
25 int GoToParameterController::reusableParameterCellCount(int type) {
26  return 1;
27 }
28 
30  if (event == Ion::Events::Left) {
31  stackController()->pop();
32  return true;
33  }
34  return false;
35 }
36 
37 void GoToParameterController::buttonAction() {
39  stack->pop();
40  stack->pop();
41 }
42 
43 View * GoToParameterController::loadView() {
45  m_abscisseCell = new MessageTableCellWithEditableText(tableView, this, m_draftTextBuffer, m_abscissaSymbol);
46  return tableView;
47 }
48 
49 void GoToParameterController::unloadView(View * view) {
50  delete m_abscisseCell;
51  m_abscisseCell = nullptr;
53 }
54 
55 }
#define assert(e)
Definition: assert.h:9
Responder * parentResponder() const
Definition: responder.cpp:12
bool handleEvent(Ion::Events::Event event) override
constexpr Event Left
Definition: events.h:61
Definition: view.h:23
GoToParameterController(Responder *parentResponder, InteractiveCurveViewRange *graphRange, CurveViewCursor *cursor, I18n::Message symbol)