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