A CheckBox widget renderer. More...
#include <CheckBoxRenderer.h>
Public Types | |
using | Ptr = std::shared_ptr< CheckBoxRenderer > |
Shared renderer pointer. More... | |
Public Member Functions | |
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 | setTextDistanceRatio (float ratio) |
Set the relative distance between the checkbox and the text next to it. More... | |
float | getTextDistanceRatio () const |
Get the relative distance between the checkbox and the text next to it. More... | |
void | setTextColour (Colour textColour) |
Set the text colour that will be used inside the checkbox. More... | |
Colour | getTextColour () const |
Get the colour of the checkbox text. More... | |
void | setTextHoverColour (Colour colour) |
Set the text colour when the mouse enters the button. More... | |
Colour | getTextHoverColour () const |
Get the text colour when the mouse enters the button. More... | |
void | setDisabledTextColour (Colour textColour) |
Set the text colour when the checkbox is disabled More... | |
Colour | getDisabledTextColour () const |
Get the text colour when the checkbox is disabled More... | |
void | setCheckedTextColour (Colour colour) |
Set the colour of text when the checkbox is checked. More... | |
Colour | getTextColourChecked () const |
Get the colour of text when the checkbox is checked. More... | |
void | setCheckedTextHoverColour (Colour colour) |
Set the colour of the text when the mouse enters the checkbox and it is checked. More... | |
Colour | getCheckedTextHoverColour () const |
Get the colour of the text when the mouse enters the checkbox and it is checked. More... | |
void | setCheckedDisabledTextColour (Colour colour) |
Set the colour of the text when the checkbox is checked and disabled. More... | |
Colour | getCheckedDisabledTextColour () const |
Get the colour of the text when the checkbox is checked and disabled. More... | |
void | setBackgroundColour (Colour colour) |
Set the background colour of the checkbox. More... | |
Colour | getBackgroundColour () const |
Get the background colour of checkbox. More... | |
void | setBackgroundHoverColour (Colour colour) |
Set the background colour of the checkbox when the mouse enters it. More... | |
Colour | getBackgroundHoverColour () const |
Get the background colour of the checkbox when the mouse enters it. More... | |
void | setDisabledBackgroundColour (Colour colour) |
Set the background colour of the checkbox when it is disabled. More... | |
Colour | getDisabledBackgroundColour () const |
Get the background colour of the checkbox when it is disabled. More... | |
void | setCheckedBackgroundColour (Colour colour) |
Set the background colour used when the checkbox is checked. More... | |
Colour | getCheckedBackgroundColour () const |
Get the background colour used when the checkbox is checked. More... | |
void | setCheckedHoverBackgroundColour (Colour colour) |
Set the background colour when the mouse cursor enters the checkbox and it's checked. More... | |
Colour | getCheckedHoverBackgroundColour () const |
Get the background colour when the mouse cursor enters the checkbox and it's checked. More... | |
void | setCheckedDisabledBackgroundColour (Colour colour) |
Set the background colour when the checkbox is checked and disabled. More... | |
Colour | getCheckedDisabledBackgroundColour () const |
Get the background colour when the checkbox is checked and disabled. 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 checkbox. More... | |
Colour | getBorderHoverColour () const |
Get the background colour of when the mouse enters the checkbox. More... | |
void | setDisabledBorderColour (Colour colour) |
Set the background colour when the checkbox is disabled. More... | |
Colour | getDisabledBorderColour () const |
Get the background colour when the checkbox is disabled. More... | |
void | setFocusedBorderColour (Colour colour) |
Set the border colour when the checkbox is focused but not hovered. More... | |
Colour | getFocusedBorderColour () const |
Get the border colour when the checkbox is focused but not hovered. More... | |
void | setCheckedBorderColour (Colour colour) |
Set the border colour when the checkbox is checked. More... | |
Colour | getCheckedBorderColour () const |
Get the border colour when the checkbox is checked. More... | |
void | setCheckedHoverBorderColour (Colour colour) |
Set the colour of the checkbox when the mouse cursor enters it and it's checked. More... | |
Colour | getCheckedHoverBorderColour () const |
Get the colour of the checkbox when the mouse cursor enters it and it's checked. More... | |
void | setCheckedDisabledBorderColour (Colour colour) |
Set the border colour when the checkbox is checked and disabled. More... | |
Colour | getCheckedDisabledBorderColour () const |
Get the border colour when the checkbox is checked and disabled. More... | |
void | setCheckedFocusedBorderColour (Colour colour) |
Set the border colour when the checkbox is checked and focused. More... | |
Colour | getCheckedFocusedBorderColour () const |
Get the border colour when the checkbox is checked and focused. More... | |
void | setCheckColour (Colour colour) |
Set the colour that is used to fill the checkbox when it is checked. More... | |
Colour | getCheckColour () const |
Get the colour that is used to fill the checkbox when it is checked. More... | |
void | setCheckHoverColour (Colour colour) |
Set the colour that is used to fill the checkbox when the mouse is on top of it. More... | |
Colour | getCheckHoverColour () const |
Get the colour that is used to fill the checkbox when the mouse is on top of it. More... | |
void | setDisabledCheckedColour (Colour colour) |
Set the colour that is used to fill the checkbox when the checkbox is disabled. More... | |
Colour | getDisabledCheckColour () const |
Get the colour that is used to fill the checkbox when the checkbox is disabled. More... | |
void | setUncheckedTexture (const std::string &filename) |
Set the image that is displayed when the checkbox is not checked. More... | |
void | setCheckedTexture (const std::string &filename) |
Set the image that is displayed when the checkbox is checked. More... | |
void | setUncheckedHoverTexture (const std::string &filename) |
Set the image that is displayed when the checkbox is not checked and the mouse is on top of the checkbox. More... | |
void | setCheckedHoverTexture (const std::string &filename) |
Set the image that is displayed when the checkbox is checked and the mouse is on top of the checkbox. More... | |
void | setUncheckedDisabledTexture (const std::string &filename) |
Set the image that is displayed when the checkbox is not checked and it's disabled. More... | |
void | setCheckedDisabledTexture (const std::string &filename) |
Set the image that is displayed when the checkbox is checked and it's disabled. More... | |
void | setUncheckedFocusedTexture (const std::string &filename) |
Set the image that is displayed on top of the checkbox when it is unchecked and focused. More... | |
void | setCheckedFocusedTexture (const std::string &filename) |
Set the image that is displayed on top of the checkbox when it is checked and focused. More... | |
void | setTextStyle (TextStyle style) |
Set the text style. More... | |
TextStyle | getTextStyle () const |
Get the text style. More... | |
void | setCheckedTextStyle (TextStyle style) |
Set the text style when the checkbox is checked. More... | |
TextStyle | getCheckedTextStyle () const |
Get the text style when the checkbox is checked. 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 |
~CheckBoxRenderer () override | |
Destructor. More... | |
A CheckBox widget renderer.
This class allows you to manipulate the render properties of a CheckBox
Definition at line 44 of file CheckBoxRenderer.h.
using ime::ui::CheckBoxRenderer::Ptr = std::shared_ptr<CheckBoxRenderer> |
Shared renderer pointer.
Definition at line 46 of file CheckBoxRenderer.h.
|
override |
Destructor.
|
overridevirtual |
Colour ime::ui::CheckBoxRenderer::getBackgroundColour | ( | ) | const |
Get the background colour of checkbox.
Colour ime::ui::CheckBoxRenderer::getBackgroundHoverColour | ( | ) | const |
Get the background colour of the checkbox when the mouse enters it.
Colour ime::ui::CheckBoxRenderer::getBorderColour | ( | ) | const |
Get the border colour.
Colour ime::ui::CheckBoxRenderer::getBorderHoverColour | ( | ) | const |
Get the background colour of when the mouse enters the checkbox.
Borders ime::ui::CheckBoxRenderer::getBorders | ( | ) | const |
Get the ize of the widgets borders.
Colour ime::ui::CheckBoxRenderer::getCheckColour | ( | ) | const |
Get the colour that is used to fill the checkbox when it is checked.
Colour ime::ui::CheckBoxRenderer::getCheckedBackgroundColour | ( | ) | const |
Get the background colour used when the checkbox is checked.
Colour ime::ui::CheckBoxRenderer::getCheckedBorderColour | ( | ) | const |
Get the border colour when the checkbox is checked.
Colour ime::ui::CheckBoxRenderer::getCheckedDisabledBackgroundColour | ( | ) | const |
Get the background colour when the checkbox is checked and disabled.
Colour ime::ui::CheckBoxRenderer::getCheckedDisabledBorderColour | ( | ) | const |
Get the border colour when the checkbox is checked and disabled.
Colour ime::ui::CheckBoxRenderer::getCheckedDisabledTextColour | ( | ) | const |
Get the colour of the text when the checkbox is checked and disabled.
Colour ime::ui::CheckBoxRenderer::getCheckedFocusedBorderColour | ( | ) | const |
Get the border colour when the checkbox is checked and focused.
Colour ime::ui::CheckBoxRenderer::getCheckedHoverBackgroundColour | ( | ) | const |
Get the background colour when the mouse cursor enters
the checkbox and it's checked.
Colour ime::ui::CheckBoxRenderer::getCheckedHoverBorderColour | ( | ) | const |
Get the colour of the checkbox when the mouse cursor enters it and it's checked.
Colour ime::ui::CheckBoxRenderer::getCheckedTextHoverColour | ( | ) | const |
Get the colour of the text when the mouse enters the checkbox and it is checked.
TextStyle ime::ui::CheckBoxRenderer::getCheckedTextStyle | ( | ) | const |
Get the text style when the checkbox is checked.
Colour ime::ui::CheckBoxRenderer::getCheckHoverColour | ( | ) | const |
Get the colour that is used to fill the checkbox when the mouse is on top of it.
Colour ime::ui::CheckBoxRenderer::getDisabledBackgroundColour | ( | ) | const |
Get the background colour of the checkbox when it is disabled.
Colour ime::ui::CheckBoxRenderer::getDisabledBorderColour | ( | ) | const |
Get the background colour when the checkbox is disabled.
Colour ime::ui::CheckBoxRenderer::getDisabledCheckColour | ( | ) | const |
Get the colour that is used to fill the checkbox when the checkbox is disabled.
Colour ime::ui::CheckBoxRenderer::getDisabledTextColour | ( | ) | const |
Get the text colour when the checkbox is disabled
Colour ime::ui::CheckBoxRenderer::getFocusedBorderColour | ( | ) | const |
Get the border colour when the checkbox is focused but not hovered.
|
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.
Colour ime::ui::CheckBoxRenderer::getTextColour | ( | ) | const |
Get the colour of the checkbox text.
Colour ime::ui::CheckBoxRenderer::getTextColourChecked | ( | ) | const |
Get the colour of text when the checkbox is checked.
float ime::ui::CheckBoxRenderer::getTextDistanceRatio | ( | ) | const |
Get the relative distance between the checkbox and the text next to it.
Colour ime::ui::CheckBoxRenderer::getTextHoverColour | ( | ) | const |
Get the text colour when the mouse enters the button.
TextStyle ime::ui::CheckBoxRenderer::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::CheckBoxRenderer::setBackgroundColour | ( | Colour | colour | ) |
Set the background colour of the checkbox.
colour | The background colour to set |
void ime::ui::CheckBoxRenderer::setBackgroundHoverColour | ( | Colour | colour | ) |
Set the background colour of the checkbox when the mouse enters it.
colour | The background colour to set |
void ime::ui::CheckBoxRenderer::setBorderColour | ( | Colour | colour | ) |
Set the border colour.
colour | The border colour to set |
void ime::ui::CheckBoxRenderer::setBorderHoverColour | ( | Colour | colour | ) |
Set the background colour of when the mouse enters the checkbox.
colour | The background colour to set |
void ime::ui::CheckBoxRenderer::setBorders | ( | const Borders & | borders | ) |
Change the ize of the widget borders.
borders | The size of the borders |
void ime::ui::CheckBoxRenderer::setCheckColour | ( | Colour | colour | ) |
Set the colour that is used to fill the checkbox when it is checked.
colour | Colour to set |
void ime::ui::CheckBoxRenderer::setCheckedBackgroundColour | ( | Colour | colour | ) |
Set the background colour used when the checkbox is checked.
colour | the new colour |
void ime::ui::CheckBoxRenderer::setCheckedBorderColour | ( | Colour | colour | ) |
Set the border colour when the checkbox is checked.
colour | The colour to set |
void ime::ui::CheckBoxRenderer::setCheckedDisabledBackgroundColour | ( | Colour | colour | ) |
Set the background colour when the checkbox is checked and disabled.
colour | Colour to set |
void ime::ui::CheckBoxRenderer::setCheckedDisabledBorderColour | ( | Colour | colour | ) |
Set the border colour when the checkbox is checked and disabled.
colour | The colour to set |
void ime::ui::CheckBoxRenderer::setCheckedDisabledTextColour | ( | Colour | colour | ) |
Set the colour of the text when the checkbox is checked and disabled.
colour | New colour |
void ime::ui::CheckBoxRenderer::setCheckedDisabledTexture | ( | const std::string & | filename | ) |
Set the image that is displayed when the checkbox is checked and it's disabled.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
This only has effect when the normal checked and unchecked images are also set
void ime::ui::CheckBoxRenderer::setCheckedFocusedBorderColour | ( | Colour | colour | ) |
Set the border colour when the checkbox is checked and focused.
colour | The colour to set |
void ime::ui::CheckBoxRenderer::setCheckedFocusedTexture | ( | const std::string & | filename | ) |
Set the image that is displayed on top of the checkbox when it is checked and focused.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
This only has effect when the normal checked and unchecked images are also set. Pass an empty texture to unset the image
void ime::ui::CheckBoxRenderer::setCheckedHoverBackgroundColour | ( | Colour | colour | ) |
Set the background colour when the mouse cursor enters
the checkbox and it's checked.
colour | colour to set |
void ime::ui::CheckBoxRenderer::setCheckedHoverBorderColour | ( | Colour | colour | ) |
Set the colour of the checkbox when the mouse cursor enters it and it's checked.
colour | Colour to set |
void ime::ui::CheckBoxRenderer::setCheckedHoverTexture | ( | const std::string & | filename | ) |
Set the image that is displayed when the checkbox is checked and the mouse is on top of the checkbox.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
This only has effect when the normal checked and unchecked images are also set
void ime::ui::CheckBoxRenderer::setCheckedTextColour | ( | Colour | colour | ) |
Set the colour of text when the checkbox is checked.
colour | Colour to set |
void ime::ui::CheckBoxRenderer::setCheckedTextHoverColour | ( | Colour | colour | ) |
Set the colour of the text when the mouse enters the checkbox and it is checked.
colour | The colour to set |
void ime::ui::CheckBoxRenderer::setCheckedTextStyle | ( | TextStyle | style | ) |
Set the text style when the checkbox is checked.
style | The new style |
void ime::ui::CheckBoxRenderer::setCheckedTexture | ( | const std::string & | filename | ) |
Set the image that is displayed when the checkbox is checked.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When checked and unchecked images are set, the background and check colour properties will be ignored.
void ime::ui::CheckBoxRenderer::setCheckHoverColour | ( | Colour | colour | ) |
Set the colour that is used to fill the checkbox when the mouse is on top of it.
colour | The colour to set |
void ime::ui::CheckBoxRenderer::setDisabledBackgroundColour | ( | Colour | colour | ) |
Set the background colour of the checkbox when it is disabled.
colour | Background colour to set |
void ime::ui::CheckBoxRenderer::setDisabledBorderColour | ( | Colour | colour | ) |
Set the background colour when the checkbox is disabled.
colour | The background colour when the checkbox is disabled |
void ime::ui::CheckBoxRenderer::setDisabledCheckedColour | ( | Colour | colour | ) |
Set the colour that is used to fill the checkbox when the checkbox is disabled.
colour | The new colour to set |
void ime::ui::CheckBoxRenderer::setDisabledTextColour | ( | Colour | textColour | ) |
Set the text colour when the checkbox is disabled
textColour | Colour to set |
void ime::ui::CheckBoxRenderer::setFocusedBorderColour | ( | Colour | colour | ) |
Set the border colour when the checkbox is focused but not hovered.
colour | Border colour to set |
|
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.
|
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::CheckBoxRenderer::setTextColour | ( | Colour | textColour | ) |
Set the text colour that will be used inside the checkbox.
textColour | The new text colour |
void ime::ui::CheckBoxRenderer::setTextDistanceRatio | ( | float | ratio | ) |
Set the relative distance between the checkbox and the text next to it.
ratio | The ratio of the distance based on the width of the checkbox |
The default value is 0.2 which means that if the width of the checkbox would be 50 pixels then the gap between the radio button and the text will be 10 pixels.
void ime::ui::CheckBoxRenderer::setTextHoverColour | ( | Colour | colour | ) |
Set the text colour when the mouse enters the button.
colour | The colour to be set |
void ime::ui::CheckBoxRenderer::setTextStyle | ( | TextStyle | style | ) |
Set the text style.
style | Style to set |
void ime::ui::CheckBoxRenderer::setUncheckedDisabledTexture | ( | const std::string & | filename | ) |
Set the image that is displayed when the checkbox is not checked and it's disabled.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
This only has effect when the normal checked and unchecked images are also set
void ime::ui::CheckBoxRenderer::setUncheckedFocusedTexture | ( | const std::string & | filename | ) |
Set the image that is displayed on top of the checkbox when it is unchecked and focused.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
This only has effect when the normal checked and unchecked images are also set. Pass an empty texture to unset the image
void ime::ui::CheckBoxRenderer::setUncheckedHoverTexture | ( | const std::string & | filename | ) |
Set the image that is displayed when the checkbox is not checked and the mouse is on top of the checkbox.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
This only has effect when the normal checked and unchecked images are also set
void ime::ui::CheckBoxRenderer::setUncheckedTexture | ( | const std::string & | filename | ) |
Set the image that is displayed when the checkbox is not checked.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When checked and unchecked images are set, the background and check colour properties will be ignored