xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::progress_dialog Class Referencefinal
Inheritance diagram for xtd::forms::progress_dialog:
xtd::forms::component xtd::object

Definition

Represents a common dialog box that displays progress dialog.

Header
#include <xtd/forms/progress_dialog>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light
Dark
Examples
The following code example demonstrates the use of progress_dialog dialog.
#include <xtd/xtd>
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 += delegate_ {
auto dialog = progress_dialog {};
dialog.text("Process running");
dialog.show_skip_button(true);
dialog.show_remaining_time(true);
dialog.show_dialog(*this);
for (auto step = 1; step <= dialog.maximum(); ++step) {
dialog.value(step);
dialog.message(string::format("Step {}/{} ==> {}", dialog.value(), dialog.maximum(), dialog.skipped() ? "skipped" : "done"));
thread::sleep(100_ms);
}
};
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 += delegate_ {
auto dialog = progress_dialog {};
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_dialog(*this);
while (!dialog.cancelled()) {
thread::sleep(100_ms);
}
};
}
private:
button button_process;
button button_indeterminate_process;
};
auto main() -> int {
application::run(form1 {});
}
static auto do_events() -> void
Processes all Windows messages currently in the message queue.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a common dialog box that displays progress dialog.
Definition progress_dialog.hpp:32
auto text() const noexcept -> const xtd::string &
Gets the dialog title.
static auto format(const basic_string< char > &fmt, args_t &&... args) -> basic_string
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:1018
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25

Public Constructors

 progress_dialog ()
 Initializes a new instance of the progress_dialog class.

Public Properties

auto cancelled () const -> bool
 Gets whether user has clicked on cancel button.
auto dialog_appearance () const noexcept -> xtd::forms::dialog_appearance
 Gets the dialog appearance.
auto dialog_appearance (xtd::forms::dialog_appearance value) -> progress_dialog &
 Sets the dialog appearance.
auto informations () const noexcept -> const xtd::array< xtd::string > &
 Gets the information texts.
auto informations (const xtd::array< xtd::string > &value) -> progress_dialog &
 Sets the information texts.
auto marquee () const noexcept -> bool
 Gets a value that Indicates progress by continuously scrolling a block across a progress_bar in a marquee fashion.
auto marquee (bool value) -> progress_dialog &
 Gets a value that Indicates progress by continuously scrolling a block across a progress_bar in a marquee fashion.
auto marquee_animation_speed () const noexcept -> xtd::usize
 Gets he time period, in milliseconds, that it takes the progress block to scroll across the progress bar.
auto marquee_animation_speed (xtd::usize value) -> progress_dialog &
 Sets the time period, in milliseconds, that it takes the progress block to scroll across the progress bar.
auto maximum () const noexcept -> xtd::int32
 Gets the maximum value of the range of the control.
auto maximum (xtd::int32 value) -> progress_dialog &
 Sets the maximum value of the range of the control.
auto message () const noexcept -> const xtd::string &
 Gets the message text.
auto message (const xtd::string &value) -> progress_dialog &
 Sets the message text.
auto minimum () const noexcept -> xtd::int32
 Gets the minimum value of the range of the control.
auto minimum (xtd::int32 value) -> progress_dialog &
 Sets the minimum value of the range of the control.
auto show_cancel_button () const noexcept -> bool
 Gets a value that indicates whether cancel button is shown.
auto show_cancel_button (bool value) -> progress_dialog &
 Sets a value that indicates whether cancel button is shown.
auto show_elapsed_time () const noexcept -> bool
 Gets a value that indicates whether elapsed time is shown.
auto show_elapsed_time (bool value) -> progress_dialog &
 Sets a value that indicates whether elapsed time is shown.
auto show_estimated_time () const noexcept -> bool
 Gets a value that indicates whether estimated time is shown.
auto show_estimated_time (bool value) -> progress_dialog &
 Sets a value that indicates whether estimated time is shown.
auto show_remaining_time () const noexcept -> bool
 Gets a value that indicates whether remaining time is shown.
auto show_remaining_time (bool value) -> progress_dialog &
 Sets a value that indicates whether remaining time is shown.
auto show_skip_button () const noexcept -> bool
 Gets a value that indicates whether skip button is shown.
auto show_skip_button (bool value) -> progress_dialog &
 Sets a value that indicates whether skip button is shown.
auto skipped () const -> bool
 Gets whether user has clicked on skip button.
auto step () const noexcept -> xtd::int32
 Gets the amount by which a call to the PerformStep() method increases the current position of the progress bar.
auto step (xtd::int32 value) -> progress_dialog &
 Sets the amount by which a call to the PerformStep() method increases the current position of the progress bar.
auto text () const noexcept -> const xtd::string &
 Gets the dialog title.
auto text (const xtd::string &value) -> progress_dialog &
 Sets the dialog title.
auto value () const noexcept -> xtd::int32
 Gets the current position of the progress bar.
auto value (xtd::int32 value) -> progress_dialog &
 Sets the current position of the progress bar.

Public Methods

auto hide () -> void
 Hides progress dialog box.
auto increment (xtd::int32 increment) -> void
 Advances the current position of the progress bar by the specified amount.
auto perform_step () -> void
 Advances the current position of the progress bar by the amount of the Step property.
auto reset () noexcept -> void
 Resets all properties to empty string.
auto resume () -> void
 Resume progress dialog box after Abort button clicked.
auto show () -> void
 Runs progress dialog box.
auto show (const xtd::forms::iwin32_window &owner) -> void
 Runs progress dialog box with specified owner.
auto show_sheet (const xtd::forms::iwin32_window &owner) -> void
 Runs progress dialog box as sheet with specified owner.
auto show_dialog () -> void
 Runs progress dialog box.
auto show_dialog (const xtd::forms::iwin32_window &owner) -> void
 Runs progress dialog box with specified owner.
auto show_sheet_dialog (const xtd::forms::iwin32_window &owner) -> void
 Runs progress dialog box with specified owner.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.
 component ()
 Initialises a new instance of the component class.
virtual auto can_raise_events () const noexcept -> bool
 Gets a value indicating whether the component can raise an event.
auto design_mode () const noexcept -> bool
 Gets a value that indicates whether the component is currently in design mode.

Constructor & Destructor Documentation

◆ progress_dialog()

xtd::forms::progress_dialog::progress_dialog ( )

Initializes a new instance of the progress_dialog class.

Member Function Documentation

◆ cancelled()

auto xtd::forms::progress_dialog::cancelled ( ) const -> bool
nodiscard

Gets whether user has clicked on cancel button.

Returns
true if user has clicked on cancel button; otherwise false.

◆ dialog_appearance() [1/2]

auto xtd::forms::progress_dialog::dialog_appearance ( ) const -> xtd::forms::dialog_appearance
nodiscardnoexcept

Gets the dialog appearance.

Returns
One of the xtd::forms::dialog_appearance values. The default value is xtd::forms::dialog_appearance::standard.

◆ dialog_appearance() [2/2]

auto xtd::forms::progress_dialog::dialog_appearance ( xtd::forms::dialog_appearance value) -> progress_dialog &

Sets the dialog appearance.

Parameters
valueOne of the xtd::forms::dialog_appearance values. The default value is xtd::forms::dialog_appearance::standard.
Returns
Current progress dialog.

◆ informations() [1/2]

auto xtd::forms::progress_dialog::informations ( ) const -> const xtd::array< xtd::string > &
nodiscardnoexcept

Gets the information texts.

Returns
The information texts.

◆ informations() [2/2]

auto xtd::forms::progress_dialog::informations ( const xtd::array< xtd::string > & value) -> progress_dialog &

Sets the information texts.

Parameters
valueThe information texts.
Returns
Current progress_dialog instance.

◆ marquee() [1/2]

auto xtd::forms::progress_dialog::marquee ( ) const -> bool
nodiscardnoexcept

Gets a value that Indicates progress by continuously scrolling a block across a progress_bar in a marquee fashion.

Returns
tree is marquee; otherwise false. The default is false.

◆ marquee() [2/2]

auto xtd::forms::progress_dialog::marquee ( bool value) -> progress_dialog &

Gets a value that Indicates progress by continuously scrolling a block across a progress_bar in a marquee fashion.

Parameters
valuetree is marquee; otherwise false. The default is false.
Returns
Current progress_dialog instance.

◆ marquee_animation_speed() [1/2]

auto xtd::forms::progress_dialog::marquee_animation_speed ( ) const -> xtd::usize
nodiscardnoexcept

Gets he time period, in milliseconds, that it takes the progress block to scroll across the progress bar.

Returns
The time period, in milliseconds, that it takes the progress block to scroll across the progress bar.
Remarks
A marquee-style progress indicator does not display progress; instead it indicates that an operation is occurring by moving the progress block across the progress bar.
Since the marquee animation speed is a time period, setting the value to a higher number results in a slower speed and a lower number results in a faster speed.

◆ marquee_animation_speed() [2/2]

auto xtd::forms::progress_dialog::marquee_animation_speed ( xtd::usize value) -> progress_dialog &

Sets the time period, in milliseconds, that it takes the progress block to scroll across the progress bar.

Parameters
valueThe time period, in milliseconds, that it takes the progress block to scroll across the progress bar.
Remarks
A marquee-style progress indicator does not display progress; instead it indicates that an operation is occurring by moving the progress block across the progress bar.
Since the marquee animation speed is a time period, setting the value to a higher number results in a slower speed and a lower number results in a faster speed.

◆ maximum() [1/2]

auto xtd::forms::progress_dialog::maximum ( ) const -> xtd::int32
nodiscardnoexcept

Gets the maximum value of the range of the control.

Returns
The maximum value of the range. The default is 100.
Remarks
This property specifies the upper limit of the value property. When the value of the maximum property is changed, the progress_bar control is redrawn to reflect the new range of the control. When the value of the value property is equal to the value of the maximum property, the progress bar is completely filled.
You can use this property to specify a value to which the value property must be set (by setting the value property or using the increment or perform_step methods) to indicate that an operation is complete. For example, you can set the value of the maximum property to the total number of files in a file copy operation. Each time a file is copied, the value property can be increased by 1 until the total number of files is copied. At that point, the progress bar would be completely filled.

◆ maximum() [2/2]

auto xtd::forms::progress_dialog::maximum ( xtd::int32 value) -> progress_dialog &

Sets the maximum value of the range of the control.

Parameters
valueThe maximum value of the range. The default is 100.
Remarks
This property specifies the upper limit of the value property. When the value of the maximum property is changed, the progress_bar control is redrawn to reflect the new range of the control. When the value of the value property is equal to the value of the maximum property, the progress bar is completely filled.
You can use this property to specify a value to which the value property must be set (by setting the value property or using the increment or perform_step methods) to indicate that an operation is complete. For example, you can set the value of the maximum property to the total number of files in a file copy operation. Each time a file is copied, the value property can be increased by 1 until the total number of files is copied. At that point, the progress bar would be completely filled.

◆ message() [1/2]

auto xtd::forms::progress_dialog::message ( ) const -> const xtd::string &
nodiscardnoexcept

Gets the message text.

Returns
The message text.

◆ message() [2/2]

auto xtd::forms::progress_dialog::message ( const xtd::string & value) -> progress_dialog &

Sets the message text.

Parameters
valueThe message text.
Returns
Current progress_dialog instance.

◆ minimum() [1/2]

auto xtd::forms::progress_dialog::minimum ( ) const -> xtd::int32
nodiscardnoexcept

Gets the minimum value of the range of the control.

Returns
The minimum value of the range. The default is 0.
Remarks
This property specifies the lower limit of the value property. When the value of the minimum property is changed, the progress_bar control is redrawn to reflect the new range of the control. When the value of the value property is equal to the value of the minimum property, the progress bar is empty. To change the value of the progress bar, use the step property with the perform_step method, use the increment method, or set the value of the value property directly.

◆ minimum() [2/2]

auto xtd::forms::progress_dialog::minimum ( xtd::int32 value) -> progress_dialog &

Sets the minimum value of the range of the control.

Parameters
valueThe minimum value of the range. The default is 0.
Returns
Current progress_dialog instance.
Remarks
This property specifies the lower limit of the value property. When the value of the minimum property is changed, the progress_bar control is redrawn to reflect the new range of the control. When the value of the value property is equal to the value of the minimum property, the progress bar is empty. To change the value of the progress bar, use the step property with the perform_step method, use the increment method, or set the value of the value property directly.

◆ show_cancel_button() [1/2]

auto xtd::forms::progress_dialog::show_cancel_button ( ) const -> bool
nodiscardnoexcept

Gets a value that indicates whether cancel button is shown.

Returns
true if cancel button shown; otherwise false. By default false.

◆ show_cancel_button() [2/2]

auto xtd::forms::progress_dialog::show_cancel_button ( bool value) -> progress_dialog &

Sets a value that indicates whether cancel button is shown.

Parameters
valuetrue if cancel button is shown; otherwise false. By default false.
Returns
Current progress_dialog instance.

◆ show_elapsed_time() [1/2]

auto xtd::forms::progress_dialog::show_elapsed_time ( ) const -> bool
nodiscardnoexcept

Gets a value that indicates whether elapsed time is shown.

Returns
true if elapsed time is shown; otherwise false. By default false.

◆ show_elapsed_time() [2/2]

auto xtd::forms::progress_dialog::show_elapsed_time ( bool value) -> progress_dialog &

Sets a value that indicates whether elapsed time is shown.

Parameters
valuetrue if elapsed time is shown; otherwise false. By default false.
Returns
Current progress_dialog instance.

◆ show_estimated_time() [1/2]

auto xtd::forms::progress_dialog::show_estimated_time ( ) const -> bool
nodiscardnoexcept

Gets a value that indicates whether estimated time is shown.

Returns
true if estimated time is shown; otherwise false. By default false.

◆ show_estimated_time() [2/2]

auto xtd::forms::progress_dialog::show_estimated_time ( bool value) -> progress_dialog &

Sets a value that indicates whether estimated time is shown.

Parameters
valuetrue if estimated time is shown; otherwise false. By default false.
Returns
Current progress_dialog instance.

◆ show_remaining_time() [1/2]

auto xtd::forms::progress_dialog::show_remaining_time ( ) const -> bool
nodiscardnoexcept

Gets a value that indicates whether remaining time is shown.

Returns
true if remaining time is shown; otherwise false. By default false.

◆ show_remaining_time() [2/2]

auto xtd::forms::progress_dialog::show_remaining_time ( bool value) -> progress_dialog &

Sets a value that indicates whether remaining time is shown.

Parameters
valuetrue if remaining time is shown; otherwise false. By default false.
Returns
Current progress_dialog instance.

◆ show_skip_button() [1/2]

auto xtd::forms::progress_dialog::show_skip_button ( ) const -> bool
nodiscardnoexcept

Gets a value that indicates whether skip button is shown.

Returns
true if skip button shown; otherwise false. By default false.

◆ show_skip_button() [2/2]

auto xtd::forms::progress_dialog::show_skip_button ( bool value) -> progress_dialog &

Sets a value that indicates whether skip button is shown.

Parameters
valuetrue if skip button is shown; otherwise false. By default false.
Returns
Current progress_dialog instance.

◆ skipped()

auto xtd::forms::progress_dialog::skipped ( ) const -> bool
nodiscard

Gets whether user has clicked on skip button.

Returns
true if user has clicked on skip button; otherwise false.

◆ step() [1/2]

auto xtd::forms::progress_dialog::step ( ) const -> xtd::int32
nodiscardnoexcept

Gets the amount by which a call to the PerformStep() method increases the current position of the progress bar.

Returns
The amount by which to increment the progress bar with each call to the perform_step() method. The default is 10.
Remarks
You can use the step property to specify the amount that each completed task in an operation changes the value of the progress bar. For example, if you are copying a group of files, you might want to set the value of the step property to 1 and the value of the maximum property to the total number of files to copy. When each file is copied, you can call the perform_step method to increment the progress bar by the value of the step property. If you want to have more flexible control of the value of the progress bar, you can use the increment method or set the value of the value property directly.

◆ step() [2/2]

auto xtd::forms::progress_dialog::step ( xtd::int32 value) -> progress_dialog &

Sets the amount by which a call to the PerformStep() method increases the current position of the progress bar.

Parameters
valueThe amount by which to increment the progress bar with each call to the perform_step() method. The default is 10.
Remarks
You can use the step property to specify the amount that each completed task in an operation changes the value of the progress bar. For example, if you are copying a group of files, you might want to set the value of the step property to 1 and the value of the maximum property to the total number of files to copy. When each file is copied, you can call the perform_step method to increment the progress bar by the value of the step property. If you want to have more flexible control of the value of the progress bar, you can use the increment method or set the value of the value property directly.

◆ text() [1/2]

auto xtd::forms::progress_dialog::text ( ) const -> const xtd::string &
nodiscardnoexcept

Gets the dialog title.

Returns
The dialog title.

◆ text() [2/2]

auto xtd::forms::progress_dialog::text ( const xtd::string & value) -> progress_dialog &

Sets the dialog title.

Parameters
valueThe dialog title.
Returns
Current progress_dialog instance.

◆ value() [1/2]

auto xtd::forms::progress_dialog::value ( ) const -> xtd::int32
nodiscardnoexcept

Gets the current position of the progress bar.

Returns
The position within the range of the progress bar. The default is 0.
Remarks
If the value specified is greater than the value of the maximum property, the value property is set to maximum.
If the value specified is less than the value of the minimum property, the value property is set to minimum.
The minimum and maximum values of the value property are specified by the minimum and maximum properties. This property enables you to increment or decrement the value of the progress bar directly. To perform consistent increases in the value of the progress_bar control you can use the step property with the perform_step method. To increase the progress bar value by varying amounts, use the increment method.

◆ value() [2/2]

auto xtd::forms::progress_dialog::value ( xtd::int32 value) -> progress_dialog &

Sets the current position of the progress bar.

Parameters
valueThe position within the range of the progress bar. The default is 0.
Remarks
If the value specified is greater than the value of the maximum property, the value property is set to maximum.
If the value specified is less than the value of the minimum property, the value property is set to minimum.
The minimum and maximum values of the value property are specified by the minimum and maximum properties. This property enables you to increment or decrement the value of the progress bar directly. To perform consistent increases in the value of the progress_bar control you can use the step property with the perform_step method. To increase the progress bar value by varying amounts, use the increment method.

◆ hide()

auto xtd::forms::progress_dialog::hide ( ) -> void

Hides progress dialog box.

◆ increment()

auto xtd::forms::progress_dialog::increment ( xtd::int32 increment) -> void

Advances the current position of the progress bar by the specified amount.

Parameters
incrementThe amount by which to increment the progress bar's current position.
Remarks
The increment method enables you to increment the value of the progress bar by a specific amount. This method of incrementing the progress bar is similar to using the step property with the perform_step method. The value property specifies the current position of the progress_bar. If, after calling the increment method, the value property is greater than the value of the maximum property, the value property remains at the value of the maximum property. If, after calling the increment method with a negative value specified in the value parameter, the Value property is less than the value of the minimum property, the value property remains at the value of the minimum property.
Because a progress_bar object whose style is set to marquee displays a continuously scrolling bar instead of its value, calling increment is unnecessary and will do nothing.

◆ perform_step()

auto xtd::forms::progress_dialog::perform_step ( ) -> void

Advances the current position of the progress bar by the amount of the Step property.

Remarks
The perform_step method increments the value of the progress bar by the amount specified by the step property. You can use the Step property to specify the amount that each completed task in an operation changes the value of the progress bar. For example, if you are copying a group of files, you might want to set the value of the step property to 1 and the value of the maximum property to the total number of files to copy. When each file is copied, you can call the perform_step method to increment the progress bar by the value of the step property. If you want to have more flexible control of the value of the progress bar, you can use the increment method or set the value of the value property directly.

◆ reset()

auto xtd::forms::progress_dialog::reset ( ) -> void
noexcept

Resets all properties to empty string.

◆ resume()

auto xtd::forms::progress_dialog::resume ( ) -> void

Resume progress dialog box after Abort button clicked.

◆ show() [1/2]

auto xtd::forms::progress_dialog::show ( ) -> void

Runs progress dialog box.

◆ show() [2/2]

auto xtd::forms::progress_dialog::show ( const xtd::forms::iwin32_window & owner) -> void

Runs progress dialog box with specified owner.

Parameters
ownerThe progress dialog owner.

◆ show_sheet()

auto xtd::forms::progress_dialog::show_sheet ( const xtd::forms::iwin32_window & owner) -> void

Runs progress dialog box as sheet with specified owner.

Parameters
ownerThe progress dialog owner.

◆ show_dialog() [1/2]

auto xtd::forms::progress_dialog::show_dialog ( ) -> void

Runs progress dialog box.

◆ show_dialog() [2/2]

auto xtd::forms::progress_dialog::show_dialog ( const xtd::forms::iwin32_window & owner) -> void

Runs progress dialog box with specified owner.

Parameters
ownerThe progress dialog owner.

◆ show_sheet_dialog()

auto xtd::forms::progress_dialog::show_sheet_dialog ( const xtd::forms::iwin32_window & owner) -> void

Runs progress dialog box with specified owner.

Parameters
ownerThe progress dialog owner.

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