xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
busy_box.h
Go to the documentation of this file.
1 #pragma once
5 #include "busy_dialog.h"
6 #include <xtd/literals.h>
7 #include <xtd/static.h>
8 
10 namespace xtd {
12  namespace forms {
22  class forms_export_ busy_box final static_ {
23  public:
25 
28  static void hide() {
29  delete dialog_;
30  dialog_ = nullptr;
31  }
32 
35  static void show(const iwin32_window& owner) {show_busy_dialog(&owner);}
39  static void show(const iwin32_window& owner, const xtd::ustring& text) {show_busy_dialog(&owner, text);}
44  static void show(const iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption) {show_busy_dialog(&owner, text, caption);}
50  static void show(const iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon) {show_busy_dialog(&owner, text, caption, icon);}
57  static void show(const iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon, const xtd::drawing::color& back_color) {show_busy_dialog(&owner, text, caption, icon, back_color);}
65  static void show(const iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon, const xtd::drawing::color& back_color, const xtd::drawing::color& fore_color) {show_busy_dialog(&owner, text, caption, icon, back_color, fore_color);}
74  static void show(const iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon, const xtd::drawing::color& back_color, const xtd::drawing::color& fore_color, float opacity) {show_busy_dialog(&owner, text, caption, icon, back_color, fore_color, opacity);}
75 
77  static void show() {show_busy_dialog(nullptr);}
80  static void show(const xtd::ustring& text) {show_busy_dialog(nullptr, text);}
84  static void show(const xtd::ustring& text, const xtd::ustring& caption) {show_busy_dialog(nullptr, text, caption);}
89  static void show(const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon) {show_busy_dialog(nullptr, text, caption, icon);}
95  static void show(const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon, const xtd::drawing::color& back_color) {show_busy_dialog(nullptr, text, caption, icon, back_color);}
102  static void show(const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon, const xtd::drawing::color& back_color, const xtd::drawing::color& fore_color) {show_busy_dialog(nullptr, text, caption, icon, back_color, fore_color);}
110  static void show(const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon, const xtd::drawing::color& back_color, const xtd::drawing::color& fore_color, float opacity) {show_busy_dialog(nullptr, text, caption, icon, back_color, fore_color, opacity);}
112 
113  private:
114  static busy_dialog* dialog_;
115  static void show_busy_dialog(const iwin32_window* owner, const xtd::ustring& text = "Please wait..."_t, const xtd::ustring& caption = "", const xtd::drawing::icon& icon = xtd::drawing::icon::empty, const xtd::drawing::color& back_color = xtd::forms::theme_colors::current_theme().control(), const xtd::drawing::color& fore_color = xtd::forms::theme_colors::current_theme().control_text(), float opacity = 0.0) {
116  if (dialog_) return;
117  dialog_ = new busy_dialog();
118  dialog_->description(text);
119  dialog_->text(caption);
120  dialog_->icon(icon);
121  dialog_->back_color(back_color);
122  dialog_->fore_color(fore_color);
123  dialog_->opacity(opacity);
124  owner ? dialog_->show(*owner) : dialog_->show();
125  }
126  };
127  }
128 }
Contains xtd::static_object class.
static void show(const iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:50
static void show(const iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon, const xtd::drawing::color &back_color, const xtd::drawing::color &fore_color, float opacity)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:74
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:38
Represents a dialog box that displays busy dialog.
Definition: busy_dialog.h:28
The system-defined color of text in a 3-D element.
static void show(const iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon, const xtd::drawing::color &back_color)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:57
void show()
Runs busy dialog box.
static void hide()
Hides a busy box in front.
Definition: busy_box.h:28
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd literals.
Contains xtd::forms::busy_dialog dialog.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
static void show(const xtd::ustring &text, const xtd::ustring &caption)
Displays a busy box. The busy box displays a message, title bar caption, button, and icon...
Definition: busy_box.h:84
double opacity() const
Gets the dialog opacity.
Definition: busy_dialog.h:115
static void show(const iwin32_window &owner)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:35
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:19
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:39
The CTRL modifier key.
static void show(const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon, const xtd::drawing::color &back_color, const xtd::drawing::color &fore_color)
Displays a busy box. The busy box displays a message, title bar caption, button, and icon...
Definition: busy_box.h:102
static void show(const xtd::ustring &text)
Displays a busy box. The busy box displays a message, title bar caption, button, and icon...
Definition: busy_box.h:80
static void show()
Displays a busy box.
Definition: busy_box.h:77
xtd::drawing::color fore_color() const
Gets the foreground color for the dialog.
Definition: busy_dialog.h:78
static void show(const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon, const xtd::drawing::color &back_color, const xtd::drawing::color &fore_color, float opacity)
Displays a busy box. The busy box displays a message, title bar caption, button, and icon...
Definition: busy_box.h:110
xtd::drawing::icon icon() const
Gets the product icon.
Definition: busy_dialog.h:89
xtd::drawing::color back_color() const
Gets the background color for the dialog.
Definition: busy_dialog.h:45
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static void show(const iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon, const xtd::drawing::color &back_color, const xtd::drawing::color &fore_color)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:65
static void show(const iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:44
Represents a dialog box that displays busy box.
Definition: busy_box.h:22
static void show(const iwin32_window &owner, const xtd::ustring &text)
Displays a busy box in front of the specified window. The busy box displays a message, title bar caption, button, and icon.
Definition: busy_box.h:39
static void show(const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon)
Displays a busy box. The busy box displays a message, title bar caption, button, and icon...
Definition: busy_box.h:89
const xtd::ustring & description() const
Gets the product description.
Definition: busy_dialog.h:67
const xtd::ustring & text() const
Gets the dialog title.
Definition: busy_dialog.h:128
Represents a Windows icon, which is a small bitmap image that is used to represent an object...
Definition: icon.h:22
static void show(const xtd::ustring &text, const xtd::ustring &caption, const xtd::drawing::icon &icon, const xtd::drawing::color &back_color)
Displays a busy box. The busy box displays a message, title bar caption, button, and icon...
Definition: busy_box.h:95