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:35
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:41
Surface that the user can interact with.
Definition: InteractiveSurface.h:40
Contains strings used throughout the game for localization.
Definition: Language.h:44
A game state that receives user input and reacts accordingly.
Definition: State.h:45
void invert(Uint8 mid)
Inverts the surface's colors.
Definition: Surface.cpp:451
Editable version of Text.
Definition: TextEdit.h:36
void blink()
Plays the blinking animation.
Definition: TextEdit.cpp:289
void setColor(Uint8 color)
Sets the text edit's color.
Definition: TextEdit.cpp:229
Uint8 getColor() const
Gets the text edit's color.
Definition: TextEdit.cpp:239
std::wstring getText() const
Gets the text edit's string.
Definition: TextEdit.cpp:156
void handle(Action *action, State *state)
Handle focus.
Definition: TextEdit.cpp:65
~TextEdit()
Cleans up the text edit.
Definition: TextEdit.cpp:50
void setSmall()
Sets the text size to small.
Definition: TextEdit.cpp:121
void setInvert(bool invert)
Sets the text edit's color invert setting.
Definition: TextEdit.cpp:177
void draw()
Draws the text edit.
Definition: TextEdit.cpp:299
void setBig()
Sets the text size to big.
Definition: TextEdit.cpp:112
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 keyboardPress(Action *action, State *state)
Special handling for keyboard presses.
Definition: TextEdit.cpp:407
void setFocus(bool focus, bool modal=true)
Sets focus on this text edit.
Definition: TextEdit.cpp:82
void setNumerical(bool numerical)
Sets the text edit to numerical input.
Definition: TextEdit.cpp:218
Uint8 getSecondaryColor() const
Gets the text edit's secondary color.
Definition: TextEdit.cpp:259
void mousePress(Action *action, State *state)
Special handling for mouse presses.
Definition: TextEdit.cpp:367
void onChange(ActionHandler handler)
Hooks an action handler to when the slider changes.
Definition: TextEdit.cpp:508
void setAlign(TextHAlign align)
Sets the text edit's horizontal alignment.
Definition: TextEdit.cpp:199
void setText(const std::wstring &text)
Sets the text's string.
Definition: TextEdit.cpp:145
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the text edit's palette.
Definition: TextEdit.cpp:270
void initText(Font *big, Font *small, Language *lang)
Initializes the text edit's resources.
Definition: TextEdit.cpp:135
void setWordWrap(bool wrap)
Sets the text edit's wordwrap setting.
Definition: TextEdit.cpp:167
void setSecondaryColor(Uint8 color)
Sets the text edit's secondary color.
Definition: TextEdit.cpp:250
void think()
Handles the timers.
Definition: TextEdit.cpp:280
void setVerticalAlign(TextVAlign valign)
Sets the text edit's vertical alignment.
Definition: TextEdit.cpp:209
void setHighContrast(bool contrast)
Sets the text edit's high contrast color setting.
Definition: TextEdit.cpp:188
Text string displayed on screen.
Definition: Text.h:42
Timer used to run code in fixed intervals.
Definition: Timer.h:38
COPYING:
Definition: BaseInfoState.cpp:41