mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[geometry] Also not working
This commit is contained in:
@@ -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)
|
||||
|
||||
23
apps/geometry/figures/figure.h
Normal file
23
apps/geometry/figures/figure.h
Normal 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
|
||||
@@ -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
|
||||
};
|
||||
|
||||
14
apps/geometry/figures/point.h
Normal file
14
apps/geometry/figures/point.h
Normal 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
|
||||
@@ -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 {
|
||||
|
||||
12
apps/geometry/list/figure_definition_type.h
Normal file
12
apps/geometry/list/figure_definition_type.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef GEOMETRY_FIGURE_DEFINITION_TYPE_H
|
||||
#define GEOMETRY_FIGURE_DEFINITION_TYPE_H
|
||||
|
||||
namespace Geometry {
|
||||
|
||||
class FigureDefinitionType {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user