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

represents an example of system_report with xtd::forms::text_box control.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/tab_control>
#include <xtd/forms/tab_page>
#include <xtd/forms/text_box>
#include <xtd/system_report>
using namespace xtd;
using namespace xtd::forms;
class main_form : public form {
public:
main_form() {
text("System reports example");
start_position(form_start_position::center_screen);
size({500, 700});
report_tab_control.dock(dock_style::fill);
report_tab_control.parent(*this);
report_tab_control.tab_pages().push_back_range({text_report_tab_page, json_report_tab_page, xml_report_tab_page});
text_report_tab_page.text("text");
json_report_tab_page.text("json");
xml_report_tab_page.text("xml");
text_reports_text_box.dock(dock_style::fill);
text_reports_text_box.font({drawing::font_family::generic_monospace(), text_reports_text_box.font().size()});
text_reports_text_box.multiline(true);
text_reports_text_box.parent(text_report_tab_page);
text_reports_text_box.read_only(true);
text_reports_text_box.text(system_report::to_string());
text_reports_text_box.word_wrap(false);
json_reports_text_box.dock(dock_style::fill);
json_reports_text_box.font({drawing::font_family::generic_monospace(), json_report_tab_page.font().size()});
json_reports_text_box.multiline(true);
json_reports_text_box.parent(json_report_tab_page);
json_reports_text_box.read_only(true);
json_reports_text_box.text(system_report::to_json());
json_reports_text_box.word_wrap(false);
xml_reports_text_box.dock(dock_style::fill);
xml_reports_text_box.font({drawing::font_family::generic_monospace(), xml_reports_text_box.font().size()});
xml_reports_text_box.multiline(true);
xml_reports_text_box.parent(xml_report_tab_page);
xml_reports_text_box.read_only(true);
xml_reports_text_box.text(system_report::to_xml());
xml_reports_text_box.word_wrap(false);
}
private:
tab_control report_tab_control;
tab_page text_report_tab_page;
tab_page json_report_tab_page;
tab_page xml_report_tab_page;
text_box text_reports_text_box;
text_box json_reports_text_box;
text_box xml_reports_text_box;
};
auto main() -> int {
application::run(main_form());
}
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Manages a related set of tab pages.
Definition tab_control.hpp:39
Represents a single tab page in a tab_control.
Definition tab_page.hpp:33
Represents a standard Windows text box.
Definition text_box.hpp:31
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10