mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[shared] Add a class ScrollableExactApproximateExpressionsCell
This commit is contained in:
@@ -39,6 +39,7 @@ app_objs += $(addprefix apps/shared/,\
|
||||
range_parameter_controller.o\
|
||||
regular_table_view_data_source.o\
|
||||
round_cursor_view.o\
|
||||
scrollable_exact_approximate_expressions_cell.o\
|
||||
scrollable_exact_approximate_expressions_view.o\
|
||||
simple_interactive_curve_view_controller.o\
|
||||
expression_layout_field_delegate.o\
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#include "scrollable_exact_approximate_expressions_cell.h"
|
||||
#include <assert.h>
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Shared {
|
||||
|
||||
ScrollableExactApproximateExpressionsCell::ScrollableExactApproximateExpressionsCell(Responder * parentResponder) :
|
||||
Responder(parentResponder),
|
||||
m_view(this)
|
||||
{
|
||||
}
|
||||
|
||||
void ScrollableExactApproximateExpressionsCell::setHighlighted(bool highlight) {
|
||||
m_view.evenOddCell()->setHighlighted(highlight);
|
||||
}
|
||||
void ScrollableExactApproximateExpressionsCell::setEven(bool even) {
|
||||
m_view.evenOddCell()->setEven(even);
|
||||
}
|
||||
void ScrollableExactApproximateExpressionsCell::reloadCell() {
|
||||
m_view.evenOddCell()->reloadCell();
|
||||
}
|
||||
|
||||
void ScrollableExactApproximateExpressionsCell::reloadScroll() {
|
||||
m_view.reloadScroll();
|
||||
}
|
||||
|
||||
void ScrollableExactApproximateExpressionsCell::didBecomeFirstResponder() {
|
||||
app()->setFirstResponder(&m_view);
|
||||
}
|
||||
|
||||
int ScrollableExactApproximateExpressionsCell::numberOfSubviews() const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
View * ScrollableExactApproximateExpressionsCell::subviewAtIndex(int index) {
|
||||
return &m_view;
|
||||
}
|
||||
|
||||
void ScrollableExactApproximateExpressionsCell::layoutSubviews() {
|
||||
m_view.setFrame(bounds());
|
||||
}
|
||||
|
||||
}
|
||||
35
apps/shared/scrollable_exact_approximate_expressions_cell.h
Normal file
35
apps/shared/scrollable_exact_approximate_expressions_cell.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef SHARED_SCROLLABLE_EXACT_APPROXIMATE_EXPRESSIONS_CELL_H
|
||||
#define SHARED_SCROLLABLE_EXACT_APPROXIMATE_EXPRESSIONS_CELL_H
|
||||
|
||||
#include <escher.h>
|
||||
#include "scrollable_exact_approximate_expressions_view.h"
|
||||
|
||||
namespace Shared {
|
||||
|
||||
class ScrollableExactApproximateExpressionsCell : public ::EvenOddCell, public Responder {
|
||||
public:
|
||||
ScrollableExactApproximateExpressionsCell(Responder * parentResponder = nullptr);
|
||||
void setExpressions(Poincare::ExpressionLayout ** expressionsLayout) {
|
||||
return m_view.setExpressions(expressionsLayout);
|
||||
}
|
||||
void setEqualMessage(I18n::Message equalSignMessage) {
|
||||
return m_view.setEqualMessage(equalSignMessage);
|
||||
}
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setEven(bool even) override;
|
||||
void reloadCell() override;
|
||||
void reloadScroll();
|
||||
Responder * responder() override {
|
||||
return this;
|
||||
}
|
||||
void didBecomeFirstResponder() override;
|
||||
private:
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
ScrollableExactApproximateExpressionsView m_view;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user