Numworks Epsilon  1.4.1
Graphing Calculator Operating System
range_parameter_controller.h
Go to the documentation of this file.
1 #ifndef SHARED_RANGE_PARAMETER_CONTROLLER_H
2 #define SHARED_RANGE_PARAMETER_CONTROLLER_H
3 
4 #include <escher.h>
7 
8 namespace Shared {
9 
11 public:
13  const char * title() override;
14  int numberOfRows() override;
15  int typeAtLocation(int i, int j) override;
16  void willDisplayCellForIndex(HighlightCell * cell, int index) override;
17  bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
18  bool handleEvent(Ion::Events::Event event) override;
19 private:
20  class MessageTableCellWithConvertibleEditableText : public MessageTableCellWithEditableText {
21  public:
22  MessageTableCellWithConvertibleEditableText(Responder * parentResponder, TextFieldDelegate * textFieldDelegate, char * draftTextBuffer, I18n::Message message, InteractiveCurveViewRange * interactiveCurveViewRange) :
23  MessageTableCellWithEditableText(parentResponder, textFieldDelegate, draftTextBuffer, message),
24  m_interactiveRange(interactiveCurveViewRange) {}
25  Responder * responder() override {
26  if (m_interactiveRange->yAuto()) {
27  return nullptr;
28  } else {
29  return this;
30  }
31  }
32  private:
33  InteractiveCurveViewRange * m_interactiveRange;
34  };
35  HighlightCell * reusableParameterCell(int index, int type) override;
36  int reusableParameterCellCount(int type) override;
37  double parameterAtIndex(int index) override;
38  bool setParameterAtIndex(int parameterIndex, double f) override;
39  View * loadView() override;
40  void unloadView(View * view) override;
41  constexpr static int k_numberOfEditableTextCell = 2;
42  constexpr static int k_numberOfConvertibleTextCell = 2;
43  constexpr static int k_numberOfTextCell = k_numberOfEditableTextCell+k_numberOfConvertibleTextCell;
44  InteractiveCurveViewRange * m_interactiveRange;
46  MessageTableCellWithEditableText * m_xRangeCells[k_numberOfEditableTextCell];
47  MessageTableCellWithConvertibleEditableText * m_yRangeCells[k_numberOfConvertibleTextCell];
48  MessageTableCellWithSwitch * m_yAutoCell;
49 };
50 
51 }
52 
53 #endif
bool textFieldDidFinishEditing(TextField *textField, const char *text, Ion::Events::Event event) override
void willDisplayCellForIndex(HighlightCell *cell, int index) override
Responder * parentResponder() const
Definition: responder.cpp:12
RangeParameterController(Responder *parentResponder, InteractiveCurveViewRange *interactiveCurveViewRange)
bool handleEvent(Ion::Events::Event event) override
Definition: view.h:23