xtd - Reference Guide  0.1.1
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 {
23  public:
25  static void hide() {
26  delete dialog_;
27  dialog_ = nullptr;
28  }
29 
32  static void show(const iwin32_window& owner) {show_busy_dialog(&owner);}
36  static void show(const iwin32_window& owner, const xtd::ustring& text) {show_busy_dialog(&owner, text);}
41  static void show(const iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption) {show_busy_dialog(&owner, text, caption);}
47  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);}
54  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);}
62  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);}
71  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);}
72 
74  static void show() {show_busy_dialog(nullptr);}
77  static void show(const xtd::ustring& text) {show_busy_dialog(nullptr, text);}
81  static void show(const xtd::ustring& text, const xtd::ustring& caption) {show_busy_dialog(nullptr, text, caption);}
86  static void show(const xtd::ustring& text, const xtd::ustring& caption, const xtd::drawing::icon& icon) {show_busy_dialog(nullptr, text, caption, icon);}
92  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);}
99  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);}
107  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);}
108 
109  private:
110  static busy_dialog* dialog_;
111  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) {
112  if (dialog_) return;
113  dialog_ = new busy_dialog();
114  dialog_->description(text);
115  dialog_->text(caption);
116  dialog_->icon(icon);
117  dialog_->back_color(back_color);
118  dialog_->fore_color(fore_color);
119  dialog_->opacity(opacity);
120  owner ? dialog_->show(*owner) : dialog_->show();
121  }
122  };
123  }
124 }
Contains xtd::forms::busy_dialog dialog.
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:39
Represents a Windows icon, which is a small bitmap image that is used to represent an object....
Definition: icon.h:22
Represents a dialog box that displays busy box.
Definition: busy_box.h:22
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:86
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,...
Definition: busy_box.h:36
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:99
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,...
Definition: busy_box.h:62
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,...
Definition: busy_box.h:47
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,...
Definition: busy_box.h:54
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:81
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:77
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,...
Definition: busy_box.h:41
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,...
Definition: busy_box.h:71
static void show(const iwin32_window &owner)
Displays a busy box in front of the specified window. The busy box displays a message,...
Definition: busy_box.h:32
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:92
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:107
static void hide()
Hides a busy box in front.
Definition: busy_box.h:25
static void show()
Displays a busy box.
Definition: busy_box.h:74
Represents a dialog box that displays busy dialog.
Definition: busy_dialog.h:28
const xtd::ustring & description() const
Gets the product description.
Definition: busy_dialog.h:82
xtd::drawing::icon icon() const
Gets the product icon.
Definition: busy_dialog.h:93
double opacity() const
Gets the dialog opacity.
Definition: busy_dialog.h:119
void show()
Runs busy dialog box.
const xtd::ustring & text() const
Gets the dialog title.
Definition: busy_dialog.h:71
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
Defines the base class for controls, which are components with visual representation.
Definition: control.h:67
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:19
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:38
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
Contains xtd literals.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::static_object class.