xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
color_picker.cpp

The following code example demonstrate the use of color_picker picker.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
text("Color picker example");
test_zone.parent(*this);
test_zone.location({10, 50});
test_zone.back_color(color::red);
test_zone.border_style(border_style::fixed_3d);
color_picker.color(test_zone.back_color());
test_zone.back_color(color_picker.color());
};
}
private:
panel test_zone;
};
}
int main() {
application::run(examples::form1());
}
Represents a picker control that displays available colors along with controls that enable the user t...
Definition: color_picker.h:22
const drawing::color & color() const
Gets the color selected by the user.
Definition: color_picker.h:30
virtual std::optional< control_ref > parent() const
Gets the parent container of the control.
Definition: control.h:596
virtual drawing::point location() const
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Definition: control.h:515
Represents a window or dialog box that makes up an application's user interface.
Definition: form.h:40
Used to group collections of controls.
Definition: panel.h:21
event< color_picker, event_handler > color_changed
Occurs when the value of the color property changes.
Definition: color_picker.h:54
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition: bitmap.h:11
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17