xtd 0.2.0
Loading...
Searching...
No Matches
common_dialog.h
Go to the documentation of this file.
1
4#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
16struct __xtd_forms_common_dialog_closed_caller__;
18
20namespace xtd {
22 namespace forms {
34 class common_dialog : public component {
35 struct data;
36
37 public:
39
44
46
51
55 std::any tag() const noexcept;
59 common_dialog& tag(const std::any& tag);
61
63
68 virtual void reset() noexcept = 0;
69
74
80
84 void show_sheet(const iwin32_window& owner);
85
91
93
98
103
104 protected:
105 friend struct ::__xtd_forms_common_dialog_closed_caller__;
106
108
114
119
123 virtual bool run_dialog(intptr hwnd_owner) = 0;
124
129 virtual void run_sheet(intptr hwnd_owner) = 0;
130
135
136 private:
137 xtd::sptr<data> data_;
138 };
139 }
140}
Represents an event.
Definition event.h:21
Specifies the base class used for displaying dialog boxes on the screen.
Definition common_dialog.h:34
void set_dialog_result(xtd::forms::dialog_result value)
Sets async dialog_result result after dialog box is closing.
virtual void on_help_request(help_event_args &e)
Raises the common_dialog::help_request event.
common_dialog()
Initializes a new instance of the common_dialog class.
xtd::forms::dialog_result show_dialog()
Runs a common dialog box with a default owner.
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:101
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:97
virtual void run_sheet(intptr hwnd_owner)=0
When overridden in a derived class, specifies a common dialog box.
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs a common dialog box with the specified owner.
void show_sheet(const iwin32_window &owner)
Runs a common dialog box with the specified owner.
xtd::forms::dialog_result dialog_result() const noexcept
Gets async dialog_result result after dialog box is closing.
std::any tag() const noexcept
Gets an object that contains data about the control.
virtual bool run_dialog(intptr hwnd_owner)=0
When overridden in a derived class, specifies a common dialog box.
virtual void on_dialog_closed(const dialog_closed_event_args &e)
Raises the common_dialog::dialog_close event.
virtual void reset() noexcept=0
When overridden in a derived class, resets the properties of a common dialog box to their default val...
Provides the base implementation and enables object sharing between applications.
Definition component.h:25
Provides data for a dialog closed event.
Definition dialog_closed_event_args.h:22
Provides data for the xtd::forms::control::control_added and xtd::forms::control::control_removed eve...
Definition help_event_args.h:26
Provides an interface to expose Win32 HWND handles.
Definition iwin32_window.h:23
Contains xtd::forms::component class.
Contains xtd::forms::dialog_closed_event_handler dialog.
Contains xtd::forms::dialog_result enum class.
delegate< void(object &sender, const dialog_closed_event_args &e)> dialog_closed_event_handler
Provides handler for a dialog closed event.
Definition dialog_closed_event_handler.h:24
delegate< void(object &sender, help_event_args &e)> help_event_handler
Represents the method that will handle the xtd::forms::control::help_requested event of a control.
Definition help_event_handler.h:25
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
@ any
Indicates that all styles except allow_binary_specifier, allow_octal_specifier and allow_hex_specifie...
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition dialog_result.h:43
@ e
The E key.
Contains xtd::forms::help_event_handler event handler.
Contains xtd::forms::iwin32_window interface.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::application class.
Contains xtd::forms::style_sheets::form alias.