xtd 0.2.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

event< common_dialog, help_event_handlerhelp_request
 Occurs when the user clicks the Help button on a common dialog box.
 
event< common_dialog, 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

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.
 
common_dialogtag (const std::any &tag)
 Sets an object that contains data about the control.
 

Public Methods

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

Peotected methods

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

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 
- Protected Member Functions inherited from xtd::forms::component
 component ()
 Initialises a new instance of the component class.
 
virtual bool can_raise_events () const noexcept
 Gets a value indicating whether the component can raise an event.
 
bool design_mode () const noexcept
 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()

xtd::forms::dialog_result xtd::forms::common_dialog::dialog_result ( ) const
noexcept

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]

std::any xtd::forms::common_dialog::tag ( ) const
noexcept

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]

common_dialog & xtd::forms::common_dialog::tag ( const std::any &  tag)

Sets an object that contains data about the control.

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

◆ reset()

virtual void xtd::forms::common_dialog::reset ( )
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]

xtd::forms::dialog_result xtd::forms::common_dialog::show_dialog ( )

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.
Examples
demo.cpp, input_dialog_multiline.cpp, and painting.cpp.

◆ show_dialog() [2/2]

xtd::forms::dialog_result xtd::forms::common_dialog::show_dialog ( const iwin32_window owner)

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()

void xtd::forms::common_dialog::show_sheet ( const iwin32_window owner)

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()

xtd::forms::dialog_result xtd::forms::common_dialog::show_sheet_dialog ( const iwin32_window owner)

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.
Examples
input_dialog_password.cpp.

◆ on_dialog_closed()

virtual void xtd::forms::common_dialog::on_dialog_closed ( const dialog_closed_event_args e)
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 void xtd::forms::common_dialog::on_help_request ( help_event_args e)
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 bool xtd::forms::common_dialog::run_dialog ( intptr  hwnd_owner)
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.

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

◆ run_sheet()

virtual void xtd::forms::common_dialog::run_sheet ( intptr  hwnd_owner)
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::file_dialog, xtd::forms::color_dialog, xtd::forms::folder_browser_dialog, xtd::forms::font_dialog, and xtd::forms::input_dialog.

◆ set_dialog_result()

void xtd::forms::common_dialog::set_dialog_result ( xtd::forms::dialog_result  value)
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

event<common_dialog, 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

event<common_dialog, 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: