Represents a common dialog box that displays available colors along with controls that enable the user to define custom colors.
| Windows | macOS | Gnome | |
|---|---|---|---|
| Light |
html dialog_color_dialog_m.png html dialog_color_dialog_g.png | ||
| Dark |
html dialog_color_dialog_md.png html dialog_color_dialog_gd.png |
Public Types | |
| using | colors = std::vector< xtd::drawing::color > |
| @ brief Represents an xtd::drawing::color array. More... | |
Constructors | |
| color_dialog () | |
| Initializes a new instance of the color_dialog class. More... | |
Properties | |
| bool | alpha_color () const noexcept |
| Gets a value indicating whether the dialog box shows alpha values and an opacity selector (slider). More... | |
| color_dialog & | alpha_color (bool alpha_color) |
| Sets a value indicating whether the user can use the dialog box to define custom colors. More... | |
| bool | allow_full_open () const noexcept |
| Gets a value indicating whether the user can use the dialog box to define custom colors. More... | |
| 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. More... | |
| bool | any_color () const noexcept |
| Gets a value indicating whether the dialog box displays all available colors in the set of basic colors. More... | |
| 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. More... | |
| drawing::color | color () const noexcept |
| Gets the color selected by the user. More... | |
| color_dialog & | color (const drawing::color &color) |
| Sets the color selected by the user. More... | |
| const colors & | custom_colors () const noexcept |
| Gets the set of custom colors shown in the dialog box. More... | |
| color_dialog & | custom_colors (const colors &custom_colors) |
| Sets the set of custom colors shown in the dialog box. More... | |
| 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. More... | |
| 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. More... | |
| size_t | options () const noexcept |
| Gets values to initialize the color_dialog. More... | |
| bool | show_help () const noexcept |
| Gets a value indicating whether a Help button appears in the color dialog box. More... | |
| color_dialog & | show_help (bool show_help) |
| Sets a value indicating whether a Help button appears in the color dialog box. More... | |
| bool | solid_color_only () const noexcept |
| Gets a value indicating whether the dialog box will restrict users to selecting solid colors only. More... | |
| 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. More... | |
| virtual const xtd::ustring & | title () const noexcept |
| Gets the color dialog box title. More... | |
| virtual color_dialog & | title (const xtd::ustring &value) |
| Sets the color dialog box title. More... | |
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. More... | |
Protected methods | |
| bool | run_dialog (intptr owner) override |
| When overridden in a derived class, specifies a common dialog box. More... | |
| void | run_sheet (intptr owner) override |
| When overridden in a derived class, specifies a common dialog box. More... | |
Additional Inherited Members | |
Public Attributes inherited from xtd::forms::common_dialog | |
| event< common_dialog, help_event_handler > | help_request |
| Occurs when the user clicks the Help button on a common dialog box. More... | |
| 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. More... | |
Public Member Functions inherited from xtd::forms::common_dialog | |
| common_dialog () | |
| Initializes a new instance of the common_dialog class. More... | |
| xtd::forms::dialog_result | dialog_result () const noexcept |
| Gets async dialog_result result after dialog box is closing. More... | |
| std::any | tag () const noexcept |
| Gets an object that contains data about the control. More... | |
| common_dialog & | tag (const std::any &tag) |
| Sets an object that contains data about the control. 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... | |
| void | show_sheet (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner. More... | |
| xtd::forms::dialog_result | show_sheet_dialog (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner. More... | |
Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object. More... | |
| bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More... | |
| virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More... | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. More... | |
| template<typename object_t > | |
| std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Creates a shallow copy of the current object. More... | |
| virtual xtd::ustring | to_string () const noexcept |
| Returns a sxd::ustring that represents the current object. More... | |
Static Public Member Functions inherited from xtd::object | |
| static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More... | |
| static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More... | |
Protected Member Functions inherited from xtd::forms::common_dialog | |
| virtual void | on_dialog_closed (const dialog_closed_event_args &e) |
| Raises the common_dialog::dialog_close event. More... | |
| virtual void | on_help_request (help_event_args &e) |
| Raises the common_dialog::help_request event. More... | |
| void | set_dialog_result (xtd::forms::dialog_result value) |
| Sets async dialog_result result after dialog box is closing. More... | |
Protected Member Functions inherited from xtd::forms::component | |
| component () | |
| Initialises a new instance of the component class. More... | |
| virtual bool | can_raise_events () const noexcept |
| Gets a value indicating whether the component can raise an event. More... | |
| bool | design_mode () const noexcept |
| Gets a value that indicates whether the component is currently in design mode. More... | |
| using xtd::forms::color_dialog::colors = std::vector<xtd::drawing::color> |
@ brief 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 user can use the dialog box to define custom colors.
| 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 shows alpha values and an opacity selector (slider).
| 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 dialog box displays all available colors in the set of basic colors.
| 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.
| 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. |
|
noexcept |
Gets a value indicating whether the controls used to create custom colors are visible when the dialog box is opened.
| 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. |
|
noexcept |
Gets values to initialize the color_dialog.
|
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. |
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.
|
noexcept |
Gets a value indicating whether a Help button appears in the color dialog box.
| 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.
| 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 (""). |