xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::common_dialog Class Referenceabstract
Inheritance diagram for xtd::forms::common_dialog:
xtd::forms::component xtd::object xtd::forms::color_dialog xtd::forms::file_dialog xtd::forms::folder_browser_dialog xtd::forms::font_dialog xtd::forms::input_dialog xtd::forms::open_file_dialog xtd::forms::save_file_dialog

Definition

Specifies the base class used for displaying dialog boxes on the screen.

Header
#include <xtd/forms/common_dialog>
Namespace
xtd::forms
Library
xtd.forms
Remarks
Inherited classes are required to implement run_dialog by invoking show_dialog to create a specific common dialog box. Inherited classes can optionally override hook_proc to implement specific dialog box hook functionality.

Public Events

xtd::event< common_dialog, xtd::forms::help_event_handlerhelp_request
 Occurs when the user clicks the Help button on a common dialog box.
xtd::event< common_dialog, xtd::forms::dialog_closed_event_handlerdialog_closed
 Occurs when the user close a common dialog box with dialog close button or other dialog buttons.

Public Constructors

 common_dialog ()
 Initializes a new instance of the common_dialog class.

Public Properties

auto dialog_result () const noexcept -> xtd::forms::dialog_result
 Gets async dialog_result result after dialog box is closing.
auto tag () const noexcept -> const xtd::any_object &
 Gets an object that contains data about the control.
auto tag (const xtd::any_object &value) -> common_dialog &
 Sets an object that contains data about the control.

Public Methods

virtual auto reset () noexcept -> void=0
 When overridden in a derived class, resets the properties of a common dialog box to their default values.
auto show_dialog () -> xtd::forms::dialog_result
 Runs a common dialog box with a default owner.
auto show_dialog (const iwin32_window &owner) -> xtd::forms::dialog_result
 Runs a common dialog box with the specified owner.
auto show_sheet (const iwin32_window &owner) -> void
 Runs a common dialog box with the specified owner.
auto show_sheet_dialog (const iwin32_window &owner) -> xtd::forms::dialog_result
 Runs a common dialog box with the specified owner.

Peotected methods

virtual auto on_dialog_closed (const xtd::forms::dialog_closed_event_args &e) -> void
 Raises the common_dialog::dialog_close event.
virtual auto on_help_request (xtd::forms::help_event_args &e) -> void
 Raises the common_dialog::help_request event.
virtual auto run_dialog (xtd::intptr hwnd_owner) -> bool=0
 When overridden in a derived class, specifies a common dialog box.
virtual auto run_sheet (xtd::intptr hwnd_owner) -> void=0
 When overridden in a derived class, specifies a common dialog box.
auto set_dialog_result (xtd::forms::dialog_result value) -> void
 Sets async dialog_result result after dialog box is closing.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.
 component ()
 Initialises a new instance of the component class.
virtual auto can_raise_events () const noexcept -> bool
 Gets a value indicating whether the component can raise an event.
auto design_mode () const noexcept -> bool
 Gets a value that indicates whether the component is currently in design mode.

Constructor & Destructor Documentation

◆ common_dialog()

xtd::forms::common_dialog::common_dialog ( )

Initializes a new instance of the common_dialog class.

Member Function Documentation

◆ dialog_result()

auto xtd::forms::common_dialog::dialog_result ( ) const -> xtd::forms::dialog_result
nodiscardnoexcept

Gets async dialog_result result after dialog box is closing.

Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.

◆ tag() [1/2]

auto xtd::forms::common_dialog::tag ( ) const -> const xtd::any_object &
nodiscardnoexcept

Gets an object that contains data about the control.

Returns
The object that contains data about the common_dialog.
Remarks
Use this property to store arbitrary information about the control.

◆ tag() [2/2]

auto xtd::forms::common_dialog::tag ( const xtd::any_object & value) -> common_dialog &

Sets an object that contains data about the control.

Parameters
valueThe object that contains data about the common_dialog.
Remarks
Use this property to store arbitrary information about the control.

◆ reset()

virtual auto xtd::forms::common_dialog::reset ( ) -> void
pure virtualnoexcept

When overridden in a derived class, resets the properties of a common dialog box to their default values.

Notes to Inheritors
Inheriting classes can override this method to reset their properties.

Implemented in xtd::forms::color_dialog, xtd::forms::file_dialog, xtd::forms::folder_browser_dialog, xtd::forms::font_dialog, and xtd::forms::input_dialog.

◆ show_dialog() [1/2]

auto xtd::forms::common_dialog::show_dialog ( ) -> xtd::forms::dialog_result
nodiscard

Runs a common dialog box with a default owner.

Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
This method implements run_dialog.

◆ show_dialog() [2/2]

auto xtd::forms::common_dialog::show_dialog ( const iwin32_window & owner) -> xtd::forms::dialog_result
nodiscard

Runs a common dialog box with the specified owner.

Parameters
ownerAny object that implements iwn32_window that represents the top-level window that will own the modal dialog box.
Returns
ok the user clicks OK in the dialog box; otherwise, cancel.
Remarks
This version of the show_dialog method allows you to specify a specific form or control that will own the dialog box that is shown. If you use the version of this method that has no parameters, the dialog box being shown would be owned automatically by the currently active window of your application.

◆ show_sheet()

auto xtd::forms::common_dialog::show_sheet ( const iwin32_window & owner) -> void

Runs a common dialog box with the specified owner.

Parameters
ownerAny object that implements iwn32_window that represents the top-level window that will own the modal dialog box.
Remarks
This version of the show_dialog method allows you to specify a specific form or control that will own the dialog box that is shown. If you use the version of this method that has no parameters, the dialog box being shown would be owned automatically by the currently active window of your application.

◆ show_sheet_dialog()

auto xtd::forms::common_dialog::show_sheet_dialog ( const iwin32_window & owner) -> xtd::forms::dialog_result
nodiscard

Runs a common dialog box with the specified owner.

Parameters
ownerAny object that implements iwn32_window that represents the top-level window that will own the modal dialog box.
Remarks
This version of the show_dialog method allows you to specify a specific form or control that will own the dialog box that is shown. If you use the version of this method that has no parameters, the dialog box being shown would be owned automatically by the currently active window of your application.

◆ on_dialog_closed()

virtual auto xtd::forms::common_dialog::on_dialog_closed ( const xtd::forms::dialog_closed_event_args & e) -> void
protectedvirtual

Raises the common_dialog::dialog_close event.

Parameters
eAn common_dialog_close_event_args that provides the event data.
Remarks
This method is invoked when the common dialog box is closed.

◆ on_help_request()

virtual auto xtd::forms::common_dialog::on_help_request ( xtd::forms::help_event_args & e) -> void
protectedvirtual

Raises the common_dialog::help_request event.

Parameters
eAn xtd::forms::help_event_args that provides the event data.
Remarks
This method is invoked when the Help button is clicked. Inheriting classes can override this method to handle the event.

◆ run_dialog()

virtual auto xtd::forms::common_dialog::run_dialog ( xtd::intptr hwnd_owner) -> bool
nodiscardprotectedpure virtual

When overridden in a derived class, specifies a common dialog box.

Parameters
hwnd_ownerA value that represents the window handle of the owner window for the common dialog box.
Returns
true if the dialog box was successfully run; otherwise, false.

Implemented in xtd::forms::color_dialog, xtd::forms::file_dialog, xtd::forms::folder_browser_dialog, xtd::forms::font_dialog, and xtd::forms::input_dialog.

◆ run_sheet()

virtual auto xtd::forms::common_dialog::run_sheet ( xtd::intptr hwnd_owner) -> void
protectedpure virtual

When overridden in a derived class, specifies a common dialog box.

Parameters
hwnd_ownerA value that represents the window handle of the owner window for the common dialog box.
Returns
true if the dialog box was successfully run; otherwise, false.
Remarks
The result will done in async. Check result_dialog property after dialog box closed to obtain the result.

Implemented in xtd::forms::color_dialog, xtd::forms::file_dialog, xtd::forms::folder_browser_dialog, xtd::forms::font_dialog, and xtd::forms::input_dialog.

◆ set_dialog_result()

auto xtd::forms::common_dialog::set_dialog_result ( xtd::forms::dialog_result value) -> void
protected

Sets async dialog_result result after dialog box is closing.

Parameters
valueok if the user clicks OK in the dialog box; otherwise, cancel.

Member Data Documentation

◆ help_request

xtd::event<common_dialog, xtd::forms::help_event_handler> xtd::forms::common_dialog::help_request

Occurs when the user clicks the Help button on a common dialog box.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ dialog_closed

xtd::event<common_dialog, xtd::forms::dialog_closed_event_handler> xtd::forms::common_dialog::dialog_closed

Occurs when the user close a common dialog box with dialog close button or other dialog buttons.

Remarks
For more information about handling events, see Handling and Raising Events.

The documentation for this class was generated from the following file: