xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::forms::progress_dialog Class Referencefinal

Represents a common dialog box that displays progress box. More...

#include <progress_dialog.h>

Public Member Functions

 progress_dialog ()=default
 Initializes a new instance of the progress_dialog class. More...
 
bool cancelled () const
 
xtd::forms::dialog_style dialog_style () const
 
progress_dialogdialog_style (xtd::forms::dialog_style dialog_style)
 
void hide ()
 
void increment (int32_t increment)
 Advances the current position of the progress bar by the specified amount. More...
 
const std::vector< std::string > & informations () const
 Gets the information texts. More...
 
progress_dialoginformations (const std::vector< std::string > &informations)
 Sets the information texts. More...
 
bool marquee () const
 
progress_dialogmarquee (bool marquee)
 
size_t marquee_animation_speed ()
 Gets he time period, in milliseconds, that it takes the progress block to scroll across the progress bar. More...
 
progress_dialogmarquee_animation_speed (size_t marquee_animation_speed)
 Sets the time period, in milliseconds, that it takes the progress block to scroll across the progress bar. More...
 
int32_t maximum ()
 Gets the maximum value of the range of the control. More...
 
progress_dialogmaximum (int32_t maximum)
 Sets the maximum value of the range of the control. More...
 
const std::string & message () const
 Gets the message text. More...
 
progress_dialogmessage (const std::string &message)
 Sets the message text. More...
 
int32_t minimum ()
 Gets the minimum value of the range of the control. More...
 
progress_dialogminimum (int32_t minimum)
 Sets the minimum value of the range of the control. More...
 
void perform_step ()
 Advances the current position of the progress bar by the amount of the Step property. More...
 
void reset ()
 Resets all properties to empty string. More...
 
void show ()
 Runs busy dialog box. More...
 
void show (const iwin32_window &owner)
 Runs busy dialog box. More...
 
bool show_cancel_button () const
 
progress_dialogshow_cancel_button (bool show_cancel_button)
 
void show_dialog ()
 Runs busy dialog box. More...
 
void show_dialog (const iwin32_window &owner)
 Runs busy dialog box. More...
 
bool show_elapsed_time () const
 
progress_dialogshow_elapsed_time (bool show_elapsed_time)
 
bool show_estimated_time () const
 
progress_dialogshow_estimated_time (bool show_estimated_time)
 
bool show_remaining_time () const
 
progress_dialogshow_remaining_time (bool show_remaining_time)
 
void show_sheet (const iwin32_window &owner)
 Runs busy dialog box. More...
 
void show_sheet_dialog (const iwin32_window &owner)
 Runs busy dialog box. More...
 
bool show_skip_button () const
 
progress_dialogshow_skip_button (bool show_skip_button)
 
bool skipped () const
 
virtual int32_t step ()
 Gets the amount by which a call to the PerformStep() method increases the current position of the progress bar. More...
 
virtual progress_dialogstep (int32_t step)
 Sets the amount by which a call to the PerformStep() method increases the current position of the progress bar. More...
 
const std::string & text () const
 Gets the dialog title. More...
 
progress_dialogtext (const std::string &text)
 Sets the dialog title. More...
 
int32_t value ()
 Gets the current position of the progress bar. More...
 
progress_dialogvalue (int32_t value)
 Sets the current position of the progress bar. More...
 

Detailed Description

Represents a common dialog box that displays progress box.

Example
The following code example demonstrate the use of progress_dialog dialog.
#include <thread>
#include <xtd/xtd>
using namespace std::literals;
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Progress dialog example");
button_process.auto_size(true);
button_process.location({10, 10});
button_process.parent(*this);
button_process.text("Process...");
button_process.click += [this] {
dialog.text("Process running");
dialog.show_skip_button(true);
dialog.show_remaining_time(true);
dialog.show_sheet_dialog(*this);
for (auto step = 1; step <= dialog.maximum(); ++step) {
dialog.value(step);
dialog.message(strings::format("Step {}/{} ==> {}", dialog.value(), dialog.maximum(), dialog.skipped() ? "skipped" : "done"));
std::this_thread::sleep_for(100ms);
}
};
button_indeterminate_process.auto_size(true);
button_indeterminate_process.location({100, 10});
button_indeterminate_process.parent(*this);
button_indeterminate_process.text("Indeterminate process...");
button_indeterminate_process.click += [this] {
dialog.text("Indeterminate process running");
dialog.message("Click \"Cancel\" to abort");
dialog.marquee(true);
dialog.show_cancel_button(true);
dialog.show_elapsed_time(true);
dialog.show_sheet_dialog(*this);
while (!dialog.cancelled()) {
application::yield();
std::this_thread::sleep_for(100ms);
}
};
}
private:
button button_process;
button button_indeterminate_process;
};
int main() {
application::run(form1());
}

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