Blame view

build6/epsilon-master/apps/probability/calculation_cell.h 1.23 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  #ifndef PROBABILITY_CALCULATION_CELL_H
  #define PROBABILITY_CALCULATION_CELL_H
  
  #include <escher.h>
  
  namespace Probability {
  
  class CalculationCell : public HighlightCell {
  public:
    CalculationCell(Responder * parentResponder = nullptr, char * draftTextBuffer = nullptr, TextFieldDelegate * textFieldDelegate = nullptr);
    Responder * responder() override;
    void setResponder(bool shouldbeResponder);
    void setHighlighted(bool highlight) override;
    KDSize minimalSizeForOptimalDisplay() const override;
    void drawRect(KDContext * ctx, KDRect rect) const override;
    EditableTextCell * editableTextCell();
    MessageTextView * messageTextView();
    const char * text() const override {
      return m_calculation.text();
    }
  private:
    constexpr static KDCoordinate k_margin = 5;
    constexpr static KDCoordinate k_minTextFieldWidth = 4*KDText::charSize().width()+TextCursorView::k_width;
    constexpr static KDCoordinate k_maxTextFieldWidth = 14*KDText::charSize().width()+TextCursorView::k_width;
    int numberOfSubviews() const override;
    View * subviewAtIndex(int index) override;
    void layoutSubviews() override;
    KDCoordinate calculationCellWidth() const;
    MessageTextView m_text;
    EditableTextCell m_calculation;
    bool m_isResponder;
  };
  
  }
  
  #endif