26#ifndef TGUI_PROGRESS_BAR_HPP 
   27#define TGUI_PROGRESS_BAR_HPP 
   30#include <TGUI/Renderers/ProgressBarRenderer.hpp> 
   31#include <TGUI/Widgets/ClickableWidget.hpp> 
   32#include <TGUI/Text.hpp> 
   45        typedef std::shared_ptr<ProgressBar> 
Ptr; 
 
   46        typedef std::shared_ptr<const ProgressBar> 
ConstPtr; 
 
  262        void draw(sf::RenderTarget& target, sf::RenderStates states) 
const override;
 
  292        std::unique_ptr<DataIO::Node> 
save(SavingRenderersMap& renderers) 
const override;
 
  298        void load(
const std::unique_ptr<DataIO::Node>& node, 
const LoadingRenderersMap& renderers) 
override;
 
  311        void recalculateFillSize();
 
  325            return std::make_shared<ProgressBar>(*
this);
 
  332        SignalUInt onValueChange = {
"ValueChanged"}; 
 
  339        unsigned int m_minimum = 0;
 
  340        unsigned int m_maximum = 100;
 
  341        unsigned int m_value = 0;
 
  349        FillDirection m_fillDirection = FillDirection::LeftToRight;
 
  351        Sprite m_spriteBackground;
 
  356        Color   m_borderColorCached;
 
  357        Color   m_backgroundColorCached;
 
  358        Color   m_fillColorCached;
 
Wrapper for colors.
Definition: Color.hpp:49
 
Definition: FloatRect.hpp:37
 
Class to store the position or size of a widget.
Definition: Layout.hpp:260
 
Definition: Outline.hpp:39
 
Definition: ProgressBarRenderer.hpp:37
 
Progress bar widget.
Definition: ProgressBar.hpp:42
 
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Definition: ProgressBar.hpp:323
 
FillDirection getFillDirection() const
Returns the fill direction of the progress bar.
 
unsigned int getValue() const
Returns the current value.
 
void setFillDirection(FillDirection direction)
Changes the fill direction of the progress bar.
 
bool mouseOnWidget(Vector2f pos) const override
Returns whether the mouse position (which is relative to the parent widget) lies on top of the widget...
 
Signal & getSignal(std::string signalName) override
Retrieves a signal based on its name.
 
void setMaximum(unsigned int maximum)
Sets a maximum value.
 
static ProgressBar::Ptr copy(ProgressBar::ConstPtr progressBar)
Makes a copy of another progress bar.
 
const sf::String & getText() const
Returns the caption of the progress bar.
 
std::shared_ptr< const ProgressBar > ConstPtr
Shared constant widget pointer.
Definition: ProgressBar.hpp:46
 
void rendererChanged(const std::string &property) override
Function called when one of the properties of the renderer is changed.
 
ProgressBarRenderer * getRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
 
std::shared_ptr< ProgressBar > Ptr
Shared widget pointer.
Definition: ProgressBar.hpp:45
 
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
Draw the widget to a render target.
 
void setValue(unsigned int value)
Changes the current value.
 
unsigned int incrementValue()
Increments the value.
 
void setMinimum(unsigned int minimum)
Sets a minimum value.
 
void setSize(const Layout2d &size) override
Changes the size of the progress bar.
 
static ProgressBar::Ptr create()
Creates a new progress bar widget.
 
FillDirection
The fill direction of the progress bar.
Definition: ProgressBar.hpp:56
 
void setText(const sf::String &text)
Changes the caption of the progress bar.
 
unsigned int getMinimum() const
Returns the minimum value.
 
unsigned int getMaximum() const
Returns the maximum value.
 
unsigned int getTextSize() const override
Returns the character size of the text.
 
ProgressBarRenderer * getSharedRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
 
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
 
std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
 
void setTextSize(unsigned int size) override
Changes the character size of the text.
 
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:231
 
Definition: Sprite.hpp:46
 
Definition: Vector2f.hpp:39
 
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37