xtd 0.2.0
Loading...
Searching...
No Matches
colored_forms.cpp

demonstrates the use of xtd::forms::form control with unicode text.

Windows

macOS

Gnome

#include <xtd/xtd>
auto main() -> int {
auto colored_forms = list<ptr<form>> {};
auto form_color = known_color::alice_blue;
auto form_main = form::create("Main Form", point {screen::primary_screen().working_area().width - 340, 40});
auto create_button = button::create(form_main, "Create", {10, 10});
create_button.click += delegate_ {
auto colored_form = new_ptr<form>();
colored_form->text(enum_object<>::to_string(form_color)).back_color(color::from_known_color(form_color)).visible(true);
colored_forms.push_back(colored_form);
form_color = form_color != known_color::yellow_green ? as<known_color>(as<int>(form_color) + 1) : known_color::alice_blue;
};
application::run(form_main);
}
#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