ProgressBar class reference
Interactive widget, based on CustomWidget. Displays the progress bar.
Functions
Functions documentation
ProgressBar(Window* window,Widget2DPropsprops,ProgressBarThemetheme, std::wstring defText, float maxValue);
Default constructor (to refactor).
ProgressBar(Window* window,Widget2DPropsprops,Themetheme, std::wstring defText, float maxValue);
Delegating constructor with theme application.
ProgressBar(constProgressBar& copy);
Copy constructor.
ProgressBar& operator=(ProgressBarrhs);
Assignment operator.
friend void swap(ProgressBar& first,ProgressBar& second) noexcept;
Swap function.
ProgressBar* Clone() const override;
Clone funciton.
void SetToObserve(float* toObserve);Sets the variable that is listened to and upon which the progress bar is updated.
void SetValue(float newValue);Sets a new value for the observed variable.
void Update();Updates the widget.
void SetCallback(Callback cbFunc);Sets a callback that is executed every time an event is processed (inside ProgressBar object).
void ResetCallback();Resets the callback to nullptr.
void ChangeFillColor(ColornewColor);
Changes the fill color of the progress bar.
void EnableWidget() override;Override adds an additional binding - to OnTick event.
bool OnWindowTick(Event* ev);
Handles 'AutoUpdate' flag (calls Update() every tick).
Variables documentation
Callback m_Callback;Stores handle to callback function.
std::wstring m_wsBaseText;Defines the text displayed on the progress bar.
float* m_fObservedValue;Pointer on the observed variable.
float m_fMaxValue;A variable that specifies the upper limit of the observed variable.