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

demonstrates the use of xtd::forms::vertical_layout_panel container.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/panel>
#include <xtd/forms/vertical_layout_panel>
#include <xtd/drawing/colors>
#include <xtd/startup>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
class form_main : public form {
public:
form_main() {
text("Vertical layout panel example");
controls().push_back(layout_panel);
layout_panel.controls().push_back_range({light_pink_panel, light_green_panel, light_blue_panel, light_yellow_panel});
layout_panel.control_layout_style(light_pink_panel, {30, size_type::absolute, true});
layout_panel.control_layout_style(light_green_panel, {.70f, size_type::percent, true});
layout_panel.control_layout_style(light_blue_panel, {.15f, size_type::percent, true});
layout_panel.control_layout_style(light_yellow_panel, {size_type::auto_size, true});
layout_panel.dock(dock_style::fill);
layout_panel.padding(forms::padding(5));
light_pink_panel.back_color(colors::light_pink());
light_green_panel.back_color(colors::light_green());
light_blue_panel.back_color(colors::light_blue());
light_yellow_panel.back_color(colors::light_yellow());
}
static auto main() {
}
private:
vertical_layout_panel layout_panel;
panel light_pink_panel;
panel light_green_panel;
panel light_blue_panel;
panel light_yellow_panel;
};
startup_(form_main::main);
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:52
Represents a display device or multiple display devices on a single system.
Definition padding.h:23
Used to group collections of controls.
Definition panel.h:30
Used to group collections of vertically aligned controls.
Definition vertical_layout_panel.h:29
#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:166
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.h:11
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10