mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 18:20:14 +01:00
[apps/shared] SumGraphController keeps 2 text buffers for its editable
zone (to be able to abort editing and find back the previous text)
This commit is contained in:
@@ -157,9 +157,11 @@ SumGraphController::LegendView::LegendView(SumGraphController * controller, Inpu
|
||||
m_sum(0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_sumLayout(),
|
||||
m_legend(k_font, I18n::Message::Default, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_editableZone(controller, nullptr, TextField::maxBufferSize(), TextField::maxBufferSize(), inputEventHandlerDelegate, controller, k_font, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_editableZone(controller, m_textBuffer, k_editableZoneBufferSize, TextField::maxBufferSize(), inputEventHandlerDelegate, controller, k_font, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_sumSymbol(sumSymbol)
|
||||
{}
|
||||
{
|
||||
m_textBuffer[0] = 0;
|
||||
}
|
||||
|
||||
void SumGraphController::LegendView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), Palette::GreyMiddle);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define SHARED_SUM_GRAPH_CONTROLLER_H
|
||||
|
||||
#include <escher.h>
|
||||
#include <poincare/print_float.h>
|
||||
#include "function_graph_view.h"
|
||||
#include "vertical_cursor_view.h"
|
||||
#include "simple_interactive_curve_view_controller.h"
|
||||
@@ -56,6 +57,7 @@ private:
|
||||
void setEditableZone(double d);
|
||||
void setSumSymbol(Step step, double start, double end, double result, Poincare::Layout functionLayout);
|
||||
private:
|
||||
constexpr static KDCoordinate k_editableZoneBufferSize = Poincare::PrintFloat::k_maxFloatBufferSize;
|
||||
constexpr static KDCoordinate k_legendHeight = 35;
|
||||
constexpr static const KDFont * k_font = KDFont::SmallFont;
|
||||
static KDCoordinate editableZoneWidth() { return 12*k_font->glyphSize().width(); }
|
||||
@@ -70,6 +72,7 @@ private:
|
||||
Poincare::Layout m_sumLayout;
|
||||
MessageTextView m_legend;
|
||||
TextField m_editableZone;
|
||||
char m_textBuffer[k_editableZoneBufferSize];
|
||||
CodePoint m_sumSymbol;
|
||||
};
|
||||
FunctionGraphView * m_graphView;
|
||||
|
||||
Reference in New Issue
Block a user