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

This example demonstrates the use of xtd::reflection::assembly attributes, xtd::forms::form classes.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/text_box>
#include <xtd/startup>
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
version.text_align(content_alignment::middle_left);
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1::main);
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Represents a standard Windows label.
Definition label.h:38
Represents a standard Windows text box.
Definition text_box.h:31
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:114
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:175
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12