Public Types | Public Member Functions | List of all members
ime::ui::EditBoxRenderer Class Reference

An EditBox widget renderer. More...

#include <EditBoxRenderer.h>

Inheritance diagram for ime::ui::EditBoxRenderer:
ime::ui::IWidgetRenderer

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...
 

Detailed Description

An EditBox widget renderer.

This class allows you to manipulate the render properties of an EditBox

Definition at line 44 of file EditBoxRenderer.h.

Member Typedef Documentation

◆ Ptr

using ime::ui::IWidgetRenderer::Ptr = std::unique_ptr<IWidgetRenderer>
inherited

Unique renderer pointer.

Definition at line 75 of file IWidgetRenderer.h.

Constructor & Destructor Documentation

◆ ~EditBoxRenderer()

ime::ui::EditBoxRenderer::~EditBoxRenderer ( )
override

Destructor.

Member Function Documentation

◆ clone()

IWidgetRenderer::Ptr ime::ui::EditBoxRenderer::clone ( ) const
overridevirtual

Create a copy of the render.

Returns
A copy of the render

Implements ime::ui::IWidgetRenderer.

◆ getBackgroundColour()

Colour ime::ui::EditBoxRenderer::getBackgroundColour ( ) const

Get the background colour of edit box.

Returns
The background colour of the edit box

◆ getBackgroundColourHover()

Colour ime::ui::EditBoxRenderer::getBackgroundColourHover ( ) const

Get the background colour of the edit box when the mouse enters it.

Returns
The background colour of the edit box when the mouse enters it

◆ getBorderColour()

Colour ime::ui::EditBoxRenderer::getBorderColour ( ) const

Get the border colour.

Returns
The border colour

◆ getBorderHoverColour()

Colour ime::ui::EditBoxRenderer::getBorderHoverColour ( ) const

Get the background colour of when the mouse enters the edit box.

Returns
The background colour of when the mouse enters the edit box

◆ getBorders()

Borders ime::ui::EditBoxRenderer::getBorders ( ) const

Get the ize of the widgets borders.

Returns
The size of the widgets borders

◆ getCaretColour()

Colour ime::ui::EditBoxRenderer::getCaretColour ( ) const

Get the colour of the caret.

Returns
The colour of the caret

◆ getCaretHoverColour()

Colour ime::ui::EditBoxRenderer::getCaretHoverColour ( ) const

Get the colour of the caret when the mouse enters the edit box.

Returns
The colour of the caret when the mouse enters the edit box

◆ getCaretWidth()

float ime::ui::EditBoxRenderer::getCaretWidth ( ) const

Get the caret width.

Returns
The caret width

◆ getDefaultTextColour()

Colour ime::ui::EditBoxRenderer::getDefaultTextColour ( ) const

Get the colour f the default text.

Returns
The colour of the default text

◆ getDefaultTextStyle()

TextStyle ime::ui::EditBoxRenderer::getDefaultTextStyle ( ) const

Get the style of the default text.

Returns
The style of the default text

◆ getDisabledBackgroundColour()

Colour ime::ui::EditBoxRenderer::getDisabledBackgroundColour ( ) const

Get the background colour of the edit box when it is disabled.

Returns
The background colour of the edit box when it is disabled

◆ getDisabledBorderColour()

Colour ime::ui::EditBoxRenderer::getDisabledBorderColour ( ) const

Get the background colour when the edit box is disabled.

Returns
The background colour when the edit box is disabled

◆ getDisabledTextColour()

Colour ime::ui::EditBoxRenderer::getDisabledTextColour ( ) const

Get the text colour when the edit box is disabled

Returns
The text colour when the edit box is disabled

◆ getFocusedBackgroundColour()

Colour ime::ui::EditBoxRenderer::getFocusedBackgroundColour ( ) const

Get the background colour when the edit box is focused but not hovered.

Returns
The background colour when the edit box is focused but not hovered

◆ getFocusedBorderColour()

Colour ime::ui::EditBoxRenderer::getFocusedBorderColour ( ) const

Get the border colour when the edit box is focused but not hovered.

Returns
The border colour when the edit box is focused but not hovered

◆ getFocusedCaretColour()

Colour ime::ui::EditBoxRenderer::getFocusedCaretColour ( ) const

Get the colour of the caret when the edit box is focused.

Returns
The colour of the caret when the edit box is focused

◆ getFocusedTextColour()

Colour ime::ui::EditBoxRenderer::getFocusedTextColour ( ) const

Get the text colour when the edit box is focused.

Returns
Get the text colour when the edit box is focused

◆ getInternalPtr()

tgui::WidgetRenderer * ime::ui::EditBoxRenderer::getInternalPtr ( )
overridevirtual

◆ getOpacity()

float ime::ui::EditBoxRenderer::getOpacity ( ) const
overridevirtual

Get the opacity of the widget.

Returns
The opacity of the widget

Implements ime::ui::IWidgetRenderer.

◆ getOpacityDisabled()

float ime::ui::EditBoxRenderer::getOpacityDisabled ( ) const
overridevirtual

Get the opacity of the widget when it is disabled.

Returns
The opacity of the widget in disabled state

This function will return -1 if the widget uses the same opacity as the enabled state when it is disabled

Implements ime::ui::IWidgetRenderer.

◆ getPadding()

Padding ime::ui::EditBoxRenderer::getPadding ( ) const

Get the padding.

Returns
The padding set on the edit box

◆ getSelectedTextBackgroundColour()

Colour ime::ui::EditBoxRenderer::getSelectedTextBackgroundColour ( ) const

Get the background colour of the selected text.

Returns
The background colour of the selected text

◆ getSelectedTextColour()

Colour ime::ui::EditBoxRenderer::getSelectedTextColour ( ) const

Get the text colour of the selected text.

Returns
The text colour of the selected text

◆ getTextColour()

Colour ime::ui::EditBoxRenderer::getTextColour ( ) const

Get the text colour that will be used inside the edit box.

Returns
The text colour that will be used inside the edit box

◆ getTextStyle()

TextStyle ime::ui::EditBoxRenderer::getTextStyle ( ) const

Get the text style.

Returns
The text style

◆ ignoreTransparentTexture()

void ime::ui::EditBoxRenderer::ignoreTransparentTexture ( bool  ignoreTransparentParts)
overridevirtual

Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state.

Parameters
ignoreTransparentPartsTrue 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.

◆ isTransparentTextureIgnored()

bool ime::ui::EditBoxRenderer::isTransparentTextureIgnored ( ) const
overridevirtual

Check if mouse events are ignored on transparent parts of the texture or not.

Returns
True if mouse events are ignored, otherwise false
See also
ignoreTransparentTexture

Implements ime::ui::IWidgetRenderer.

◆ setBackgroundColour()

void ime::ui::EditBoxRenderer::setBackgroundColour ( Colour  colour)

Set the background colour of the edit box.

Parameters
colourThe background colour to set
Note
that this colour is ignored when you set a background image

◆ setBackgroundHoverColour()

void ime::ui::EditBoxRenderer::setBackgroundHoverColour ( Colour  colour)

Set the background colour of the edit box when the mouse enters it.

Parameters
colourThe background colour to set
Note
that this colour is ignored when you set a background image

◆ setBorderColour()

void ime::ui::EditBoxRenderer::setBorderColour ( Colour  colour)

Set the border colour.

Parameters
colourThe border colour to set

◆ setBorderHoverColour()

void ime::ui::EditBoxRenderer::setBorderHoverColour ( Colour  colour)

Set the background colour of when the mouse enters the edit box.

Parameters
colourThe background colour to set

◆ setBorders()

void ime::ui::EditBoxRenderer::setBorders ( const Borders borders)

Change the ize of the widget borders.

Parameters
bordersThe size of the borders

◆ setCaretColour()

void ime::ui::EditBoxRenderer::setCaretColour ( Colour  caretColour)

Set the colour of the caret.

Parameters
caretColourThe colour of the caret

◆ setCaretColourFocused()

void ime::ui::EditBoxRenderer::setCaretColourFocused ( Colour  caretColour)

Set the colour of the caret when the edit box is focused.

Parameters
caretColourThe new caret colour

◆ setCaretHoverColour()

void ime::ui::EditBoxRenderer::setCaretHoverColour ( Colour  caretColour)

Set the colour of the caret when the mouse enters the edit box.

Parameters
caretColourThe coulour to set

◆ setCaretWidth()

void ime::ui::EditBoxRenderer::setCaretWidth ( float  width)

Set the width of the caret.

Parameters
widthNew width of the caret

◆ setDefaultTextColour()

void ime::ui::EditBoxRenderer::setDefaultTextColour ( Colour  defaultTextColour)

Set the colour f the default text.

Parameters
defaultTextColourThe colour to set

◆ setDefaultTextStyle()

void ime::ui::EditBoxRenderer::setDefaultTextStyle ( TextStyle  style)

Set the style of the defaut text.

Parameters
styleThe style to set

◆ setDisabledBackgroundColour()

void ime::ui::EditBoxRenderer::setDisabledBackgroundColour ( Colour  colour)

Set the background colour of the edit box when it is disabled.

Parameters
colourBackground colour to set
Note
This colour is ignored when you set a background image

◆ setDisabledBorderColour()

void ime::ui::EditBoxRenderer::setDisabledBorderColour ( Colour  colour)

Set the background colour when the edit box is disabled.

Parameters
colourThe background colour when the edit box is disabled

◆ setDisabledTextColour()

void ime::ui::EditBoxRenderer::setDisabledTextColour ( Colour  textColour)

Set the text colour when the edit box is disabled

Parameters
textColourColour to set

◆ setDisabledTexture()

void ime::ui::EditBoxRenderer::setDisabledTexture ( const std::string &  filename)

Set the image when the edit box is disabled.

Parameters
filenameFilename of the image to be set
Exceptions
FileNotFoundExceptionIf the image cannot be found on the disk

When this image is set then the background colour property will be ignored

◆ setFocusedBackgroundColour()

void ime::ui::EditBoxRenderer::setFocusedBackgroundColour ( Colour  colour)

Set the background colour when the edit box is focused but not hovered.

Parameters
colourBackground colour to be set
Note
This colour is ignored when you set a background image

◆ setFocusedBorderColour()

void ime::ui::EditBoxRenderer::setFocusedBorderColour ( Colour  colour)

Set the border colour when the edit box is focused but not hovered.

Parameters
colourBorder colour to set

◆ setFocusedTextColour()

void ime::ui::EditBoxRenderer::setFocusedTextColour ( Colour  textColour)

Set the text colour when the edit box is focused.

Parameters
textColourColour to set

◆ setFocusedTexture()

void ime::ui::EditBoxRenderer::setFocusedTexture ( const std::string &  filename)

Set the image when the edit box is focused but not hovered.

Parameters
filenameFilename of the image to be set
Exceptions
FileNotFoundExceptionIf the image cannot be found on the disk

When this image is set then the background colour property will be ignored

◆ setFont()

void ime::ui::EditBoxRenderer::setFont ( const std::string &  filename)
overridevirtual

Change the widgets font.

Parameters
filenameFilename of the new font
Exceptions
FileNotFoundExceptionIf the font cannot be found on the disk

Implements ime::ui::IWidgetRenderer.

◆ setHoverTexture()

void ime::ui::EditBoxRenderer::setHoverTexture ( const std::string &  filename)

Set the image when the mouse enters the edit box.

Parameters
filenameFilename of the image to be set
Exceptions
FileNotFoundExceptionIf the image cannot be found on the disk

When this image is set then the background colour property will be ignored

◆ setInternalPtr()

void ime::ui::EditBoxRenderer::setInternalPtr ( tgui::WidgetRenderer *  renderer)
overridevirtual

◆ setOpacity()

void ime::ui::EditBoxRenderer::setOpacity ( float  opacity)
overridevirtual

Set the opacity of the widget.

Parameters
opacityThe new opacity of the widget in between 0 and 1

0 means completely transparent, while 1 (default) means fully opaque

Implements ime::ui::IWidgetRenderer.

◆ setOpacityDisabled()

void ime::ui::EditBoxRenderer::setOpacityDisabled ( float  opacity)
overridevirtual

Set the opacity of the widget when it is disabled.

Parameters
opacityOpacity 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.

◆ setPadding()

void ime::ui::EditBoxRenderer::setPadding ( const Padding padding)

SDet the adding of the edit box.

Parameters
paddingThe 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

◆ setSelectedTextBackgroundColour()

void ime::ui::EditBoxRenderer::setSelectedTextBackgroundColour ( Colour  backgroundColour)

Set the background colour of the selected text.

Parameters
backgroundColourNew background colour

◆ setSelectedTextColour()

void ime::ui::EditBoxRenderer::setSelectedTextColour ( Colour  colour)

Set the text colour of the selected text.

Parameters
colourNew colour

◆ setTextColour()

void ime::ui::EditBoxRenderer::setTextColour ( Colour  textColour)

Set the text colour that will be used inside the edit box.

Parameters
textColourThe new text colour

◆ setTextStyle()

void ime::ui::EditBoxRenderer::setTextStyle ( TextStyle  style)

Set the text style.

Parameters
styleStyle to set

◆ setTexture()

void ime::ui::EditBoxRenderer::setTexture ( const std::string &  filename)

Set the background image of the edit box.

Parameters
filenameFilename of the image to be set
Exceptions
FileNotFoundExceptionIf the image cannot be found on the disk

When this image is set then the background colour property will be ignored


The documentation for this class was generated from the following file: