An EditBox widget renderer. More...
#include <EditBoxRenderer.h>
Public Types | |
using | Ptr = std::unique_ptr< IWidgetRenderer > |
Unique renderer pointer. More... | |
Public Member Functions | |
void | setTextStyle (TextStyle style) |
Set the text style. More... | |
TextStyle | getTextStyle () const |
Get the text style. More... | |
void | setDefaultTextStyle (TextStyle style) |
Set the style of the defaut text. More... | |
TextStyle | getDefaultTextStyle () const |
Get the style of the default text. More... | |
void | setBorders (const Borders &borders) |
Change the ize of the widget borders. More... | |
Borders | getBorders () const |
Get the ize of the widgets borders. More... | |
void | setPadding (const Padding &padding) |
SDet the adding of the edit box. More... | |
Padding | getPadding () const |
Get the padding. More... | |
void | setCaretWidth (float width) |
Set the width of the caret. More... | |
float | getCaretWidth () const |
Get the caret width. More... | |
void | setTextColour (Colour textColour) |
Set the text colour that will be used inside the edit box. More... | |
Colour | getTextColour () const |
Get the text colour that will be used inside the edit box. More... | |
void | setDisabledTextColour (Colour textColour) |
Set the text colour when the edit box is disabled More... | |
Colour | getDisabledTextColour () const |
Get the text colour when the edit box is disabled More... | |
void | setFocusedTextColour (Colour textColour) |
Set the text colour when the edit box is focused. More... | |
Colour | getFocusedTextColour () const |
Get the text colour when the edit box is focused. More... | |
void | setSelectedTextColour (Colour colour) |
Set the text colour of the selected text. More... | |
Colour | getSelectedTextColour () const |
Get the text colour of the selected text. More... | |
void | setSelectedTextBackgroundColour (Colour backgroundColour) |
Set the background colour of the selected text. More... | |
Colour | getSelectedTextBackgroundColour () const |
Get the background colour of the selected text. More... | |
void | setDefaultTextColour (Colour defaultTextColour) |
Set the colour f the default text. More... | |
Colour | getDefaultTextColour () const |
Get the colour f the default text. More... | |
void | setBackgroundColour (Colour colour) |
Set the background colour of the edit box. More... | |
Colour | getBackgroundColour () const |
Get the background colour of edit box. More... | |
void | setBackgroundHoverColour (Colour colour) |
Set the background colour of the edit box when the mouse enters it. More... | |
Colour | getBackgroundColourHover () const |
Get the background colour of the edit box when the mouse enters it. More... | |
void | setDisabledBackgroundColour (Colour colour) |
Set the background colour of the edit box when it is disabled. More... | |
Colour | getDisabledBackgroundColour () const |
Get the background colour of the edit box when it is disabled. More... | |
void | setFocusedBackgroundColour (Colour colour) |
Set the background colour when the edit box is focused but not hovered. More... | |
Colour | getFocusedBackgroundColour () const |
Get the background colour when the edit box is focused but not hovered. More... | |
void | setCaretColour (Colour caretColour) |
Set the colour of the caret. More... | |
Colour | getCaretColour () const |
Get the colour of the caret. More... | |
void | setCaretHoverColour (Colour caretColour) |
Set the colour of the caret when the mouse enters the edit box. More... | |
Colour | getCaretHoverColour () const |
Get the colour of the caret when the mouse enters the edit box. More... | |
void | setCaretColourFocused (Colour caretColour) |
Set the colour of the caret when the edit box is focused. More... | |
Colour | getFocusedCaretColour () const |
Get the colour of the caret when the edit box is focused. More... | |
void | setBorderColour (Colour colour) |
Set the border colour. More... | |
Colour | getBorderColour () const |
Get the border colour. More... | |
void | setBorderHoverColour (Colour colour) |
Set the background colour of when the mouse enters the edit box. More... | |
Colour | getBorderHoverColour () const |
Get the background colour of when the mouse enters the edit box. More... | |
void | setDisabledBorderColour (Colour colour) |
Set the background colour when the edit box is disabled. More... | |
Colour | getDisabledBorderColour () const |
Get the background colour when the edit box is disabled. More... | |
void | setFocusedBorderColour (Colour colour) |
Set the border colour when the edit box is focused but not hovered. More... | |
Colour | getFocusedBorderColour () const |
Get the border colour when the edit box is focused but not hovered. More... | |
void | setTexture (const std::string &filename) |
Set the background image of the edit box. More... | |
void | setHoverTexture (const std::string &filename) |
Set the image when the mouse enters the edit box. More... | |
void | setDisabledTexture (const std::string &filename) |
Set the image when the edit box is disabled. More... | |
void | setFocusedTexture (const std::string &filename) |
Set the image when the edit box is focused but not hovered. More... | |
void | setOpacity (float opacity) override |
Set the opacity of the widget. More... | |
float | getOpacity () const override |
Get the opacity of the widget. More... | |
void | setOpacityDisabled (float opacity) override |
Set the opacity of the widget when it is disabled. More... | |
float | getOpacityDisabled () const override |
Get the opacity of the widget when it is disabled. More... | |
void | setFont (const std::string &filename) override |
Change the widgets font. More... | |
void | ignoreTransparentTexture (bool ignoreTransparentParts) override |
Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state. More... | |
bool | isTransparentTextureIgnored () const override |
Check if mouse events are ignored on transparent parts of the texture or not. More... | |
IWidgetRenderer::Ptr | clone () const override |
Create a copy of the render. More... | |
void | setInternalPtr (tgui::WidgetRenderer *renderer) override |
tgui::WidgetRenderer * | getInternalPtr () override |
~EditBoxRenderer () override | |
Destructor. More... | |
An EditBox widget renderer.
This class allows you to manipulate the render properties of an EditBox
Definition at line 44 of file EditBoxRenderer.h.
|
inherited |
Unique renderer pointer.
Definition at line 75 of file IWidgetRenderer.h.
|
override |
Destructor.
|
overridevirtual |
Colour ime::ui::EditBoxRenderer::getBackgroundColour | ( | ) | const |
Get the background colour of edit box.
Colour ime::ui::EditBoxRenderer::getBackgroundColourHover | ( | ) | const |
Get the background colour of the edit box when the mouse enters it.
Colour ime::ui::EditBoxRenderer::getBorderColour | ( | ) | const |
Get the border colour.
Colour ime::ui::EditBoxRenderer::getBorderHoverColour | ( | ) | const |
Get the background colour of when the mouse enters the edit box.
Borders ime::ui::EditBoxRenderer::getBorders | ( | ) | const |
Get the ize of the widgets borders.
Colour ime::ui::EditBoxRenderer::getCaretColour | ( | ) | const |
Get the colour of the caret.
Colour ime::ui::EditBoxRenderer::getCaretHoverColour | ( | ) | const |
Get the colour of the caret when the mouse enters the edit box.
float ime::ui::EditBoxRenderer::getCaretWidth | ( | ) | const |
Get the caret width.
Colour ime::ui::EditBoxRenderer::getDefaultTextColour | ( | ) | const |
Get the colour f the default text.
TextStyle ime::ui::EditBoxRenderer::getDefaultTextStyle | ( | ) | const |
Get the style of the default text.
Colour ime::ui::EditBoxRenderer::getDisabledBackgroundColour | ( | ) | const |
Get the background colour of the edit box when it is disabled.
Colour ime::ui::EditBoxRenderer::getDisabledBorderColour | ( | ) | const |
Get the background colour when the edit box is disabled.
Colour ime::ui::EditBoxRenderer::getDisabledTextColour | ( | ) | const |
Get the text colour when the edit box is disabled
Colour ime::ui::EditBoxRenderer::getFocusedBackgroundColour | ( | ) | const |
Get the background colour when the edit box is focused but not hovered.
Colour ime::ui::EditBoxRenderer::getFocusedBorderColour | ( | ) | const |
Get the border colour when the edit box is focused but not hovered.
Colour ime::ui::EditBoxRenderer::getFocusedCaretColour | ( | ) | const |
Get the colour of the caret when the edit box is focused.
Colour ime::ui::EditBoxRenderer::getFocusedTextColour | ( | ) | const |
Get the text colour when the edit box is focused.
|
overridevirtual |
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Get the opacity of the widget.
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Get the opacity of the widget when it is disabled.
This function will return -1 if the widget uses the same opacity as the enabled state when it is disabled
Implements ime::ui::IWidgetRenderer.
Padding ime::ui::EditBoxRenderer::getPadding | ( | ) | const |
Get the padding.
Colour ime::ui::EditBoxRenderer::getSelectedTextBackgroundColour | ( | ) | const |
Get the background colour of the selected text.
Colour ime::ui::EditBoxRenderer::getSelectedTextColour | ( | ) | const |
Get the text colour of the selected text.
Colour ime::ui::EditBoxRenderer::getTextColour | ( | ) | const |
Get the text colour that will be used inside the edit box.
TextStyle ime::ui::EditBoxRenderer::getTextStyle | ( | ) | const |
Get the text style.
|
overridevirtual |
Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state.
ignoreTransparentParts | True to ignore mouse events on transparent parts of the texture, otherwise false |
When mouse events are ignored, they are passed to a widget behind the widget. By default, mouse events are NOT ignored and the widget will receive mouse events even on transparent texture parts. This property does nothing if the widget doesn't use textures
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Check if mouse events are ignored on transparent parts of the texture or not.
Implements ime::ui::IWidgetRenderer.
void ime::ui::EditBoxRenderer::setBackgroundColour | ( | Colour | colour | ) |
Set the background colour of the edit box.
colour | The background colour to set |
void ime::ui::EditBoxRenderer::setBackgroundHoverColour | ( | Colour | colour | ) |
Set the background colour of the edit box when the mouse enters it.
colour | The background colour to set |
void ime::ui::EditBoxRenderer::setBorderColour | ( | Colour | colour | ) |
Set the border colour.
colour | The border colour to set |
void ime::ui::EditBoxRenderer::setBorderHoverColour | ( | Colour | colour | ) |
Set the background colour of when the mouse enters the edit box.
colour | The background colour to set |
void ime::ui::EditBoxRenderer::setBorders | ( | const Borders & | borders | ) |
Change the ize of the widget borders.
borders | The size of the borders |
void ime::ui::EditBoxRenderer::setCaretColour | ( | Colour | caretColour | ) |
Set the colour of the caret.
caretColour | The colour of the caret |
void ime::ui::EditBoxRenderer::setCaretColourFocused | ( | Colour | caretColour | ) |
Set the colour of the caret when the edit box is focused.
caretColour | The new caret colour |
void ime::ui::EditBoxRenderer::setCaretHoverColour | ( | Colour | caretColour | ) |
Set the colour of the caret when the mouse enters the edit box.
caretColour | The coulour to set |
void ime::ui::EditBoxRenderer::setCaretWidth | ( | float | width | ) |
Set the width of the caret.
width | New width of the caret |
void ime::ui::EditBoxRenderer::setDefaultTextColour | ( | Colour | defaultTextColour | ) |
Set the colour f the default text.
defaultTextColour | The colour to set |
void ime::ui::EditBoxRenderer::setDefaultTextStyle | ( | TextStyle | style | ) |
Set the style of the defaut text.
style | The style to set |
void ime::ui::EditBoxRenderer::setDisabledBackgroundColour | ( | Colour | colour | ) |
Set the background colour of the edit box when it is disabled.
colour | Background colour to set |
void ime::ui::EditBoxRenderer::setDisabledBorderColour | ( | Colour | colour | ) |
Set the background colour when the edit box is disabled.
colour | The background colour when the edit box is disabled |
void ime::ui::EditBoxRenderer::setDisabledTextColour | ( | Colour | textColour | ) |
Set the text colour when the edit box is disabled
textColour | Colour to set |
void ime::ui::EditBoxRenderer::setDisabledTexture | ( | const std::string & | filename | ) |
Set the image when the edit box is disabled.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When this image is set then the background colour property will be ignored
void ime::ui::EditBoxRenderer::setFocusedBackgroundColour | ( | Colour | colour | ) |
Set the background colour when the edit box is focused but not hovered.
colour | Background colour to be set |
void ime::ui::EditBoxRenderer::setFocusedBorderColour | ( | Colour | colour | ) |
Set the border colour when the edit box is focused but not hovered.
colour | Border colour to set |
void ime::ui::EditBoxRenderer::setFocusedTextColour | ( | Colour | textColour | ) |
Set the text colour when the edit box is focused.
textColour | Colour to set |
void ime::ui::EditBoxRenderer::setFocusedTexture | ( | const std::string & | filename | ) |
Set the image when the edit box is focused but not hovered.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When this image is set then the background colour property will be ignored
|
overridevirtual |
Change the widgets font.
filename | Filename of the new font |
FileNotFoundException | If the font cannot be found on the disk |
Implements ime::ui::IWidgetRenderer.
void ime::ui::EditBoxRenderer::setHoverTexture | ( | const std::string & | filename | ) |
Set the image when the mouse enters the edit box.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When this image is set then the background colour property will be ignored
|
overridevirtual |
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Set the opacity of the widget.
opacity | The new opacity of the widget in between 0 and 1 |
0 means completely transparent, while 1 (default) means fully opaque
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Set the opacity of the widget when it is disabled.
opacity | Opacity to set between 0 and 1 |
0 means completely transparent, while 1 (default) means fully opaque. Set to -1 (default) to use the normal opacity value even when the widget is disabled.
Implements ime::ui::IWidgetRenderer.
void ime::ui::EditBoxRenderer::setPadding | ( | const Padding & | padding | ) |
SDet the adding of the edit box.
padding | The new padding |
When the text is auto-scaled then it will be drawn within the area defined by the size minus the border and padding. The padding is also used to define the clipping area for when the text it too long
void ime::ui::EditBoxRenderer::setSelectedTextBackgroundColour | ( | Colour | backgroundColour | ) |
Set the background colour of the selected text.
backgroundColour | New background colour |
void ime::ui::EditBoxRenderer::setSelectedTextColour | ( | Colour | colour | ) |
Set the text colour of the selected text.
colour | New colour |
void ime::ui::EditBoxRenderer::setTextColour | ( | Colour | textColour | ) |
Set the text colour that will be used inside the edit box.
textColour | The new text colour |
void ime::ui::EditBoxRenderer::setTextStyle | ( | TextStyle | style | ) |
Set the text style.
style | Style to set |
void ime::ui::EditBoxRenderer::setTexture | ( | const std::string & | filename | ) |
Set the background image of the edit box.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When this image is set then the background colour property will be ignored