Numworks Epsilon  1.4.1
Graphing Calculator Operating System
python_toolbox.h
Go to the documentation of this file.
1 #ifndef CODE_PYTHON_TOOLBOX_H
2 #define CODE_PYTHON_TOOLBOX_H
3 
4 #include <apps/i18n.h>
5 #include <escher.h>
6 #include <ion/events.h>
7 #include <kandinsky/text.h>
8 
9 namespace Code {
10 
11 class PythonToolbox : public Toolbox {
12 public:
13  typedef void (*Action)(void * sender, const char * text);
14  PythonToolbox();
15 
16  // StackViewController
17  bool handleEvent(Ion::Events::Event event) override;
18 protected:
19  KDCoordinate rowHeight(int j) override;
20  bool selectLeaf(ToolboxMessageTree * selectedMessageTree) override;
21  const ToolboxMessageTree * rootModel() override;
22  MessageTableCellWithMessage * leafCellAtIndex(int index) override;
23  MessageTableCellWithChevron* nodeCellAtIndex(int index) override;
24  int maxNumberOfDisplayedRows() override;
25  constexpr static int k_maxNumberOfDisplayedRows = 13; // = 240/(13+2*3)
26  // 13 = minimal string height size
27  // 3 = vertical margins
28 private:
29  constexpr static KDText::FontSize k_fontSize = KDText::FontSize::Small;
30  void scrollToLetter(char letter);
31  void scrollToAndSelectChild(int i);
34 };
35 
36 }
37 
38 #endif
void(* Action)(void *sender, const char *text)
bool selectLeaf(ToolboxMessageTree *selectedMessageTree) override
int16_t KDCoordinate
Definition: coordinate.h:6
MessageTableCellWithChevron * nodeCellAtIndex(int index) override
const ToolboxMessageTree * rootModel() override
MessageTableCellWithMessage * leafCellAtIndex(int index) override
Definition: app.cpp:7
static constexpr int k_maxNumberOfDisplayedRows
virtual Responder * sender()
Definition: toolbox.cpp:238
int maxNumberOfDisplayedRows() override
KDCoordinate rowHeight(int j) override
bool handleEvent(Ion::Events::Event event) override
FontSize
Definition: text.h:10