xtd 0.2.0
colors.cpp

demonstrates the use of xtd::forms::user_control control with xtd::drawing::color.

Windows
colors_w.png

colors_wd.png
macOS
colors_m.png

colors_md.png
Gnome
colors_g.png

colors_gd.png
#include <xtd/forms/application>
#include <xtd/forms/form>
#include "color_chooser.h"
#include "color_editor.h"
using namespace xtd::forms;
namespace colors_example {
class main_form : public form {
public:
main_form() {
text("Colors example");
start_position(form_start_position::manual);
location({300, 200});
client_size({640, 420});
colors.parent(*this);
colors.location({10, 10});
colors.size({300, 400});
colors.selected_color_changed += [&] {
editor.color(colors.selected_color());
};
editor.parent(*this);
editor.location({330, 10});
editor.size({300, 400});
colors.selected_index(0ul);
}
private:
color_chooser colors;
color_editor editor;
};
}
auto main()->int {
application::run(colors_example::main_form {});
}