#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/button_images>
#include <xtd/forms/form>
#include <xtd/forms/list_box>
#include <xtd/forms/popup_panel>
class form1 :
public form {
public:
form1() {
text(
"Popup panel example");
client_size({300, 100});
controls().push_back_range({
button1, popup_panel1});
list_box1.parent(popup_panel1);
list_box1.items().push_back_range({{
"clear",
button_images::from_name(
"weather-clear")}, {
"clear night",
button_images::from_name(
"weather-clear-night")}, {
"few clouds",
button_images::from_name(
"weather-few-clouds")}, {
"few clouds night",
button_images::from_name(
"weather-few-clouds-night")}, {
"fog",
button_images::from_name(
"weather-fog")}, {
"overcast",
button_images::from_name(
"weather-overcast")}, {
"severe alert",
button_images::from_name(
"weather-severe-alert")}, {
"showers",
button_images::from_name(
"weather-showers")}, {
"showers scattered",
button_images::from_name(
"weather-showers-scattered")}, {
"snow",
button_images::from_name(
"weather-snow")}, {
"storm",
button_images::from_name(
"weather-storm")}});
list_box1.selected_index(0);
list_box1.click += [&] {
button1.text(list_box1.selected_item().value());
popup_panel1.hide();
};
button1.text(list_box1.selected_item().value());
popup_panel1.show();
};
popup_panel1.location(
button1.location());
popup_panel1.width(
button1.width());
}
private:
list_box list_box1;
};
auto main() -> int {
}
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