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 = std::vector< xtd::drawing::color > |
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 | |
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. | |
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. | |
Public Member Functions inherited from xtd::forms::common_dialog | |
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. | |
std::any | tag () const noexcept |
Gets an object that contains data about the control. | |
common_dialog & | tag (const std::any &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. | |
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::common_dialog | |
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. | |
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. | |
using xtd::forms::color_dialog::colors = std::vector<xtd::drawing::color> |
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).
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.
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.
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.
|
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 (""). |
|
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.