#include <MenuBarRenderer.h>
Public Types | |
using | Ptr = std::unique_ptr< MenuBarRenderer > |
Shared renderer pointer. More... | |
Public Member Functions | |
void | setBackgroundColour (Colour colour) |
Set the background colour of the menu bar. More... | |
Colour | getBackgroundColour () const |
Get the background colour of menu bar. More... | |
void | setSelectedBackgroundColour (Colour backgroundColour) |
Set the background colour of a menu item when it is selected. More... | |
Colour | getSelectedBackgroundColour () const |
Get the background colour of a menu item when it is selected. More... | |
void | setTextColour (Colour textColour) |
Set the colour of the text. More... | |
Colour | getTextColour () const |
Get the colour of the text. More... | |
void | setSelectedTextColour (Colour textColour) |
Set the text colour of a menu item when it is selected. More... | |
Colour | getSelectedTextColour () const |
Get the text colour of a menu item when it is selected. More... | |
void | setDisabledTextColour (Colour textColour) |
Set the text colour when the menu bar is disabled. More... | |
Colour | getDisabledTextColour () const |
Get the text colour of the menu bar when it is disabled. More... | |
void | setBackgroundTexture (const std::string &filename) |
Set the background image of the menu bar. More... | |
void | setItemBackgroundTexture (const std::string &filename) |
Set the background image of a menu item when it is not selected. More... | |
void | setSelectedItemBackgroundTexture (const std::string &filename) |
Set the background image of a menu item when it is selected. More... | |
void | setDistanceToSide (float distanceToSide) |
Set the distance between the text and the side of the menu item. More... | |
float | getDistanceToSide () const |
Get the distance between the text and the side of the menu item. More... | |
void | setOpacity (float opacity) override |
Set the opacity of the menu bar. More... | |
float | getOpacity () const override |
Get the opacity of the menu bar. More... | |
void | setOpacityDisabled (float opacity) override |
Set the opacity of the menu bar when it is disabled. More... | |
float | getOpacityDisabled () const override |
Get the opacity of the menu bar when it is disabled. More... | |
void | setFont (const std::string &filename) override |
Change the menu bars font. More... | |
void | ignoreTransparentTexture (bool ignoreTransparentParts) override |
Set whether mouse events should be ignored on transparent parts of the texture of the menu bar 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 |
~MenuBarRenderer () override | |
Destructor. More... | |
A MenuBar renderer.
This class allows you to manipulate the render properties of a MenuBar widget
Definition at line 44 of file MenuBarRenderer.h.
using ime::ui::MenuBarRenderer::Ptr = std::unique_ptr<MenuBarRenderer> |
Shared renderer pointer.
Definition at line 46 of file MenuBarRenderer.h.
|
override |
Destructor.
|
overridevirtual |
Colour ime::ui::MenuBarRenderer::getBackgroundColour | ( | ) | const |
Get the background colour of menu bar.
Colour ime::ui::MenuBarRenderer::getDisabledTextColour | ( | ) | const |
Get the text colour of the menu bar when it is disabled.
float ime::ui::MenuBarRenderer::getDistanceToSide | ( | ) | const |
Get the distance between the text and the side of the menu item.
|
overridevirtual |
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Get the opacity of the menu bar.
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Get the opacity of the menu bar when it is disabled.
This function will return -1 if the menu bar uses the same opacity as the enabled state when it is disabled
Implements ime::ui::IWidgetRenderer.
Colour ime::ui::MenuBarRenderer::getSelectedBackgroundColour | ( | ) | const |
Get the background colour of a menu item when it is selected.
Colour ime::ui::MenuBarRenderer::getSelectedTextColour | ( | ) | const |
Get the text colour of a menu item when it is selected.
Colour ime::ui::MenuBarRenderer::getTextColour | ( | ) | const |
Get the colour of the text.
|
overridevirtual |
Set whether mouse events should be ignored on transparent parts of the texture of the menu bar 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 menu bar behind the menu bar. By default, mouse events are NOT ignored and the menu bar will receive mouse events even on transparent texture parts. This property does nothing if the menu bar 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::MenuBarRenderer::setBackgroundColour | ( | Colour | colour | ) |
Set the background colour of the menu bar.
colour | The background colour to set |
void ime::ui::MenuBarRenderer::setBackgroundTexture | ( | const std::string & | filename | ) |
Set the background image of the menu bar.
filename | The filename of the image to set |
FileNotFoundException | if filename cannot be found on the disk |
When this image is set, the background colour property will be ignored
void ime::ui::MenuBarRenderer::setDisabledTextColour | ( | Colour | textColour | ) |
Set the text colour when the menu bar is disabled.
textColour | Disabled menu bar text colour |
void ime::ui::MenuBarRenderer::setDistanceToSide | ( | float | distanceToSide | ) |
Set the distance between the text and the side of the menu item.
distanceToSide | distance between the text and the side of the menu item |
|
overridevirtual |
Change the menu bars 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::MenuBarRenderer::setItemBackgroundTexture | ( | const std::string & | filename | ) |
Set the background image of a menu item when it is not selected.
filename | Filename of the image to set |
|
overridevirtual |
Set the opacity of the menu bar.
opacity | The new opacity of the menu bar 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 menu bar 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 menu bar is disabled.
Implements ime::ui::IWidgetRenderer.
void ime::ui::MenuBarRenderer::setSelectedBackgroundColour | ( | Colour | backgroundColour | ) |
Set the background colour of a menu item when it is selected.
backgroundColour | The background colour to set |
void ime::ui::MenuBarRenderer::setSelectedItemBackgroundTexture | ( | const std::string & | filename | ) |
Set the background image of a menu item when it is selected.
filename | Filename of the image to set |
void ime::ui::MenuBarRenderer::setSelectedTextColour | ( | Colour | textColour | ) |
Set the text colour of a menu item when it is selected.
textColour | The selected text colour to set |
void ime::ui::MenuBarRenderer::setTextColour | ( | Colour | textColour | ) |
Set the colour of the text.
textColour | The new text colour |