19 #ifndef OPENXCOM_TEXTEDIT_H
20 #define OPENXCOM_TEXTEDIT_H
22 #include "../Engine/InteractiveSurface.h"
45 ActionHandler _change;
48 bool exceedsMaxWidth(
wchar_t c);
51 TextEdit(
State *state,
int width,
int height,
int x = 0,
int y = 0);
57 void setFocus(
bool focus,
bool modal =
true);
65 void setText(
const std::wstring &text);
89 void setPalette(SDL_Color *colors,
int firstcolor = 0,
int ncolors = 256);
101 void onChange(ActionHandler handler);
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void setSmall()
Sets the text size to small.
Definition: TextEdit.cpp:121
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the text edit's palette.
Definition: TextEdit.cpp:270
void setSecondaryColor(Uint8 color)
Sets the text edit's secondary color.
Definition: TextEdit.cpp:250
void setWordWrap(bool wrap)
Sets the text edit's wordwrap setting.
Definition: TextEdit.cpp:167
A game state that receives user input and reacts accordingly.
Definition: State.h:44
TextEdit(State *state, int width, int height, int x=0, int y=0)
Creates a new text edit with the specified size and position.
Definition: TextEdit.cpp:37
void think()
Handles the timers.
Definition: TextEdit.cpp:280
Timer used to run code in fixed intervals.
Definition: Timer.h:37
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
void setFocus(bool focus, bool modal=true)
Sets focus on this text edit.
Definition: TextEdit.cpp:82
void initText(Font *big, Font *small, Language *lang)
Initializes the text edit's resources.
Definition: TextEdit.cpp:135
Text string displayed on screen.
Definition: Text.h:41
void setBig()
Sets the text size to big.
Definition: TextEdit.cpp:112
void setVerticalAlign(TextVAlign valign)
Sets the text edit's vertical alignment.
Definition: TextEdit.cpp:209
void setText(const std::wstring &text)
Sets the text's string.
Definition: TextEdit.cpp:145
void setHighContrast(bool contrast)
Sets the text edit's high contrast color setting.
Definition: TextEdit.cpp:188
void setInvert(bool invert)
Sets the text edit's color invert setting.
Definition: TextEdit.cpp:177
void keyboardPress(Action *action, State *state)
Special handling for keyboard presses.
Definition: TextEdit.cpp:407
Contains strings used throughout the game for localization.
Definition: Language.h:42
void setNumerical(bool numerical)
Sets the text edit to numerical input.
Definition: TextEdit.cpp:218
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:40
void blink()
Plays the blinking animation.
Definition: TextEdit.cpp:289
void draw()
Draws the text edit.
Definition: TextEdit.cpp:299
~TextEdit()
Cleans up the text edit.
Definition: TextEdit.cpp:50
void setColor(Uint8 color)
Sets the text edit's color.
Definition: TextEdit.cpp:229
void mousePress(Action *action, State *state)
Special handling for mouse presses.
Definition: TextEdit.cpp:367
std::wstring getText() const
Gets the text edit's string.
Definition: TextEdit.cpp:156
Uint8 getSecondaryColor() const
Gets the text edit's secondary color.
Definition: TextEdit.cpp:259
void invert(Uint8 mid)
Inverts the surface's colors.
Definition: Surface.cpp:451
void onChange(ActionHandler handler)
Hooks an action handler to when the slider changes.
Definition: TextEdit.cpp:508
void handle(Action *action, State *state)
Handle focus.
Definition: TextEdit.cpp:65
Uint8 getColor() const
Gets the text edit's color.
Definition: TextEdit.cpp:239
Editable version of Text.
Definition: TextEdit.h:35
void setAlign(TextHAlign align)
Sets the text edit's horizontal alignment.
Definition: TextEdit.cpp:199