1 #ifndef ESCHER_TEXT_FIELD_H 2 #define ESCHER_TEXT_FIELD_H 18 void setAlignment(
float horizontalAlignment,
float verticalAlignment);
35 const char *
text()
const override;
41 void setAlignment(
float horizontalAlignment,
float verticalAlignment);
58 void layoutSubviews()
override;
59 KDRect characterFrameAtIndex(
size_t index)
const override;
62 char * m_draftTextBuffer;
63 size_t m_currentDraftTextLength;
64 size_t m_textBufferSize;
65 float m_horizontalAlignment;
66 float m_verticalAlignment;
void setDraftTextBuffer(char *draftTextBuffer)
static constexpr int maxBufferSize()
void setDelegate(TextFieldDelegate *delegate)
void setText(const char *text)
TextField(Responder *parentResponder, char *textBuffer, char *draftTextBuffer, size_t textBufferSize, TextFieldDelegate *delegate=nullptr, bool hasTwoBuffers=true, KDText::FontSize size=KDText::FontSize::Large, float horizontalAlignment=0.0f, float verticalAlignment=0.5f, KDColor textColor=KDColorBlack, KDColor=KDColorWhite)
static constexpr int k_maxBufferSize
size_t editedTextLength() const override
Responder * parentResponder() const
bool removeChar() override
void setDraftTextBuffer(char *draftTextBuffer)
void setAlignment(float horizontalAlignment, float verticalAlignment)
void setText(const char *text)
void setEditing(bool isEditing, bool reinitDraftBuffer)
bool removeEndOfLine() override
bool textFieldShouldFinishEditing(Ion::Events::Event event)
virtual void setEditing(bool isEditing, bool reinitDraftBuffer=true)
const char * text() const override
constexpr KDColor KDColorWhite
void drawRect(KDContext *ctx, KDRect rect) const override
ContentView(char *textBuffer, char *draftTextBuffer, size_t textBufferSize, KDText::FontSize size, float horizontalAlignment=0.0f, float verticalAlignment=0.5f, KDColor textColor=KDColorBlack, KDColor=KDColorWhite)
constexpr KDColor KDColorBlack
KDSize minimalSizeForOptimalDisplay() const override
KDSize minimalSizeForOptimalDisplay() const override
const char * text() const
ContentView m_contentView
bool handleEventWithText(const char *text, bool indenting=false) override
size_t draftTextLength() const
bool handleEvent(Ion::Events::Event event) override
virtual bool textFieldShouldFinishEditing(TextField *textField, Ion::Events::Event event)=0
bool insertTextAtLocation(const char *text, int location) override
void setAlignment(float horizontalAlignment, float verticalAlignment)
const ContentView * nonEditableContentView() const override
void scrollToCursor() override
void reinitDraftTextBuffer()