A MessageBox renderer. More...
#include <MessageBoxRenderer.h>
Public Types | |
using | Ptr = std::shared_ptr< MessageBoxRenderer > |
Shared renderer pointer. More... | |
Public Member Functions | |
void | setTextColour (Colour textColour) |
Set the colour of the text. More... | |
Colour | getTextColour () const |
Get the colour of the 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 | setTitleBarHeight (float height) |
Set the height of the title bar. More... | |
float | getTitleBarHeight () const |
Get the height of the title bar. More... | |
void | setTitleBarColour (Colour colour) |
Set the colour of the title bar. More... | |
Colour | getTitleBarColour () const |
Get the colour of the title bar. More... | |
void | setTitleColour (Colour colour) |
Set the colour of the title that is displayed in the title bar of the message box. More... | |
Colour | getTitleColour () const |
Get the colour of the title that is displayed in the title bar of the message box. More... | |
void | setBackgroundColour (Colour colour) |
Set the background colour of the message box. More... | |
Colour | getBackgroundColour () const |
Get the background colour of message box. More... | |
void | setBorderColour (Colour colour) |
Set the border colour. More... | |
Colour | getBorderColour () const |
Get the border colour. More... | |
void | setFocusedBorderColour (Colour colour) |
Set the border colour when the message box is focused but not hovered. More... | |
Colour | getBorderColourFocused () const |
Get the border colour when the message box is focused but not hovered. More... | |
void | setBorderBelowTitleBar (float border) |
Set the distance between the title bar and the actual contents of the message box. More... | |
float | getBorderBelowTitleBar () const |
Get the distance between the title bar and the actual contents of the message box. More... | |
void | setDistanceToSide (float distanceToSide) |
Set the distance of the title or close button from the side of the title bar. More... | |
float | getDistanceToSide () const |
Get the distance of the title or close button from the side of the title bar. More... | |
void | setPaddingBetweenButtons (float padding) |
Set the distance between the title buttons if multiple exist. More... | |
float | getPaddingBetweenButtons () const |
# More... | |
void | setMinimumResizableBorderWidth (float minimumBorderWidth) |
Set the minimum width of the area where you can drag to resize the message box. More... | |
float | getMinimumResizableBorderWidth () const |
Get the minimum width of the area where you can drag to resize the message box. More... | |
void | setShowTextOnTitleButtons (bool showText) |
Set whether characters are rendered on top of the title buttons. More... | |
bool | isTextShownOnTitleButtons () const |
Check if characters are rendered on top of the title buttons. More... | |
void | setTextureTitleBar (const std::string &filename) |
Set the image of the title bar. More... | |
void | setTextureBackground (const std::string &filename) |
Set the background image. 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 |
~MessageBoxRenderer () override | |
Destructor. More... | |
A MessageBox renderer.
This class allows you to manipulate the render properties of a MessageBox widget
Definition at line 44 of file MessageBoxRenderer.h.
using ime::ui::MessageBoxRenderer::Ptr = std::shared_ptr<MessageBoxRenderer> |
Shared renderer pointer.
Definition at line 46 of file MessageBoxRenderer.h.
|
override |
Destructor.
|
overridevirtual |
Colour ime::ui::MessageBoxRenderer::getBackgroundColour | ( | ) | const |
Get the background colour of message box.
float ime::ui::MessageBoxRenderer::getBorderBelowTitleBar | ( | ) | const |
Get the distance between the title bar and the actual contents of the message box.
Colour ime::ui::MessageBoxRenderer::getBorderColour | ( | ) | const |
Get the border colour.
Colour ime::ui::MessageBoxRenderer::getBorderColourFocused | ( | ) | const |
Get the border colour when the message box is focused but not hovered.
Borders ime::ui::MessageBoxRenderer::getBorders | ( | ) | const |
Get the ize of the widgets borders.
float ime::ui::MessageBoxRenderer::getDistanceToSide | ( | ) | const |
Get the distance of the title or close button from the side of the title bar.
|
overridevirtual |
Implements ime::ui::IWidgetRenderer.
float ime::ui::MessageBoxRenderer::getMinimumResizableBorderWidth | ( | ) | const |
Get the minimum width of the area where you can drag to resize the message box.
|
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.
float ime::ui::MessageBoxRenderer::getPaddingBetweenButtons | ( | ) | const |
#
Get the distance between the title buttons if multiple exist
Colour ime::ui::MessageBoxRenderer::getTextColour | ( | ) | const |
Get the colour of the text.
Colour ime::ui::MessageBoxRenderer::getTitleBarColour | ( | ) | const |
Get the colour of the title bar.
float ime::ui::MessageBoxRenderer::getTitleBarHeight | ( | ) | const |
Get the height of the title bar.
Colour ime::ui::MessageBoxRenderer::getTitleColour | ( | ) | const |
Get the colour of the title that is displayed in the title bar of the message box.
|
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.
bool ime::ui::MessageBoxRenderer::isTextShownOnTitleButtons | ( | ) | const |
Check if characters are rendered on top of the title buttons.
|
overridevirtual |
Check if mouse events are ignored on transparent parts of the texture or not.
Implements ime::ui::IWidgetRenderer.
void ime::ui::MessageBoxRenderer::setBackgroundColour | ( | Colour | colour | ) |
Set the background colour of the message box.
colour | The background colour to set |
void ime::ui::MessageBoxRenderer::setBorderBelowTitleBar | ( | float | border | ) |
Set the distance between the title bar and the actual contents of the message box.
border | Space between title bar and message box contents |
void ime::ui::MessageBoxRenderer::setBorderColour | ( | Colour | colour | ) |
Set the border colour.
colour | The border colour to set |
void ime::ui::MessageBoxRenderer::setBorders | ( | const Borders & | borders | ) |
Change the ize of the widget borders.
borders | The size of the borders |
void ime::ui::MessageBoxRenderer::setDistanceToSide | ( | float | distanceToSide | ) |
Set the distance of the title or close button from the side of the title bar.
distanceToSide | Distance between the title and the side of the title bar |
void ime::ui::MessageBoxRenderer::setFocusedBorderColour | ( | Colour | colour | ) |
Set the border colour when the message box 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.
void ime::ui::MessageBoxRenderer::setMinimumResizableBorderWidth | ( | float | minimumBorderWidth | ) |
Set the minimum width of the area where you can drag to resize the message box.
minimumBorderWidth | Minimum amount of pixels where the message box can be dragged to resize it |
If the border is larger than minimumBorderWidth then this function has no effect. If the borders are smaller, several invisible pixels next to the border can also be used to resize the message box
|
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::MessageBoxRenderer::setPaddingBetweenButtons | ( | float | padding | ) |
Set the distance between the title buttons if multiple exist.
padding | Distance between the title buttons |
void ime::ui::MessageBoxRenderer::setShowTextOnTitleButtons | ( | bool | showText | ) |
Set whether characters are rendered on top of the title buttons.
showText | True if text is to be shown on the title bar buttons, otherwise false |
void ime::ui::MessageBoxRenderer::setTextColour | ( | Colour | textColour | ) |
Set the colour of the text.
textColour | The new text colour |
void ime::ui::MessageBoxRenderer::setTextureBackground | ( | const std::string & | filename | ) |
Set the background image.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When this image is set, the background colour property will be ignored
void ime::ui::MessageBoxRenderer::setTextureTitleBar | ( | const std::string & | filename | ) |
Set the image of the title bar.
filename | Filename of the image to be set |
FileNotFoundException | If the image cannot be found on the disk |
When this image is set, the title bar colour property will be ignored
void ime::ui::MessageBoxRenderer::setTitleBarColour | ( | Colour | colour | ) |
Set the colour of the title bar.
colour | Colour to set |
void ime::ui::MessageBoxRenderer::setTitleBarHeight | ( | float | height | ) |
Set the height of the title bar.
height | New height of the title bar |
void ime::ui::MessageBoxRenderer::setTitleColour | ( | Colour | colour | ) |
Set the colour of the title that is displayed in the title bar of the message box.
colour | Colour to set |