#include <xtd/diagnostics/process>
#include <xtd/forms/application>
#include <xtd/forms/choice>
#include <xtd/forms/form>
#include <xtd/forms/link_label>
#include "../properties/resources.hpp"
namespace form_background_image2 {
class form1 :
public form {
public:
form1() {
background_image(application::dark_mode() ? properties::resources::bliss_night() : properties::resources::bliss_day());
client_size({600, 450});
controls().push_back_range({bliss_url, image_layout_choice});
double_buffered(true);
text("form with background image example 2");
bliss_url.back_color(color::from_argb(64, system_colors::control()));
bliss_url.dock(dock_style::bottom);
bliss_url.text("MACOS BLISS");
bliss_url.links().push_back({0, bliss_url.text().
size(),
"https://basicappleguy.com/basicappleblog/macosbliss"});
e.visited(true);
process::start(as<string>(e.link().link_data()));
};
image_layout_choice.items().push_back({name, value});
image_layout_choice.location({10, 10});
image_layout_choice.selected_index_changed += [&] {
background_image_layout(as<xtd::forms::image_layout>(image_layout_choice.selected_item().tag()));
};
image_layout_choice.selected_index(0);
}
protected:
void on_system_colors_changed(
const event_args &e) {
form::on_system_colors_changed(e);
background_image(application::dark_mode() ? properties::resources::bliss_night() : properties::resources::bliss_day());
bliss_url.back_color(color::from_argb(64, system_colors::control()));
}
private:
};
}
auto main() -> int {
application::run(::form_background_image2::form1 {});
}
Provides the base class for enumerations.
Definition enum_object.hpp:42
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10