xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
busy_dialog.cpp

The following code example demonstrate the use of busy_dialog dialog.

Windows

macOS

Gnome

#include <thread>
#include <xtd/xtd>
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Busy dialog example");
button1.auto_size(true);
button1.location({10, 10});
button1.parent(*this);
button1.text("Do something...");
button1.click += [&] {
busy_dialog dialog;
dialog.icon(xtd::drawing::system_icons::exclamation({64, 64}));
dialog.text("Application busy");
dialog.description("Please wait while do something...");
dialog.opacity(0.25);
dialog.show(*this);
for (auto count = 0; count < 500; ++count) {
application::do_events();
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
};
}
private:
button button1;
};
int main() {
}
static const xtd::drawing::color white
Gets a system-defined color that has an ARGB value of 0xFFFFFFFF. This field is constant.
Definition: color.h:459
static const xtd::drawing::color red
Gets a system-defined color that has an ARGB value of 0xFFFF0000. This field is constant.
Definition: color.h:390
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a dialog box that displays busy dialog.
Definition: busy_dialog.h:28
xtd::drawing::icon icon() const
Gets the product icon.
Definition: busy_dialog.h:93
const xtd::ustring & description() const
Gets the product description.
Definition: busy_dialog.h:82
double opacity() const
Gets the dialog opacity.
Definition: busy_dialog.h:119
void show()
Runs busy dialog box.
xtd::drawing::color fore_color() const
Gets the foreground color for the dialog.
Definition: busy_dialog.h:60
xtd::drawing::color back_color() const
Gets the background color for the dialog.
Definition: busy_dialog.h:38
const xtd::ustring & text() const
Gets the dialog title.
Definition: busy_dialog.h:71
Represents a Windows button control.
Definition: button.h:54
Represents a window or dialog box that makes up an application's user interface.
Definition: form.h:40
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13