xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::color_box Class Referencefinal
Inheritance diagram for xtd::forms::color_box:
xtd::static_object

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  
 
 
 
 
 
Dark  
 
 
 
 
 
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();
if (color_box::show(color, *this) == forms::dialog_result::ok)
back_color(color);
};
}
private:
button button1;
};
auto main()->int {
application::run(form1 {});
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a Windows button control.
Definition button.h:47
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:52
@ button1
The first button on the message box is the default button.
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10

Public Static 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.
 
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.
 
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.
 
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.
 
static xtd::forms::dialog_result show (xtd::drawing::color &color)
 Displays a color box. The color box displays a color.
 
static xtd::forms::dialog_result show (xtd::drawing::color &color, const xtd::ustring &title)
 Displays a color box. The color box displays a color.
 
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.
 
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.
 

Member Function Documentation

◆ show() [1/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() [2/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.

◆ 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 
)
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() [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 
)
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() [5/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() [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: