xtd 0.2.0
xtd::forms::color_box Class Referencefinal

Definition

Represents a common dialog box that displays available colors along with controls that enable the user to define custom colors.

Header
#include <xtd/forms/color_box>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light  
dialog_color_dialog_w.png
    html dialog_color_dialog_m.png    html dialog_color_dialog_g.png 
Dark  
dialog_color_dialog_wd.png
    html dialog_color_dialog_md.png    html dialog_color_dialog_gd.png 
Examples
The following code example demonstrates the use of color_box dialog.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/color_box>
#include <xtd/forms/form>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Color box example");
controls().push_back(button1);
button1.location({10, 10});
button1.text("Color...");
button1.click += [&] {
auto color = back_color();
back_color(color);
};
}
private:
};
auto main()->int {
application::run(form1 {});
}

Methods

static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::forms::iwin32_window &owner)
 Displays a color box in front of the specified window. The color box displays a color. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::forms::iwin32_window &owner, const xtd::ustring &title)
 Displays a color box in front of the specified window. The color box displays a color. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, color_box_styles styles)
 Displays a color box in front of the specified window. The color box displays a color with styles. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, color_box_styles styles, const std::vector< xtd::drawing::color > &custom_colors)
 Displays a color box in front of the specified window. The color box displays a color with styles, and custom colors. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color)
 Displays a color box. The color box displays a color. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::ustring &title)
 Displays a color box. The color box displays a color. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::ustring &title, color_box_styles styles)
 Displays a color box. The color box displays a color with styles. More...
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::ustring &title, color_box_styles styles, const std::vector< xtd::drawing::color > &custom_colors)
 Displays a color box. The color box displays a color with styles, and custom colors. More...
 

Member Function Documentation

◆ show() [1/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::forms::iwin32_window owner 
)
static

Displays a color box in front of the specified window. The color box displays a color.

Parameters
colorA xtd::drawing::color that specifies the color to display.
ownerA iwin32_window that represents the owner window of the color box.
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.
Examples:
color_box.cpp.

◆ show() [2/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::forms::iwin32_window owner,
const xtd::ustring title 
)
static

Displays a color box in front of the specified window. The color box displays a color.

Parameters
colorA xtd::drawing::color that specifies the color to display.
ownerA iwin32_window that represents the owner window of the color box.
titleThe file dialog box title. The default value is an empty string ("").
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

◆ show() [3/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
color_box_styles  styles 
)
static

Displays a color box in front of the specified window. The color box displays a color with styles.

Parameters
colorA xtd::drawing::color that specifies the color to display.
ownerA iwin32_window that represents the owner window of the color box.
titleThe file dialog box title. The default value is an empty string ("").
stylesA bitwise combination of the color_box_styles values. The default is alpha_color and allow_full_open.
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

◆ show() [4/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
color_box_styles  styles,
const std::vector< xtd::drawing::color > &  custom_colors 
)
static

Displays a color box in front of the specified window. The color box displays a color with styles, and custom colors.

Parameters
colorA xtd::drawing::color that specifies the color to display.
ownerA iwin32_window that represents the owner window of the color box.
titleThe file dialog box title. The default value is an empty string ("").
stylesA bitwise combination of the color_box_styles values. The default is alpha_color and allow_full_open.
custom_colorsA colors array that contains user custom colors.
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

◆ show() [5/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color)
static

Displays a color box. The color box displays a color.

Parameters
colorA xtd::drawing::color that specifies the color to display.
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

◆ show() [6/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::ustring title 
)
static

Displays a color box. The color box displays a color.

Parameters
colorA xtd::drawing::color that specifies the color to display.
titleThe file dialog box title. The default value is an empty string ("").
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

◆ show() [7/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::ustring title,
color_box_styles  styles 
)
static

Displays a color box. The color box displays a color with styles.

Parameters
colorA xtd::drawing::color that specifies the color to display.
titleThe file dialog box title. The default value is an empty string ("").
stylesA bitwise combination of the color_box_styles values. The default is alpha_color and allow_full_open.
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

◆ show() [8/8]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
const xtd::ustring title,
color_box_styles  styles,
const std::vector< xtd::drawing::color > &  custom_colors 
)
static

Displays a color box. The color box displays a color with styles, and custom colors.

Parameters
colorA xtd::drawing::color that specifies the color to display.
titleThe file dialog box title. The default value is an empty string ("").
stylesA bitwise combination of the color_box_styles values. The default is alpha_color and allow_full_open.
custom_colorsA colors array that contains user custom colors.
Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.
Remarks
If dialog_result is ok, the color parameter contains the new chosen color.

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