xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
xtd::forms::common_dialog Class Referenceabstract

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

#include <common_dialog.hpp>

Inheritance diagram for xtd::forms::common_dialog:
xtd::forms::component xtd::forms::color_dialog xtd::forms::file_dialog xtd::forms::folder_browser_dialog xtd::forms::font_dialog xtd::forms::open_file_dialog xtd::forms::save_file_dialog

Public Member Functions

 common_dialog ()=default
 Initializes a new instance of the common_dialog class. More...
 
virtual void reset ()=0
 When overridden in a derived class, resets the properties of a common dialog box to their default values. More...
 
xtd::forms::dialog_result show_dialog ()
 Runs a common dialog box with a default owner. More...
 
xtd::forms::dialog_result show_dialog (const iwin32_window &owner)
 Runs a common dialog box with the specified owner. More...
 
std::any tag () const
 Gets an object that contains data about the control. More...
 
common_dialogtag (const std::any &tag)
 Sets an object that contains data about the control. More...
 

Public Attributes

event< common_dialog, help_event_handler< component & > > help_request
 Occurs when the user clicks the Help button on a common dialog box. More...
 

Protected Member Functions

virtual void on_help_request (help_event_args &e)
 Raises the help_request event. More...
 
virtual bool run_dialog (intptr_t hwnd_owner)=0
 When overridden in a derived class, specifies a common dialog box. More...
 
- Protected Member Functions inherited from xtd::forms::component
virtual bool can_raise_events () const
 Gets a value indicating whether the component can raise an event. More...
 
bool design_mode () const
 Gets a value that indicates whether the component is currently in design mode. More...
 

Detailed Description

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

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.

Constructor & Destructor Documentation

§ common_dialog()

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

Initializes a new instance of the common_dialog class.

Member Function Documentation

§ on_help_request()

virtual void xtd::forms::common_dialog::on_help_request ( help_event_args e)
inlineprotectedvirtual

Raises the help_request event.

Parameters
eAn 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.

§ reset()

virtual void xtd::forms::common_dialog::reset ( )
pure virtual

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::font_dialog, xtd::forms::file_dialog, xtd::forms::color_dialog, and xtd::forms::folder_browser_dialog.

§ run_dialog()

virtual bool xtd::forms::common_dialog::run_dialog ( intptr_t  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::font_dialog, xtd::forms::file_dialog, xtd::forms::color_dialog, and xtd::forms::folder_browser_dialog.

§ show_dialog() [1/2]

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

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]

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

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.

§ tag() [1/2]

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

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

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.

Member Data Documentation

§ help_request

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

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


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