xtd 0.2.0
splitter.cpp

demonstrates the use of xtd::forms::splitter control.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/panel>
#include <xtd/forms/splitter>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace splitter_example {
class form1 : public form {
public:
form1() {
text("Splitter example");
client_size({300, 300});
controls().push_back_range({panel_fill, splitter_top, panel_top, splitter_right, panel_right, splitter_left, panel_left});
panel_left.dock(dock_style::left);
panel_left.back_color(drawing::color::light_blue);
panel_left.width(70);
splitter_left.dock(dock_style::left);
panel_right.dock(dock_style::right);
panel_right.back_color(drawing::color::light_yellow);
panel_right.width(70);
splitter_right.dock(dock_style::right);
panel_top.dock(dock_style::top);
panel_top.back_color(drawing::color::light_pink);
panel_top.height(150);
splitter_top.dock(dock_style::top);
panel_fill.dock(dock_style::fill);
panel_fill.back_color(drawing::color::light_green);
}
private:
panel panel_left;
splitter splitter_left;
panel panel_right;
splitter splitter_right;
panel panel_top;
splitter splitter_top;
panel panel_fill;
};
}
auto main() -> int {
application::run(splitter_example::form1 {});
}
static const xtd::drawing::color light_yellow
Gets a system-defined color that has an ARGB value of 0xFFFFFFE0. This field is constant.
Definition color.hpp:284
static const xtd::drawing::color light_blue
Gets a system-defined color that has an ARGB value of 0xFFADD8E6. This field is constant.
Definition color.hpp:248
static const xtd::drawing::color light_green
Gets a system-defined color that has an ARGB value of 0xFF90EE90. This field is constant.
Definition color.hpp:263
static const xtd::drawing::color light_pink
Gets a system-defined color that has an ARGB value of 0xFFFFB6C1. This field is constant.
Definition color.hpp:266
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.hpp:54
Used to group collections of controls.
Definition panel.hpp:32
Represents a splitter control that enables the user to resize docked controls.
Definition splitter.hpp:26
@ right
The control's right edge is docked to the right edge of its containing control.
Definition dock_style.hpp:33
@ left
The control's left edge is docked to the left edge of its containing control.
Definition dock_style.hpp:31
@ fill
All the control's edges are docked to the all edges of its containing control and sized appropriately...
Definition dock_style.hpp:35
@ top
The control's top edge is docked to the top of its containing control.
Definition dock_style.hpp:27
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8