Represents a common dialog box that displays available colors along with controls that enable the user to define custom colors.
Windows | macOS | Gnome | |
---|---|---|---|
Light | ![]() | ![]() | ![]() |
Dark | ![]() | ![]() | ![]() |
Public Types | |
using | colors |
Represents an xtd::drawing::color array. | |
Public Constructors | |
color_dialog () | |
Initializes a new instance of the color_dialog class. | |
Public Properties | |
bool | alpha_color () const noexcept |
Gets a value indicating whether the dialog box shows alpha values and an opacity selector (slider). | |
color_dialog & | alpha_color (bool alpha_color) |
Sets a value indicating whether the user can use the dialog box to define custom colors. | |
bool | allow_full_open () const noexcept |
Gets a value indicating whether the user can use the dialog box to define custom colors. | |
color_dialog & | allow_full_open (bool allow_full_open) |
Sets a value indicating whether the user can use the dialog box to define custom colors. | |
bool | any_color () const noexcept |
Gets a value indicating whether the dialog box displays all available colors in the set of basic colors. | |
color_dialog & | any_color (bool any_color) |
Sets a value indicating whether the dialog box displays all available colors in the set of basic colors. | |
drawing::color | color () const noexcept |
Gets the color selected by the user. | |
color_dialog & | color (const drawing::color &color) |
Sets the color selected by the user. | |
const colors & | custom_colors () const noexcept |
Gets the set of custom colors shown in the dialog box. | |
color_dialog & | custom_colors (const colors &custom_colors) |
Sets the set of custom colors shown in the dialog box. | |
bool | full_open () const noexcept |
Gets a value indicating whether the controls used to create custom colors are visible when the dialog box is opened. | |
color_dialog & | full_open (bool full_open) |
Sets a value indicating whether the controls used to create custom colors are visible when the dialog box is opened. | |
size_t | options () const noexcept |
Gets values to initialize the color_dialog. | |
bool | show_help () const noexcept |
Gets a value indicating whether a Help button appears in the color dialog box. | |
color_dialog & | show_help (bool show_help) |
Sets a value indicating whether a Help button appears in the color dialog box. | |
bool | solid_color_only () const noexcept |
Gets a value indicating whether the dialog box will restrict users to selecting solid colors only. | |
color_dialog & | solid_color_only (bool solid_color_only) |
Sets a value indicating whether the dialog box will restrict users to selecting solid colors only. | |
virtual const xtd::string & | title () const noexcept |
Gets the color dialog box title. | |
virtual color_dialog & | title (const xtd::string &value) |
Sets the color dialog box title. | |
Public Methods | |
void | reset () noexcept override |
Resets all options to their default values, the last selected color to black, and the custom colors to their default values. | |
Protected Methods | |
bool | run_dialog (intptr owner) override |
When overridden in a derived class, specifies a common dialog box. | |
void | run_sheet (intptr owner) override |
When overridden in a derived class, specifies a common dialog box. | |
Additional Inherited Members | |
event< common_dialog, help_event_handler > | help_request |
Occurs when the user clicks the Help button on a common dialog box. | |
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. | |
common_dialog () | |
Initializes a new instance of the common_dialog class. | |
xtd::forms::dialog_result | dialog_result () const noexcept |
Gets async dialog_result result after dialog box is closing. | |
const xtd::any_object & | tag () const noexcept |
Gets an object that contains data about the control. | |
common_dialog & | tag (const xtd::any_object &tag) |
Sets an object that contains data about the control. | |
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. | |
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 xtd::size | 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<class object_t> | |
xtd::unique_ptr_object< 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. | |
template<class object_a_t, class 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<class object_a_t, class 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. | |
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. | |
void | set_dialog_result (xtd::forms::dialog_result value) |
Sets async dialog_result result after dialog box is closing. | |
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. | |
Represents an xtd::drawing::color array.
xtd::forms::color_dialog::color_dialog | ( | ) |
Initializes a new instance of the color_dialog class.
Property | Initial Value |
---|---|
alpha_color | true |
allow_full_open | true |
any_color | false |
color | drawing::color::black |
custom_colors | has no value |
full_open | false |
show_help | false |
solid_color_only | false |
|
noexcept |
Gets a value indicating whether the dialog box shows alpha values and an opacity selector (slider).
true
if the dialog box shows alpha values and an opacity selector (slider); otherwise, false
. The default is true
. color_dialog & xtd::forms::color_dialog::alpha_color | ( | bool | alpha_color | ) |
Sets a value indicating whether the user can use the dialog box to define custom colors.
alpha_color | true if the dialog box shows alpha values and an opacity selector (slider); otherwise, false . |
|
noexcept |
Gets a value indicating whether the user can use the dialog box to define custom colors.
true
if the user can define custom colors; otherwise, false
. The default is true
. color_dialog & xtd::forms::color_dialog::allow_full_open | ( | bool | allow_full_open | ) |
Sets a value indicating whether the user can use the dialog box to define custom colors.
allow_full_open | true if the user can define custom colors; otherwise, false . The default is true . |
|
noexcept |
Gets a value indicating whether the dialog box displays all available colors in the set of basic colors.
true
if the dialog box displays all available colors in the set of basic colors; otherwise, false
. The default value is false
. color_dialog & xtd::forms::color_dialog::any_color | ( | bool | any_color | ) |
Sets a value indicating whether the dialog box displays all available colors in the set of basic colors.
any_color | true if the dialog box displays all available colors in the set of basic colors; otherwise, false . The default value is false . |
|
noexcept |
Gets the color selected by the user.
color_dialog & xtd::forms::color_dialog::color | ( | const drawing::color & | color | ) |
Sets the color selected by the user.
color | The color selected by the user. If a color is not selected. |
|
noexcept |
Gets the set of custom colors shown in the dialog box.
true
. color_dialog & xtd::forms::color_dialog::custom_colors | ( | const colors & | custom_colors | ) |
Sets the set of custom colors shown in the dialog box.
custom_color | A set of custom colors shown by the dialog box. |
true
.
|
noexcept |
Gets a value indicating whether the controls used to create custom colors are visible when the dialog box is opened.
true
if the custom color controls are available when the dialog box is opened; otherwise, false
. The default value is false
. false
, then full_open has no effect. color_dialog & xtd::forms::color_dialog::full_open | ( | bool | full_open | ) |
Sets a value indicating whether the controls used to create custom colors are visible when the dialog box is opened.
full_open | true if the custom color controls are available when the dialog box is opened; otherwise, false . The default value is false . |
false
, then full_open has no effect.
|
noexcept |
Gets values to initialize the color_dialog.
|
noexcept |
Gets a value indicating whether a Help button appears in the color dialog box.
true
if the Help button is shown in the dialog box; otherwise, false
. The default value is false
. color_dialog & xtd::forms::color_dialog::show_help | ( | bool | show_help | ) |
Sets a value indicating whether a Help button appears in the color dialog box.
show_help | true if the Help button is shown in the dialog box; otherwise, false . |
|
noexcept |
Gets a value indicating whether the dialog box will restrict users to selecting solid colors only.
true
if users can select only solid colors; otherwise, false
. The default value is false
. color_dialog & xtd::forms::color_dialog::solid_color_only | ( | bool | solid_color_only | ) |
Sets a value indicating whether the dialog box will restrict users to selecting solid colors only.
solid_color_only | true if users can select only solid colors; otherwise, false . |
|
virtualnoexcept |
Gets the color dialog box title.
|
virtual |
Sets the color dialog box title.
value | The file dialog box title. The default value is an empty string (""). |
|
overridevirtualnoexcept |
Resets all options to their default values, the last selected color to black, and the custom colors to their default values.
Implements xtd::forms::common_dialog.
|
overrideprotectedvirtual |
When overridden in a derived class, specifies a common dialog box.
owner | A value that represents the window handle of the owner window for the common dialog box. |
true
if the dialog box was successfully run; otherwise, false
. Implements xtd::forms::common_dialog.
|
overrideprotectedvirtual |
When overridden in a derived class, specifies a common dialog box.
owner | A value that represents the window handle of the owner window for the common dialog box. |
Implements xtd::forms::common_dialog.