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

A MenuBar renderer. More...

#include <MenuBarRenderer.h>

Inheritance diagram for ime::ui::MenuBarRenderer:
ime::ui::IWidgetRenderer

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

Detailed Description

A MenuBar renderer.

This class allows you to manipulate the render properties of a MenuBar widget

Definition at line 44 of file MenuBarRenderer.h.

Member Typedef Documentation

◆ Ptr

Shared renderer pointer.

Definition at line 46 of file MenuBarRenderer.h.

Constructor & Destructor Documentation

◆ ~MenuBarRenderer()

ime::ui::MenuBarRenderer::~MenuBarRenderer ( )
override

Destructor.

Member Function Documentation

◆ clone()

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

Create a copy of the render.

Returns
A copy of the render

Implements ime::ui::IWidgetRenderer.

◆ getBackgroundColour()

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

Get the background colour of menu bar.

Returns
The background colour of the menu bar

◆ getDisabledTextColour()

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

Get the text colour of the menu bar when it is disabled.

Returns
The text colour when disabled

◆ getDistanceToSide()

float ime::ui::MenuBarRenderer::getDistanceToSide ( ) const

Get the distance between the text and the side of the menu item.

Returns
The distance between the text and the side of the menu item

◆ getInternalPtr()

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

◆ getOpacity()

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

Get the opacity of the menu bar.

Returns
The opacity of the menu bar

Implements ime::ui::IWidgetRenderer.

◆ getOpacityDisabled()

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

Get the opacity of the menu bar when it is disabled.

Returns
The opacity of the menu bar in disabled state

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.

◆ getSelectedBackgroundColour()

Colour ime::ui::MenuBarRenderer::getSelectedBackgroundColour ( ) const

Get the background colour of a menu item when it is selected.

Returns
The selected item background colour

◆ getSelectedTextColour()

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

Get the text colour of a menu item when it is selected.

Returns
The text colour of a menu item when it is selected

◆ getTextColour()

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

Get the colour of the text.

Returns
The text colour

◆ ignoreTransparentTexture()

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

Set whether mouse events should be ignored on transparent parts of the texture of the menu bar 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 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.

◆ isTransparentTextureIgnored()

bool ime::ui::MenuBarRenderer::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::MenuBarRenderer::setBackgroundColour ( Colour  colour)

Set the background colour of the menu bar.

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

◆ setBackgroundTexture()

void ime::ui::MenuBarRenderer::setBackgroundTexture ( const std::string &  filename)

Set the background image of the menu bar.

Parameters
filenameThe filename of the image to set
Exceptions
FileNotFoundExceptionif filename cannot be found on the disk

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

◆ setDisabledTextColour()

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

Set the text colour when the menu bar is disabled.

Parameters
textColourDisabled menu bar text colour

◆ setDistanceToSide()

void ime::ui::MenuBarRenderer::setDistanceToSide ( float  distanceToSide)

Set the distance between the text and the side of the menu item.

Parameters
distanceToSidedistance between the text and the side of the menu item

◆ setFont()

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

Change the menu bars font.

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

Implements ime::ui::IWidgetRenderer.

◆ setInternalPtr()

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

◆ setItemBackgroundTexture()

void ime::ui::MenuBarRenderer::setItemBackgroundTexture ( const std::string &  filename)

Set the background image of a menu item when it is not selected.

Parameters
filenameFilename of the image to set

◆ setOpacity()

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

Set the opacity of the menu bar.

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

◆ setOpacityDisabled()

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

Set the opacity of the menu bar 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 menu bar is disabled.

Implements ime::ui::IWidgetRenderer.

◆ setSelectedBackgroundColour()

void ime::ui::MenuBarRenderer::setSelectedBackgroundColour ( Colour  backgroundColour)

Set the background colour of a menu item when it is selected.

Parameters
backgroundColourThe background colour to set

◆ setSelectedItemBackgroundTexture()

void ime::ui::MenuBarRenderer::setSelectedItemBackgroundTexture ( const std::string &  filename)

Set the background image of a menu item when it is selected.

Parameters
filenameFilename of the image to set

◆ setSelectedTextColour()

void ime::ui::MenuBarRenderer::setSelectedTextColour ( Colour  textColour)

Set the text colour of a menu item when it is selected.

Parameters
textColourThe selected text colour to set

◆ setTextColour()

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

Set the colour of the text.

Parameters
textColourThe new text colour

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