mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 09:10:48 +01:00
38 lines
1.4 KiB
C++
38 lines
1.4 KiB
C++
#ifndef APPS_TOOL_BOX_CONTROLLER_H
|
|
#define APPS_TOOL_BOX_CONTROLLER_H
|
|
|
|
#include <escher.h>
|
|
#include "node.h"
|
|
|
|
/* m_toolBoxModel points at the node of the tree (describing the whole toolbox)
|
|
* where we are located. It enables to know which rows are leaves and which are
|
|
* subtrees. */
|
|
|
|
class ToolBoxController : public StackViewController, public ListViewDataSource {
|
|
public:
|
|
ToolBoxController();
|
|
const char * title() const override;
|
|
bool handleEvent(Ion::Events::Event event) override;
|
|
void didBecomeFirstResponder() override;
|
|
int numberOfRows() override;
|
|
TableViewCell * reusableCell(int index, int type) override;
|
|
int reusableCellCount(int type) override;
|
|
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
|
KDCoordinate rowHeight(int j) override;
|
|
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
|
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
|
int typeAtLocation(int i, int j) override;
|
|
void setTextFieldCaller(TextField * textField);
|
|
private:
|
|
constexpr static int k_maxNumberOfDisplayedRows = 6; //240/40
|
|
constexpr static KDCoordinate k_commandRowHeight = 50;
|
|
constexpr static KDCoordinate k_menuRowHeight = 40;
|
|
MenuListCell m_commandCells[k_maxNumberOfDisplayedRows];
|
|
MenuListCell m_menuCells[k_maxNumberOfDisplayedRows];
|
|
SelectableTableView m_selectableTableView;
|
|
TextField * m_textFieldCaller;
|
|
Node * m_toolBoxModel;
|
|
};
|
|
|
|
#endif
|