demonstrates the use of xtd::settings component without CMake setting commands.
#include <xtd/xtd>
auto main() -> int {
auto main_form = form::create("Settings example", form_start_position::manual);
auto back_color_picker = color_picker::create(main_form, main_form.back_color(), {10, 10}, {75, 25});
back_color_picker.color_picker_changed +=
delegate_ {
main_form.back_color(back_color_picker.color());
};
auto save_button = button::create(main_form, "&Save", {90, 10});
settings.write("size", main_form.client_size());
settings.write("location", main_form.location());
settings.write("back_color", main_form.back_color());
settings.save();
};
auto reload_button = button::create(main_form, "&Reload", {170, 10});
main_form.client_size(settings.read("size", drawing::size {335, 45}));
main_form.location(settings.read("location", point {100, 50}));
main_form.back_color(settings.read("back_color", system_colors::control()));
back_color_picker.color(main_form.back_color());
};
auto reset_button = button::create(main_form, "R&eset", {250, 10});
settings.reset();
reload_button.perform_click();
};
reload_button.perform_click();
application::run(main_form);
}
Represent settings associate to the application.
Definition settings.hpp:178
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:900