#include <limits>
#include <xtd/xtd>
class form1 :
public form {
public:
form1() {
text(
"Check box appearance");
client_size({800, 450});
controls().push_back_range({group_box_properties, check_box_demo});
group_box_properties.controls().push_back(panel_properties);
group_box_properties.location({10, 10});
group_box_properties.size({340, 430});
group_box_properties.text("properties");
panel_properties.auto_scroll(true);
panel_properties.controls().push_back_range({label_text,
text_box_text, label_text_align, choice_text_align, label_image, choice_image, label_image_align, choice_image_align, label_appearance, choice_appearance, label_flat_style, choice_flat_style, label_back_color, color_picker_back_color, label_fore_color, color_picker_fore_color, label_width, numeric_up_down_width, label_height, numeric_up_down_height, label_auto_size, check_box_auto_size, label_three_state, check_box_three_state, label_enebaled, check_box_enabled});
label_text.auto_size(true);
label_text.location({10, 13});
label_text.text("Text: ");
};
label_text_align.auto_size(true);
label_text_align.location({10, 48});
label_text_align.text("text_align: ");
choice_text_align.selected_value_changed += [&] {
check_box_demo.text_align(any_cast<content_alignment>(choice_text_align.selected_item().tag()));
};
choice_text_align.location({100, 45});
choice_text_align.items().push_back_range({{
"top_left",
content_alignment::top_left}, {
"top_center",
content_alignment::top_center}, {
"top_right",
content_alignment::top_right}, {
"middle_left",
content_alignment::middle_left}, {
"middle_center",
content_alignment::middle_center}, {
"middle_right",
content_alignment::middle_right}, {
"bottom_left",
content_alignment::bottom_left}, {
"bottom_center",
content_alignment::bottom_center}, {
"bottom_right",
content_alignment::bottom_right}});
choice_text_align.selected_index(3);
choice_text_align.width(200);
label_image.text("image: ");
label_image.auto_size(true);
label_image.location({10, 83});
choice_image.selected_value_changed += [&] {
};
choice_image.items().push_back("none");
choice_image.selected_index(0);
choice_image.location({100, 80});
choice_image.width(200);
label_image_align.text("image_align: ");
label_image_align.auto_size(true);
label_image_align.location({10, 118});
choice_image_align.selected_value_changed += [&] {
check_box_demo.image_align(any_cast<content_alignment>(choice_image_align.selected_item().tag()));
};
choice_image_align.items().push_back_range({{
"top_left",
content_alignment::top_left}, {
"top_center",
content_alignment::top_center}, {
"top_right",
content_alignment::top_right}, {
"middle_left",
content_alignment::middle_left}, {
"middle_center",
content_alignment::middle_center}, {
"middle_right",
content_alignment::middle_right}, {
"bottom_left",
content_alignment::bottom_left}, {
"bottom_center",
content_alignment::bottom_center}, {
"bottom_right",
content_alignment::bottom_right}});
choice_image_align.selected_index(4);
choice_image_align.location({100, 115});
choice_image_align.width(200);
label_appearance.text("appearance: ");
label_appearance.auto_size(true);
label_appearance.location({10, 153});
choice_appearance.selected_value_changed += [&] {
check_box_demo.appearance(any_cast<appearance>(choice_appearance.selected_item().tag()));
};
choice_appearance.selected_index(0);
choice_appearance.location({100, 150});
choice_appearance.width(200);
label_flat_style.text("flat_style: ");
label_flat_style.auto_size(true);
label_flat_style.location({10, 188});
choice_flat_style.selected_value_changed += [&] {
check_box_demo.flat_style(any_cast<flat_style>(choice_flat_style.selected_item().tag()));
};
choice_flat_style.selected_index(2);
choice_flat_style.location({100, 185});
choice_flat_style.width(200);
label_back_color.text("back_color: ");
label_back_color.auto_size(true);
label_back_color.location({10, 223});
color_picker_back_color.alpha_color(true);
color_picker_back_color.color(check_box_demo.back_color());
color_picker_back_color.color_picker_changed += [&] {
check_box_demo.back_color(color_picker_back_color.color());
};
color_picker_back_color.location({100, 220});
color_picker_back_color.width(200);
label_fore_color.text("fore_color: ");
label_fore_color.auto_size(true);
label_fore_color.location({10, 258});
color_picker_fore_color.alpha_color(true);
color_picker_fore_color.color(check_box_demo.fore_color());
color_picker_fore_color.color_picker_changed += [&] {
check_box_demo.fore_color(color_picker_fore_color.color());
};
color_picker_fore_color.location({100, 255});
color_picker_fore_color.width(200);
label_width.text("width: ");
label_width.auto_size(true);
label_width.location({10, 293});
numeric_up_down_width.value_changed += [&] {
check_box_demo.width(
as<int>(numeric_up_down_width.value()));
};
numeric_up_down_width.value(check_box_demo.width());
numeric_up_down_width.set_range(0, std::numeric_limits<int>::max());
numeric_up_down_width.location({100, 290});
numeric_up_down_width.width(200);
label_height.text("height: ");
label_height.auto_size(true);
label_height.location({10, 328});
numeric_up_down_height.value_changed += [&] {
check_box_demo.height(
as<int>(numeric_up_down_height.value()));
};
numeric_up_down_height.value(check_box_demo.height());
numeric_up_down_height.set_range(0, std::numeric_limits<int>::max());
numeric_up_down_height.location({100, 325});
numeric_up_down_height.width(200);
label_auto_size.text("auto_size: ");
label_auto_size.auto_size(true);
label_auto_size.location({10, 363});
check_box_auto_size.checked_changed += [&] {
check_box_demo.auto_size(check_box_auto_size.checked());
numeric_up_down_width.enabled(!check_box_auto_size.checked());
numeric_up_down_height.enabled(!check_box_auto_size.checked());
numeric_up_down_width.value(check_box_demo.width());
numeric_up_down_height.value(check_box_demo.height());
check_box_auto_size.text(check_box_auto_size.checked() ? "true" : "false");
};
check_box_auto_size.checked(check_box_demo.auto_size());
check_box_auto_size.location({100, 360});
check_box_auto_size.width(200);
check_box_auto_size.text("false");
label_three_state.text("three_state: ");
label_three_state.auto_size(true);
label_three_state.location({10, 398});
check_box_three_state.checked_changed += [&] {
check_box_demo.three_state(check_box_three_state.checked());
check_box_three_state.text(check_box_three_state.checked() ? "true" : "false");
};
check_box_three_state.checked(accept_button().has_value());
check_box_three_state.location({100, 395});
check_box_three_state.width(200);
check_box_three_state.text("false");
label_enebaled.text("enabled: ");
label_enebaled.auto_size(true);
label_enebaled.location({10, 433});
check_box_enabled.checked_changed += [&] {
check_box_demo.enabled(check_box_enabled.checked());
check_box_enabled.text(check_box_enabled.checked() ? "true" : "false");
};
check_box_enabled.checked(check_box_demo.enabled());
check_box_enabled.location({100, 430});
check_box_enabled.width(200);
check_box_enabled.text("true");
check_box_demo.location({380, 30});
check_box_demo.click += [&] {
};
}
private:
};
auto main() -> int {
}
static image empty
Represent an empty xtd::drawing::image.
Definition image.hpp:65
@ text_box_text
The system-defined color of the accent text color (macos specific. On other platform is same as windo...
Definition known_color.hpp:503
@ text_box
The system-defined color of the accent color (macos specific. On other platform is same as window).
Definition known_color.hpp:501
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8