4 #ifndef GOSU_TEXTINPUT_HPP
5 #define GOSU_TEXTINPUT_HPP
26 const GOSU_UNIQUE_PTR<Impl> pimpl;
27 #if defined(GOSU_CPP11_ENABLED)
38 std::wstring
text()
const;
42 void setText(
const std::wstring& text);
58 #if defined(GOSU_IS_MAC)
59 bool feedNSEvent(
void* event);
60 #elif defined(GOSU_IS_WIN)
61 bool feedMessage(
unsigned long message,
unsigned long wparam,
unsigned long lparam);
62 #elif defined(GOSU_IS_X)
63 bool feedXEvent(
void* display,
void* event);
69 virtual std::wstring
filter(
const std::wstring& textIn)
const
Includes all parts of C++03 (TR1) that are relevant for Gosu.
void setSelectionStart(unsigned pos)
Sets the start of the selection as returned by selectionStart.
Contains declarations of all of Gosu's available classes.
void setText(const std::wstring &text)
Replaces the current text by the given string and positions the cursor at the end of the text...
unsigned caretPos() const
Position of the caret as the index of the character that it's left to.
std::wstring text() const
void setCaretPos(unsigned pos)
Sets the caret position as returned by caretPos.
TextInput instances are invisible objects that build a text string from input, using the current oper...
unsigned selectionStart() const
If there is a selection, the selectionStart() member yields its beginning, using the same indexing sc...
virtual std::wstring filter(const std::wstring &textIn) const
Overridable filter that is applied to all new text that is entered.