Files
Upsilon/escher/include/escher/editable_text_cell.h
Émilie Feral 9d0354f3bd [kandinsky] Add a default font size : large
Change-Id: I6b9f1a7b09292f120074c8957e328ddc33023c67
2017-01-27 12:03:06 +01:00

31 lines
1.1 KiB
C++

#ifndef ESCHER_EDITABLE_TEXT_CELL_H
#define ESCHER_EDITABLE_TEXT_CELL_H
#include <escher/responder.h>
#include <escher/table_view_cell.h>
#include <escher/text_field_delegate.h>
#include <escher/text_field.h>
class EditableTextCell : public TableViewCell, public Responder {
public:
EditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size = KDText::FontSize::Large,
float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = KDColorBlack, KDColor = KDColorWhite);
TextField * textField();
void reloadCell() override;
const char * text() const;
void setText(const char * textContent);
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews() override;
void didBecomeFirstResponder() override;
void setEditing(bool isEditing);
constexpr static int k_bufferLength = 255;
private:
constexpr static KDCoordinate k_textHeight = 12;
constexpr static KDCoordinate k_separatorThickness = 1;
TextField m_textField;
char m_textBody[k_bufferLength];
};
#endif