xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
screen.cpp

The following code example demonstrate the use of screen class.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd::forms;
int main() {
xtd::drawing::rectangle area = screen::primary_screen().working_area();
form form1;
form1.start_position(form_start_position::manual);
form1.location(area.location());
form1.size({area.size().width() / 2, area.size().height() / 2});
form1.text("screen 1/4");
form1.visible(true);
form form2;
form2.start_position(form_start_position::manual);
form2.location({area.location().x() + area.size().width() / 2, area.location().y()});
form2.size({area.size().width() / 2, area.size().height() / 2});
form2.text("screen 2/4");
form2.visible(true);
form form3;
form3.start_position(form_start_position::manual);
form3.location({area.location().x(), area.location().y() + area.size().height() / 2});
form3.size({area.size().width() / 2, area.size().height() / 2});
form3.text("screen 3/4");
form3.visible(true);
form form4;
form4.start_position(form_start_position::manual);
form4.location({area.location().x() + area.size().width() / 2, area.location().y() + area.size().height() / 2});
form4.size({area.size().width() / 2, area.size().height() / 2});
form4.text("screen 4/4");
form4.visible(true);
application::run(form1);
}
int32_t y() const
Gets the y-coordinate of this point.
Definition: point.h:205
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:25
int32_t width() const
Gets the horizontal component of this Size class.
Definition: size.h:67
int32_t height() const
Gets he vertical component of this Size Class.
Definition: size.h:57
virtual const xtd::ustring & text() const
Gets the text associated with this control.
Definition: control.h:650
virtual const drawing::size & size() const
Gets the height and width of the control.
Definition: control.h:620
virtual drawing::point location() const
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Definition: control.h:515
Represents a window or dialog box that makes up an application's user interface.
Definition: form.h:40
control & visible(bool visible) override
Sets a value indicating whether the control and all its child controls are displayed.
virtual form_start_position start_position() const
Gets the starting position of the form at run time.
Definition: form.h:187
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13