wavelength 1.0.0
Loading...
Searching...
No Matches
editfield.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
6
13class EditField {
14public:
22
30 explicit EditField(int nMaxLength);
31
39
49
57 const char *GetText();
58
65 void Clear();
66
69
71 int GetCursor() const {
72 return mCursor;
73 }
74
75private:
76 int mCapacity;
77 int mCursor;
78 int mInsert;
79 std::vector<char> mText;
80};
~EditField()
Release the text.
KeyResult
The values of HandleKey().
Definition editfield.h:16
@ kKeyIgnored
Definition editfield.h:19
@ kKeyChanged
Definition editfield.h:20
@ kKeyCancel
Definition editfield.h:17
@ kKeySubmit
Definition editfield.h:18
int HandleKey(KeyboardKeyMsg *pMsg)
Apply a key to the text and the cursor.
const char * GetText()
Report the text.
void Clear()
Empty the text to a single space and move the cursor to the start.
int GetCursor() const
Definition editfield.h:71
EditField(int nMaxLength)
Construct an empty field.
Message the keyboard poll sends when a key of a USB keyboard is pressed.
Definition keyboardkeymsg.h:23