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

demonstrates how to add custom tab page to xtd::forms::about_dialog dialog.

Windows

macOS

Gnome

#include <xtd/drawing/color_translator>
#include <xtd/drawing/system_images>
#include <xtd/forms/about_dialog>
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/tab_page>
using namespace xtd::drawing;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("About dialog with user pages example");
user_tab_page1.back_color(color::from_name(user_tab_page1.text()));
user_tab_page2.back_color(color::from_name(user_tab_page2.text()));
user_label1.text_align(content_alignment::middle_center).font({user_label1.font(), 32}).dock(dock_style::fill).fore_color(color::black);
user_label2.text_align(content_alignment::middle_center).font({user_label2.font(), 32}).dock(dock_style::fill).fore_color(color::black);
dialog.icon(system_images::from_name("symbolic", "contact-new", xtd::drawing::size {64, 64}));
dialog.name("User about dialog");
dialog.version("1.0");
dialog.long_version("1.0.0");
dialog.description("About dialog with user pages.");
dialog.copyright("Copyright (c) 2024 Gammasoft.\nAll rights reserved.");
dialog.website("https://gammasoft71.wixsite.com/gammasoft");
dialog.website_label("gammasoft website");
dialog.user_tab_pages().push_back_range({user_tab_page1, user_tab_page2});
button1.click += [&] {
dialog.show(*this);
};
}
private:
about_dialog dialog;
tab_page user_tab_page1 = tab_page::create("Dodger Blue");
tab_page user_tab_page2 = tab_page::create("Spring Green");
label user_label1 = label::create(user_tab_page1, color_translator::to_rgb(color::from_name(user_tab_page1.text())));
label user_label2 = label::create(user_tab_page2, color_translator::to_rgb(color::from_name(user_tab_page2.text())));
button button1 = button::create(*this, "About...", {10, 10});
};
auto main() -> int {
application::run(form1 {});
}
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Represents a dialog box that displays about dialog.
Definition about_dialog.h:40
Represents a Windows button control.
Definition button.h:49
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 single tab page in a tab_control.
Definition tab_page.h:33
control & text(const xtd::string &text) override
Sets the text associated with this control.
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition brush.h:18
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12