[geometry] Also not working

This commit is contained in:
Laury
2021-12-06 20:43:13 +01:00
parent 6aad7d2279
commit 3ccfdf0365
11 changed files with 102 additions and 7 deletions

View File

@@ -7,6 +7,8 @@ app_geometry_src = $(addprefix apps/geometry/,\
list/definition_type_controller.cpp \
list/figure_type_controller.cpp \
list/figure_parameters_controller.cpp \
list/objects_controller.cpp \
list/message_table_cell_with_selector.cpp \
)
apps_src += $(app_geometry_src)

View File

@@ -0,0 +1,23 @@
#ifndef POINCARE_FIGURE_H
#define POINCARE_FIGURE_H
using namespace Poincare;
namespace Geometry {
class FigureNode final : public TreeNode {
public:
FigureNode(const native_uint_t * digits, uint8_t numberOfDigits);
// TreeNode
size_t size() const override;
int numberOfChildren() const override { return 0; }
virtual FigureType type() const = 0;
};
class Figure final : public TreeHandle {
};
}
#endif

View File

@@ -7,6 +7,7 @@ enum class FigureType {
None = 0, // Used to trigger assert in debug mode
Number, // It's not a real figure type but we use it to build figures like points
Point,
Line
Circle
};

View File

@@ -0,0 +1,14 @@
#ifndef GEOMETRY_POINT_H
#define GEOMETRY_POINT_H
namespace Geometry {
class PointNode : public FigureNode {
size_t size() const override { return sizeof(PointNode); }
}
class Point : public Figure
}
#endif

View File

@@ -3,7 +3,7 @@
#include <escher.h>
#include "apps/i18n.h"
#include "../figure_type.h"
#include "../figure/figure_type.h"
#include "figure_parameters_controller.h"
namespace Geometry {

View File

@@ -0,0 +1,12 @@
#ifndef GEOMETRY_FIGURE_DEFINITION_TYPE_H
#define GEOMETRY_FIGURE_DEFINITION_TYPE_H
namespace Geometry {
class FigureDefinitionType {
}
}
#endif

View File

@@ -6,7 +6,9 @@ FigureParametersController::FigureParametersController(Responder * parentRespond
ViewController(parentResponder),
m_selectableTableView(this)
{
for (int i = 0; i < k_choiceCells; i++) {
m_choicesCells[i].setParentResponder(&m_selectableTableView);
}
}
void FigureParametersController::didBecomeFirstResponder() {

View File

@@ -1,4 +1,5 @@
#include "message_table_cell_with_selector.h"
#include <escher/container.h>
namespace Geometry {
@@ -6,14 +7,15 @@ MessageTableCellWithSelector::MessageTableCellWithSelector(ToolboxMessageTree *
Responder(nullptr),
MessageTableCell((I18n::Message)0, font),
m_objectsRoot(root),
m_selectedMessage(nullptr)
m_selectedMessage(nullptr),
m_toolbox(this)
{
}
MessageTableCellWithSelector::handleEvent(Ion::Events::Event event) {
bool MessageTableCellWithSelector::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
//Container::activeApp()->displayModalViewController(m_toolbox, 0.f, 0.f)
Container::activeApp()->displayModalViewController(&m_toolbox, 0.f, 0.f, Metric::PopUpTopMargin, Metric::PopUpLeftMargin, 0, Metric::PopUpRightMargin);
return true;
}
return false;

View File

@@ -12,6 +12,9 @@ public:
MessageTableCellWithSelector(ToolboxMessageTree * root = nullptr, const KDFont * font = KDFont::SmallFont);
ToolboxMessageTree * getSelectedMessage() const { return m_selectedMessage; };
bool handleEvent(Ion::Events::Event event);
Responder * responder() override {
return this;
}
private:
ToolboxMessageTree * m_objectsRoot;
ToolboxMessageTree * m_selectedMessage;

View File

@@ -0,0 +1,35 @@
#include "objects_controller.h"
namespace Geometry {
ObjectsController::ObjectsController(Responder * responder) :
NestedMenuController(this)
{
}
int ObjectsController::numberOfRows() const {
return 0;
}
int ObjectsController::reusableCellCount(int type) {
return 0;
}
int ObjectsController::typeAtLocation(int i, int j) {
return 0;
}
bool ObjectsController::selectLeaf(int type) {
return false;
}
HighlightCell * ObjectsController::leafCellAtIndex(int index) {
return nullptr;
}
HighlightCell * ObjectsController::nodeCellAtIndex(int index) {
return nullptr;
}
}

View File

@@ -1,11 +1,12 @@
#ifndef APPS_MATH_VARIABLE_BOX_CONTROLLER_H
#define APPS_MATH_VARIABLE_BOX_CONTROLLER_H
#ifndef GEOMETRY_OBJECTS_CONTROLLER_H
#define GEOMETRY_OBJECTS_CONTROLLER_H
#include <escher/nested_menu_controller.h>
namespace Geometry {
class ObjectsController : public NestedMenuController {
public:
ObjectsController(Responder * parentResponder);
virtual int numberOfRows() const override;
virtual int reusableCellCount(int type) override;