Numworks Epsilon  1.4.1
Graphing Calculator Operating System
even_odd_editable_text_cell.cpp
Go to the documentation of this file.
2 #include <escher/app.h>
3 #include <assert.h>
4 
5 EvenOddEditableTextCell::EvenOddEditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size, float horizontalAlignment, float verticalAlignment, KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin) :
6  EvenOddCell(),
7  Responder(parentResponder),
8  m_editableCell(this, delegate, draftTextBuffer, size, horizontalAlignment, verticalAlignment, KDColorBlack, KDColorWhite, topMargin, rightMargin, bottomMargin, leftMargin)
9 {
10 }
11 
13  return &m_editableCell;
14 }
15 
17  EvenOddCell::setHighlighted(highlight);
18  m_editableCell.textField()->setBackgroundColor(backgroundColor());
19 }
20 
23  m_editableCell.textField()->setBackgroundColor(backgroundColor());
24 }
25 
27  return 1;
28 }
29 
31  assert(index == 0);
32  return &m_editableCell;
33 }
34 
36  m_editableCell.setFrame(bounds());
37 }
38 
40  app()->setFirstResponder(&m_editableCell);
41 }
View * subviewAtIndex(int index) override
#define assert(e)
Definition: assert.h:9
void setHighlighted(bool highlight) override
virtual void setEven(bool even)
void setFrame(KDRect frame)
Definition: view.cpp:125
int16_t KDCoordinate
Definition: coordinate.h:6
virtual KDColor backgroundColor() const
TextField * textField()
void setBackgroundColor(KDColor backgroundColor)
Definition: text_input.cpp:72
void setEven(bool even) override
constexpr KDColor KDColorWhite
Definition: color.h:42
constexpr KDColor KDColorBlack
Definition: color.h:41
void setFirstResponder(Responder *responder)
Definition: app.cpp:62
Definition: view.h:23
App * app()
Definition: responder.cpp:77
virtual void setHighlighted(bool highlight)
EvenOddEditableTextCell(Responder *parentResponder=nullptr, TextFieldDelegate *delegate=nullptr, char *draftTextBuffer=nullptr, KDText::FontSize size=KDText::FontSize::Large, float horizontalAlignment=1.0f, float verticalAlignment=0.5f, KDCoordinate topMargin=0, KDCoordinate rightMargin=0, KDCoordinate bottomMargin=0, KDCoordinate leftMargin=0)
FontSize
Definition: text.h:10
KDRect bounds() const
Definition: view.cpp:157