Classes | |
struct | Alignment |
The text alignment. More... | |
Public Member Functions | |
EditBox () | |
Default constructor. More... | |
EditBox (const EditBox ©) | |
Copy constructor. More... | |
virtual | ~EditBox () |
Destructor. More... | |
EditBox & | operator= (const EditBox &right) |
Overload of assignment operator. More... | |
virtual bool | load (const std::string &pathname) |
Loads the edit box images and optionally a matching text color. More... | |
virtual void | setSize (float width, float height) |
Changes the size of the edit box. More... | |
virtual Vector2u | getSize () const |
Returns the size of the edit box, unaffected by scaling. More... | |
virtual Vector2f | getScaledSize () const |
Returns the size of the edit box, after the scaling transformation. More... | |
virtual std::string | getLoadedPathname () const |
Returns the pathname that was used to load the edit box. More... | |
virtual void | setText (const sf::String &text) |
Changes the text of the editbox. More... | |
virtual sf::String | getText () const |
Returns the text inside the edit box. This text is not affected by the password character. More... | |
virtual void | setTextSize (unsigned int textSize) |
Changes the character size of the text. More... | |
virtual unsigned int | getTextSize () const |
Returns the character size of the text. More... | |
virtual void | setTextFont (const sf::Font &font) |
Changes the font of the text. More... | |
virtual const sf::Font * | getTextFont () const |
Returns the font of the text. More... | |
virtual void | setPasswordChar (char passwordChar= '\0') |
Sets a password character. More... | |
virtual char | getPasswordChar () const |
Returns the password character. More... | |
virtual void | setMaximumCharacters (unsigned int maxChars=0) |
Change the character limit. More... | |
virtual unsigned int | getMaximumCharacters () const |
Returns the character limit. More... | |
virtual void | setBorders (unsigned int leftBorder=0, unsigned int topBorder=0, unsigned int rightBorder=0, unsigned int bottomBorder=0) |
Changes the border width and border height of the edit box. More... | |
virtual void | changeColors (const sf::Color &textColor=sf::Color(0, 0, 0), const sf::Color &selectedTextColor=sf::Color(255, 255, 255), const sf::Color &selectedTextBackgroundColor=sf::Color(10, 110, 255), const sf::Color &selectionPointColor=sf::Color(110, 110, 255)) |
Changes the colors from the edit box. More... | |
virtual void | setTextColor (const sf::Color &textColor) |
Set the text color that will be used inside the edit box. More... | |
virtual void | setSelectedTextColor (const sf::Color &selectedTextColor) |
Set the text color of the selected text that will be used inside the edit box. More... | |
virtual void | setSelectedTextBackgroundColor (const sf::Color &selectedTextBackgroundColor) |
Set the background color of the selected text that will be used inside the edit box. More... | |
virtual const sf::Color & | getTextColor () const |
Get the text color that is currently being used inside the edit box. More... | |
virtual const sf::Color & | getSelectedTextColor () const |
Get the text color of the selected text that is currently being used inside the edit box. More... | |
virtual const sf::Color & | getSelectedTextBackgroundColor () const |
Get the background color of the selected text that is currently being used inside the edit box. More... | |
virtual void | limitTextWidth (bool limitWidth) |
Should the text width be limited or should you be able to type even if the edit box is full? More... | |
virtual void | setSelectionPointPosition (unsigned int charactersBeforeSelectionPoint) |
Sets the flickering selection point to after a specific character. More... | |
Public Member Functions inherited from tgui::OBJECT | |
OBJECT () | |
Default constructor. More... | |
OBJECT (const OBJECT ©) | |
Copy constructor. More... | |
virtual | ~OBJECT () |
Destructor. More... | |
OBJECT & | operator= (const OBJECT &right) |
Overload of assignment operator. More... | |
virtual void | show () |
Shows the object. More... | |
virtual void | hide () |
Hides the object. More... | |
virtual bool | isVisible () const |
Returns true when the object is visible. More... | |
virtual void | enable () |
Enables the object. More... | |
virtual void | disable () |
Disables the object. More... | |
virtual bool | isEnabled () const |
Returns true when the object is enabled. More... | |
virtual bool | isDisabled () const |
Returns true when the object is disabled. More... | |
virtual bool | isLoaded () const |
Returns true when the object is loaded successfully. More... | |
void | focus () |
Focus the object. More... | |
void | unfocus () |
Unfocus the object. More... | |
void | focusNextObject () |
Focuses the next object. More... | |
virtual bool | isFocused () const |
Returns true when the object is focused and false otherwise. More... | |
virtual ObjectTypes | getObjectType () const |
Returns the type of the object. More... | |
virtual void | moveToFront () |
Places the object before all other objects. More... | |
virtual void | moveToBack () |
Places the object behind all other objects. More... | |
Public Member Functions inherited from tgui::OBJECT_BORDERS | |
OBJECT_BORDERS () | |
Default constructor. More... | |
virtual Vector4u | getBorders () const |
Returns the size of the borders as a tgui::Vector4u. More... | |
Public Attributes | |
sf::Color | selectionPointColor |
The color of the flickering selection point. More... | |
unsigned int | selectionPointWidth |
The width in pixels of the flickering selection point. More... | |
Alignment::alignments | textAlignment |
The text alignment. More... | |
tgui::EditBox::EditBox | ( | ) |
Default constructor.
tgui::EditBox::EditBox | ( | const EditBox & | copy | ) |
Copy constructor.
copy | Instance to copy |
|
virtual |
Destructor.
|
virtual |
Changes the colors from the edit box.
textColor | The color of the text |
selectedTextColor | The color of the text when it is selected |
selectedTextBackgroundColor | The color of the background of the text that is selected |
selectionPointColor | The color of the flickering selection point |
|
virtual |
Returns the pathname that was used to load the edit box.
|
virtual |
Returns the character limit.
There is no character limit by default.
|
virtual |
Returns the password character.
|
virtual |
Returns the size of the edit box, after the scaling transformation.
Implements tgui::OBJECT.
|
virtual |
Get the background color of the selected text that is currently being used inside the edit box.
|
virtual |
Get the text color of the selected text that is currently being used inside the edit box.
|
virtual |
Returns the size of the edit box, unaffected by scaling.
Implements tgui::OBJECT.
|
virtual |
Returns the text inside the edit box. This text is not affected by the password character.
|
virtual |
Get the text color that is currently being used inside the edit box.
|
virtual |
Returns the font of the text.
|
virtual |
Returns the character size of the text.
|
virtual |
Should the text width be limited or should you be able to type even if the edit box is full?
limitWidth | Should there be a text width limit or not. |
When set to true, you will no longer be able to add text when the edit box is full. The default value is false.
|
virtual |
Loads the edit box images and optionally a matching text color.
pathname | The path to the folder that contains the images. The folder must also contain an info.txt file, which will give more information about the edit box. |
Overload of assignment operator.
right | Instance to assign |
|
virtual |
Changes the border width and border height of the edit box.
When the text is autoscaled then it will be drawn within these borders. The borders themselves are invisible. The borders are also used to define the clipping area. Note that these borders are scaled together with the image!
leftBorder | The width of the left border |
topBorder | The height of the top border |
rightBorder | The width of the right border |
bottomBorder | The height of the bottom border |
Implements tgui::OBJECT_BORDERS.
|
virtual |
Change the character limit.
maxChars | The new character limit. Set it to 0 to disable the limit. |
This character limit is disabled by default.
|
virtual |
Sets a password character.
passwordChar | The new password character. If set to 0 then there is no password character. |
When the text width is limited then this function might remove the last characters in the text if they no longer fit in the EditBox. You can avoid this by setting LimitTextWidth to false (which is the default).
|
virtual |
Set the background color of the selected text that will be used inside the edit box.
selectedTextBackgroundColor | The new background color. |
|
virtual |
Set the text color of the selected text that will be used inside the edit box.
selectedTextColor | The new text color. |
|
virtual |
Sets the flickering selection point to after a specific character.
charactersBeforeSelectionPoint | The new position. |
Normally you will not need this function.
|
virtual |
Changes the size of the edit box.
width | The new width of the edit box |
height | The new height of the edit box |
Implements tgui::OBJECT.
|
virtual |
Changes the text of the editbox.
text | The new text. |
The last characters of the text might be removed in the following situations:
|
virtual |
Set the text color that will be used inside the edit box.
textColor | The new text color. |
|
virtual |
Changes the font of the text.
When you don't call this function then the global font will be use. This global font can be changed by changing gloabalFont from the parent.
font | The new font. |
|
virtual |
Changes the character size of the text.
textSize | The new size of the text. If the size is 0 (default) then the text will be scaled to fit in the edit box. |
sf::Color tgui::EditBox::selectionPointColor |
The color of the flickering selection point.
unsigned int tgui::EditBox::selectionPointWidth |
The width in pixels of the flickering selection point.
Alignment::alignments tgui::EditBox::textAlignment |
The text alignment.