Blame view

epsilon-master/apps/shared/scrollable_exact_approximate_expressions_cell.cpp 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
37
38
39
40
41
42
43
44
45
46
47
  #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);
    reloadScroll();
  }
  
  void ScrollableExactApproximateExpressionsCell::setEven(bool even) {
    EvenOddCell::setEven(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(KDRect(k_margin,k_margin, bounds().width()-2*k_margin, bounds().height()-2*k_margin));
  }
  
  }