demonstrates the use of xtd::forms::progress_box progress dialog.
- Windows
-
- macOS
-
- Gnome
-
#include <xtd/xtd>
class form1 : public form {
public:
form1() {
text("Progress box example");
client_size({ 400, 200 });
download_button.parent(*this)
.text("Download")
.location({ 10, 10 })
.size({ 150, 35 })
progress_box::show(*this, "Downloading", "Please wait...", 0, 0, 100, progress_box_options::show_cancel_button | progress_box_options::show_skip_button);
for (auto index = progress_box::minimum(); index <= progress_box::maximum(); ++index) {
threading::thread::sleep(100_ms);
progress_box::update(index, "Downloading", xtd::string::format("{}/{}", index, progress_box::maximum()));
if (progress_box::skipped()) index++;
if (progress_box::cancelled()) break;
}
progress_box::hide();
};
}
private:
button download_button;
};
auto main() -> int {
application::run(form1 {});
}
#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:900