ezEngine  Release 25.03
ezProgress Class Reference

Manages the way a progress bar is subdivided and advanced. More...

#include <Progress.h>

Public Member Functions

float GetCompletion () const
 Returns the current overall progress in [0; 1] range.
 
void SetCompletion (float fCompletion)
 Sets the current overall progress in [0; 1] range. Should not be called directly, typically called by ezProgreesRange.
 
ezStringView GetMainDisplayText () const
 Returns the current 'headline' text for the progress bar.
 
ezStringView GetStepDisplayText () const
 Returns the current detail text for the progress bar.
 
void UserClickedCancel ()
 Used to inform ezProgress of outside user input. May have an effect or not.
 
bool WasCanceled () const
 Whether the user requested to cancel the operation.
 
bool AllowUserCancel () const
 Returns whether the current operations may be canceled or not.
 

Static Public Member Functions

static ezProgressGetGlobalProgressbar ()
 Returns the currently set default ezProgress instance. This will always be valid.
 
static void SetGlobalProgressbar (ezProgress *pProgress)
 Allows to set a custom ezProgress instance as the global default instance.
 

Public Attributes

ezEvent< const ezProgressEvent & > m_Events
 Events are sent when the progress changes.
 
void * m_pUserData = nullptr
 Custom user data.
 

Friends

class ezProgressRange
 

Detailed Description

Manages the way a progress bar is subdivided and advanced.

ezProgress represents a single progress bar. It can be sub-divided into groups and sub-groups using ezProgressbarRange. From the ranges and the current advancement, a final progress percentage is computed. Every time a significant change takes place, an event is broadcast. This allows other code to display the progress, either in a GUI application or in a fullscreen loading screen or in any other way appropriate.


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