Files
Upsilon/apps/math_toolbox.h
Léa Saviot e29691e1f1 [apps/sequence] Fix the insertion of sequence terms in text fields.
For instance, the serialization of the V_n layout is "v_{n}", which is
what we want to insert in an EditableExpressionView, but not in a Text
Field for which we want "v(n)".

Change-Id: Iab38058d982322891b530b3afd2d303a266643f9
2018-01-19 17:31:37 +01:00

30 lines
1.1 KiB
C++

#ifndef APPS_MATH_TOOLBOX_H
#define APPS_MATH_TOOLBOX_H
#define MATRICES_ARE_DEFINED 1
#include <escher.h>
#include <apps/i18n.h>
#include <apps/expression_editor/controller.h>
class MathToolbox : public Toolbox {
public:
typedef void (*Action)(void * sender, const char * text, bool removeArguments);
MathToolbox();
void setSenderAndAction(Responder * sender, Action action);
static void actionForEditableExpressionView(void * sender, const char * text, bool removeArguments = true);
static void actionForTextField(void * sender, const char * text, bool removeArguments = true);
protected:
bool selectLeaf(ToolboxMessageTree * selectedMessageTree) override;
const ToolboxMessageTree * rootModel() override;
MessageTableCellWithMessage * leafCellAtIndex(int index) override;
MessageTableCellWithChevron* nodeCellAtIndex(int index) override;
int maxNumberOfDisplayedRows() override;
constexpr static int k_maxNumberOfDisplayedRows = 6; // = 240/40
Action m_action;
private:
MessageTableCellWithMessage m_leafCells[k_maxNumberOfDisplayedRows];
MessageTableCellWithChevron m_nodeCells[k_maxNumberOfDisplayedRows];
};
#endif