xtd 0.2.0
common_dialog.h
Go to the documentation of this file.
1 #pragma once
5 #include "application.h"
6 #include "form.h"
7 #include "component.h"
9 #include "dialog_result.h"
10 #include "help_event_handler.h"
11 #include "iwin32_window.h"
12 #include <xtd/any>
13 #include <xtd/chrono>
14 
16 struct __xtd_forms_common_dialog_closed_caller__;
18 
20 namespace xtd {
22  namespace forms {
32  class common_dialog : public component {
33  struct data;
34 
35  public:
37 
40  common_dialog();
42 
44 
49 
53  std::any tag() const noexcept;
57  common_dialog& tag(const std::any& tag);
59 
61 
66  virtual void reset() noexcept = 0;
67 
72 
78 
82  void show_sheet(const iwin32_window& owner);
83 
89 
91 
96 
101 
102  protected:
103  friend struct ::__xtd_forms_common_dialog_closed_caller__;
104 
106 
111  virtual void on_dialog_closed(const dialog_closed_event_args& e);
112 
116  virtual void on_help_request(help_event_args& e);
117 
121  virtual bool run_dialog(intptr hwnd_owner) = 0;
122 
127  virtual void run_sheet(intptr hwnd_owner) = 0;
128 
133 
134  private:
135  std::shared_ptr<data> data_;
136  };
137  }
138 }
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
xtd::forms::dialog_result show_dialog()
Runs a common dialog box with a default owner.
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition: dialog_result.h:41
Contains xtd::forms::application class.
Contains xtd::forms::dialog_closed_event_handler dialog.
virtual void on_help_request(help_event_args &e)
Raises the common_dialog::help_request event.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::any tag() const noexcept
Gets an object that contains data about the control.
Contains xtd::forms::iwin32_window interface.
virtual void reset() noexcept=0
When overridden in a derived class, resets the properties of a common dialog box to their default val...
common_dialog()
Initializes a new instance of the common_dialog class.
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:21
void set_dialog_result(xtd::forms::dialog_result value)
Sets async dialog_result result after dialog box is closing.
virtual bool run_dialog(intptr hwnd_owner)=0
When overridden in a derived class, specifies a common dialog box.
Represents an event.
Definition: event.h:21
virtual void on_dialog_closed(const dialog_closed_event_args &e)
Raises the common_dialog::dialog_close event.
Contains xtd::forms::form container.
Contains xtd::forms::help_event_handler event handler.
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs a common dialog box with the specified owner.
Contains xtd::forms::dialog_result enum class.
event< common_dialog, help_event_handler > help_request
Occurs when the user clicks the Help button on a common dialog box.
Definition: common_dialog.h:95
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
xtd::forms::dialog_result dialog_result() const noexcept
Gets async dialog_result result after dialog box is closing.
virtual void run_sheet(intptr hwnd_owner)=0
When overridden in a derived class, specifies a common dialog box.
Provides data for a dialog closed event.
Definition: dialog_closed_event_args.h:20
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition: help_event_args.h:24
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Contains xtd::forms::component class.
event< common_dialog, dialog_closed_event_handler > dialog_closed
Occurs when the user close a common dialog box with dialog close button or other dialog buttons...
Definition: common_dialog.h:99
Specifies the base class used for displaying dialog boxes on the screen.
Definition: common_dialog.h:32
void show_sheet(const iwin32_window &owner)
Runs a common dialog box with the specified owner.
Provides the base implementation and enables object sharing between applications. ...
Definition: component.h:23