TGUI  v0.6.10
Public Types | Public Member Functions | List of all members
tgui::LoadingBar Class Reference
Inheritance diagram for tgui::LoadingBar:
tgui::ClickableWidget tgui::Widget tgui::Transformable tgui::CallbackManager

Public Types

- Public Types inherited from tgui::ClickableWidget
- Public Types inherited from tgui::Widget

Public Member Functions

 LoadingBar ()
 Default constructor. More...
 
 LoadingBar (const LoadingBar &copy)
 Copy constructor. More...
 
virtual ~LoadingBar ()
 Destructor. More...
 
LoadingBaroperator= (const LoadingBar &right)
 Overload of assignment operator. More...
 
bool load (const std::string &configFileFilename, const std::string &sectionName="LoadingBar")
 Loads the widget. More...
 
const std::string & getLoadedConfigFile () const
 Returns the filename of the config file that was used to load the widget. More...
 
void setSize (float width, float height)
 Changes the size of the loading bar. More...
 
void setMinimum (unsigned int minimum)
 Sets a minimum value. More...
 
void setMaximum (unsigned int maximum)
 Sets a maximum value. More...
 
void setValue (unsigned int value)
 Changes the current value. More...
 
unsigned int getMinimum () const
 Returns the minimum value. More...
 
unsigned int getMaximum () const
 Returns the maximum value. More...
 
unsigned int getValue () const
 Returns the current value. More...
 
unsigned int incrementValue ()
 Increment the value. More...
 
void setText (const sf::String &text)
 Changes the caption of the loading bar. More...
 
sf::String getText () const
 Returns the caption of the loading bar. More...
 
void setTextFont (const sf::Font &font)
 Changes the font of the text. More...
 
const sf::Font * getTextFont () const
 Returns the font of the text. More...
 
void setTextColor (const sf::Color &color)
 Changes the color of the text. More...
 
const sf::Color & getTextColor () const
 Returns the color of the text. More...
 
void setTextSize (unsigned int size)
 Changes the character size of the text. More...
 
unsigned int getTextSize () const
 Returns the character size of the text. More...
 
virtual void setTransparency (unsigned char transparency)
 Changes the transparency of the widget. More...
 
- Public Member Functions inherited from tgui::ClickableWidget
 ClickableWidget ()
 Default constructor. More...
 
 ClickableWidget (const ClickableWidget &copy)
 Copy constructor. More...
 
virtual ~ClickableWidget ()
 Destructor. More...
 
ClickableWidgetoperator= (const ClickableWidget &right)
 Overload of assignment operator. More...
 
virtual sf::Vector2f getSize () const
 Returns the size of the widget. More...
 
- Public Member Functions inherited from tgui::Widget
 Widget ()
 Default constructor. More...
 
 Widget (const Widget &copy)
 Copy constructor. More...
 
virtual ~Widget ()
 Destructor. More...
 
Widgetoperator= (const Widget &right)
 Overload of assignment operator. More...
 
virtual sf::Vector2f getAbsolutePosition () const
 Get the absolute position of the widget on the screen. More...
 
virtual void show ()
 Shows the widget. More...
 
virtual void hide ()
 Hides the widget. More...
 
bool isVisible () const
 Returns true when the widget is visible. More...
 
virtual void enable ()
 Enables the widget. More...
 
virtual void disable ()
 Disables the widget. More...
 
bool isEnabled () const
 Returns true when the widget is enabled. More...
 
bool isDisabled () const
 Returns true when the widget is disabled. More...
 
bool isLoaded () const
 Returns true when the widget is loaded successfully. More...
 
virtual void focus ()
 Focus the widget. More...
 
virtual void unfocus ()
 Unfocus the widget. More...
 
bool isFocused () const
 Returns true when the widget is focused and false otherwise. More...
 
WidgetTypes getWidgetType () const
 Returns the type of the widget. More...
 
ContainergetParent () const
 Returns a pointer to the parent widget. More...
 
unsigned char getTransparency () const
 Returns the transparency of the widget. More...
 
virtual void moveToFront ()
 Places the widget before all other widgets. More...
 
virtual void moveToBack ()
 Places the widget behind all other widgets. More...
 
void setCallbackId (unsigned int callbackId)
 Changes the callback id of the widget. More...
 
unsigned int getCallbackId ()
 Returns the callback id of the widget. More...
 
- Public Member Functions inherited from tgui::Transformable
 Transformable ()
 Default constructor. More...
 
virtual ~Transformable ()
 Destructor. More...
 
virtual void setPosition (float x, float y)
 Set the position of the widget. More...
 
void setPosition (const sf::Vector2f &position)
 set the position of the widget More...
 
const sf::Vector2f & getPosition () const
 get the position of the widget More...
 
void move (float offsetX, float offsetY)
 Move the widget by a given offset. More...
 
void move (const sf::Vector2f &offset)
 Move the widget by a given offset. More...
 
virtual sf::Vector2f getFullSize () const
 Returns the entire size that the widget is using. More...
 
void scale (float factorX, float factorY)
 Scale the widget. More...
 
void scale (const sf::Vector2f &factors)
 Scale the widget. More...
 
- Public Member Functions inherited from tgui::CallbackManager
void bindCallback (std::function< void()> func, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
template<typename T >
void bindCallback (void(T::*func)(), T *const classPtr, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
void bindCallbackEx (std::function< void(const Callback &)> func, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
template<typename T >
void bindCallbackEx (void(T::*func)(const Callback &), T *const classPtr, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
void bindCallback (unsigned int trigger)
 Bind one or more specific callback trigger(s) to the parent widget. More...
 
void unbindCallback (unsigned int trigger)
 Unbind all callback function bound to the given trigger. More...
 
void unbindAllCallback ()
 Unbind all callback functions bound to any callback. More...
 

Member Enumeration Documentation

Defines specific triggers to LoadingBar.

Enumerator
ValueChanged 

Value changed.

LoadingBarFull 

Value reached the max value.

AllLoadingBarCallbacks 

All triggers defined in LoadingBar and its base classes.

Constructor & Destructor Documentation

tgui::LoadingBar::LoadingBar ( )

Default constructor.

tgui::LoadingBar::LoadingBar ( const LoadingBar copy)

Copy constructor.

Parameters
copyInstance to copy
virtual tgui::LoadingBar::~LoadingBar ( )
virtual

Destructor.

Member Function Documentation

const std::string& tgui::LoadingBar::getLoadedConfigFile ( ) const

Returns the filename of the config file that was used to load the widget.

Returns
Filename of loaded config file. Empty string when no config file was loaded yet.
unsigned int tgui::LoadingBar::getMaximum ( ) const

Returns the maximum value.

Returns
The current maximum value
unsigned int tgui::LoadingBar::getMinimum ( ) const

Returns the minimum value.

Returns
The current minimum value
sf::String tgui::LoadingBar::getText ( ) const

Returns the caption of the loading bar.

Returns
Text that is drawn on top of the loading bar
const sf::Color& tgui::LoadingBar::getTextColor ( ) const

Returns the color of the text.

Returns
The current text color
const sf::Font* tgui::LoadingBar::getTextFont ( ) const

Returns the font of the text.

Returns
Pointer to the font that is currently being used
unsigned int tgui::LoadingBar::getTextSize ( ) const

Returns the character size of the text.

Returns
The current text size.
unsigned int tgui::LoadingBar::getValue ( ) const

Returns the current value.

Returns
The current value
unsigned int tgui::LoadingBar::incrementValue ( )

Increment the value.

Returns
the new value

The value can never exceed the maximum.

bool tgui::LoadingBar::load ( const std::string &  configFileFilename,
const std::string &  sectionName = "LoadingBar" 
)

Loads the widget.

Parameters
configFileFilenameFilename of the config file.
sectionNameName of the section in the file to load

The config file must contain a LoadingBar section with the needed information.

LoadingBar& tgui::LoadingBar::operator= ( const LoadingBar right)

Overload of assignment operator.

Parameters
rightInstance to assign
Returns
Reference to itself
void tgui::LoadingBar::setMaximum ( unsigned int  maximum)

Sets a maximum value.

Parameters
maximumThe new maximum value

When the value is too big then it will be changed to this maximum.

void tgui::LoadingBar::setMinimum ( unsigned int  minimum)

Sets a minimum value.

Parameters
minimumThe new minimum value

When the value is too small then it will be changed to this minimum.

void tgui::LoadingBar::setSize ( float  width,
float  height 
)
virtual

Changes the size of the loading bar.

Parameters
widthThe new width of the loading bar
heightThe new height of the loading bar

Reimplemented from tgui::ClickableWidget.

void tgui::LoadingBar::setText ( const sf::String &  text)

Changes the caption of the loading bar.

Parameters
textNew text to draw on top of the loading bar

This text will be centered in the loading bar. It could e.g. contain the progress.

void tgui::LoadingBar::setTextColor ( const sf::Color &  color)

Changes the color of the text.

Parameters
colorNew text color
void tgui::LoadingBar::setTextFont ( const sf::Font &  font)

Changes the font of the text.

When you don't call this function then the global font will be use. This global font can be changed with the setGlobalFont function from the parent.

Parameters
fontThe new font
void tgui::LoadingBar::setTextSize ( unsigned int  size)

Changes the character size of the text.

Parameters
sizeThe new text size. If the size is set to 0 then the text will be auto-sized to fit inside the loading bar.
virtual void tgui::LoadingBar::setTransparency ( unsigned char  transparency)
virtual

Changes the transparency of the widget.

Parameters
transparencyThe transparency of the widget. 0 is completely transparent, while 255 (default) means fully opaque.

Note that this will only change the transparency of the images. The parts of the widgets that use a color will not be changed. You must change them yourself by setting the alpha channel of the color.

Reimplemented from tgui::Widget.

void tgui::LoadingBar::setValue ( unsigned int  value)

Changes the current value.

Parameters
valueThe new value

The value can't be smaller than the minimum or bigger than the maximum.


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