demonstrates the use of xtd::forms::emoticons control.
- Windows
-
- macOS
-
- Gnome
-
#include <xtd/xtd>
auto main() -> int {
auto main_form = form::create("Emoticons example");
main_form.client_size({500, 400}).padding(10);
auto emoticon_label = label::create(main_form, "");
auto emoticons_list_box = list_box::create(main_form, list_box::object_collection {});
emoticons_list_box.dock(dock_style::left).width(200);
for (const auto& emoticon : emoticons::get_emoticons())
emoticons_list_box.items().push_back({string::format("{} {}", emoticon, emoticon.name()), emoticon});
emoticons_list_box.selected_value_changed +=
delegate_ {
emoticon_label.text(as<emoticon>(emoticons_list_box.selected_item().tag()).to_string());
};
emoticons_list_box.selected_index(0);
application::run(main_form);
}
#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