xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Static Public Member Functions | List of all members
xtd::forms::color_box Class Referencefinal

#include <color_box.h>

Definition

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

Namespace
xtd::forms
Library
xtd.forms
Examples
The following code example demonstrate the use of color_box dialog.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::drawing;
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 += [&] {
color color = back_color();
back_color(color);
};
}
private:
};
int main() {
application::run(form1());
}

Static Public Member Functions

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, 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, 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, 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, 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/6]

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

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.

◆ show() [2/6]

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

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.
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() [3/6]

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

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.
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() [4/6]

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

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() [5/6]

static xtd::forms::dialog_result xtd::forms::color_box::show ( xtd::drawing::color color,
color_box_styles  styles 
)
inlinestatic

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

Parameters
colorA xtd::drawing::color that specifies the color to display.
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() [6/6]

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

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.
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: