#include <xtd/drawing/system_colors>
#include <xtd/drawing/texts>
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/button_images>
#include <xtd/forms/form>
#include <xtd/forms/images>
#include <xtd/forms/label>
#include <xtd/forms/picture_box>
namespace example {
class form1 :
public form {
public:
form1() {
text(
"Images 2 example");
client_size({880, 820});
controls().push_back_range({label_picture_kde_theme, label_picture_gnome_theme, label_picture_macos_theme, label_picture_symbolic_theme, label_picture_windows_theme, label_picture_xtd_theme, picture_kde_theme, picture_gnome_theme, picture_macos_theme, picture_symbolic_theme, picture_windows_theme, picture_xtd_theme, panel_separator_line, label_picture_context, label_picture_name, label_picture_size, button_context_previous, button_context_next, button_name_previous, button_name_next, button_decrease, button_increase});
label_picture_kde_theme.bounds({10, 25, 280, label_picture_name.height()});
label_picture_kde_theme.text("kde");
label_picture_gnome_theme.bounds({300, 25, 280, label_picture_name.height()});
label_picture_gnome_theme.text("gnome");
label_picture_macos_theme.bounds({590, 25, 280, label_picture_name.height()});
label_picture_macos_theme.text("macos");
label_picture_symbolic_theme.bounds({10, 360, 280, label_picture_name.height()});
label_picture_symbolic_theme.text("symbolic");
label_picture_windows_theme.bounds({300, 360, 280, label_picture_name.height()});
label_picture_windows_theme.text("windows");
label_picture_xtd_theme.bounds({590, 360, 280, label_picture_name.height()});
label_picture_xtd_theme.text("xtd");
picture_kde_theme.bounds({10, 65, 280, 280});
picture_gnome_theme.bounds({300, 65, 280, 280});
picture_macos_theme.bounds({590, 65, 280, 280});
picture_symbolic_theme.bounds({10, 400, 280, 280});
picture_windows_theme.bounds({300, 400, 280, 280});
picture_xtd_theme.bounds({590, 400, 280, 280});
panel_separator_line.bounds({10, 695, 860, 1});
label_picture_context.bounds({10, 710, 280, label_picture_name.height()});
label_picture_name.bounds({300, 710, 280, label_picture_name.height()});
label_picture_size.bounds({590, 710, 280, label_picture_name.height()});
button_context_previous.auto_repeat(true);
button_context_previous.enabled(false);
button_context_previous.bounds({10, 750, 125, 40});
button_context_previous.click += [&] {
current_context_index--;
current_name_index = 0;
update_form();
};
button_context_next.auto_repeat(true);
button_context_next.bounds({165, 750, 125, 40});
button_context_next.click += [&] {
current_context_index++;
current_name_index = 0;
update_form();
};
button_name_previous.auto_repeat(true);
button_name_previous.enabled(false);
button_name_previous.text("P&revious");
button_name_previous.bounds({300, 750, 125, 40});
button_name_previous.click += [&] {
current_name_index--;
update_form();
};
button_name_next.auto_repeat(true);
button_name_next.text("N&ext");
button_name_next.bounds({455, 750, 125, 40});
button_name_next.click += [&] {
current_name_index++;
update_form();
};
button_decrease.auto_repeat(true);
button_decrease.enabled(false);
button_decrease.text("&Decrease");
button_decrease.bounds({590, 750, 125, 40});
button_decrease.click += [&] {
current_size_index--;
update_form();
};
button_increase.auto_repeat(true);
button_increase.text("&Increase");
button_increase.bounds({745, 750, 125, 40});
button_increase.click += [&] {
current_size_index++;
update_form();
};
update_form();
}
private:
void update_form() {
button_context_previous.enabled(current_context_index > 0);
button_name_previous.enabled(current_name_index > 0);
button_decrease.enabled(current_size_index > 0);
}
size_t current_context_index = 0;
size_t current_name_index = 0;
size_t current_size_index = 7;
label label_picture_kde_theme;
label label_picture_gnome_theme;
label label_picture_macos_theme;
label label_picture_symbolic_theme;
label label_picture_windows_theme;
label label_picture_xtd_theme;
panel panel_separator_line;
label label_picture_context;
label label_picture_name;
label label_picture_size;
button button_context_previous;
};
}
auto main() -> int {
}
static image empty
Represent an empty xtd::drawing::image.
Definition image.hpp:65
static xtd::drawing::color window_text()
Gets a xtd::drawing::color structure that is the color of the text in the client area of a window.
static xtd::drawing::color control_text()
Gets a xtd::drawing::color structure that is the color of text in a 3-D element.
static xtd::drawing::color accent()
Gets a xtd::drawing::color structure that is the color used to accent a control.
static xtd::drawing::color window()
Gets a xtd::drawing::color structure that is the color of the background in the client area of a wind...
static xtd::drawing::color accent_text()
Gets a xtd::drawing::color structure that is the color of the text used to accent a control.
static xtd::string previous()
Gets a system-defined text that has a string value of "&Previous". This field is constant.
static xtd::string next()
Gets a system-defined text that has a string value of "&Next". This field is constant.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
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
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31