Numworks Epsilon  1.4.1
Graphing Calculator Operating System
calculation_cell.h
Go to the documentation of this file.
1 #ifndef PROBABILITY_CALCULATION_CELL_H
2 #define PROBABILITY_CALCULATION_CELL_H
3 
4 #include <escher.h>
5 
6 namespace Probability {
7 
8 class CalculationCell : public HighlightCell {
9 public:
10  CalculationCell(Responder * parentResponder = nullptr, char * draftTextBuffer = nullptr, TextFieldDelegate * textFieldDelegate = nullptr);
11  Responder * responder() override;
12  void setResponder(bool shouldbeResponder);
13  void setHighlighted(bool highlight) override;
14  KDSize minimalSizeForOptimalDisplay() const override;
15  void drawRect(KDContext * ctx, KDRect rect) const override;
18 private:
19  constexpr static KDCoordinate k_margin = 5;
20  constexpr static KDCoordinate k_minTextFieldWidth = 4*KDText::charSize().width()+TextCursorView::k_width;
21  constexpr static KDCoordinate k_maxTextFieldWidth = 14*KDText::charSize().width()+TextCursorView::k_width;
22  int numberOfSubviews() const override;
23  View * subviewAtIndex(int index) override;
24  void layoutSubviews() override;
25  KDCoordinate calculationCellWidth() const;
26  MessageTextView m_text;
27  EditableTextCell m_calculation;
28  bool m_isResponder;
29 };
30 
31 }
32 
33 #endif
Responder * responder() override
CalculationCell(Responder *parentResponder=nullptr, char *draftTextBuffer=nullptr, TextFieldDelegate *textFieldDelegate=nullptr)
EditableTextCell * editableTextCell()
int16_t KDCoordinate
Definition: coordinate.h:6
constexpr KDCoordinate width() const
Definition: size.h:10
KDSize minimalSizeForOptimalDisplay() const override
void drawRect(KDContext *ctx, KDRect rect) const override
static constexpr KDCoordinate k_width
Definition: size.h:6
void setResponder(bool shouldbeResponder)
MessageTextView * messageTextView()
Definition: rect.h:26
void setHighlighted(bool highlight) override
Definition: view.h:23
static constexpr KDSize charSize(FontSize size=FontSize::Large)
Definition: text.h:16