xtd 0.2.0
control.cpp

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

Windows

macOS

Gnome

#include <xtd/drawing/colors>
#include <xtd/forms/application>
#include <xtd/forms/control>
#include <xtd/forms/form>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace control_example {
class form1 : public form {
public:
form1() {
text("Control example");
control1.parent(*this);
control1.cursor(cursors::hand());
control1.back_color(colors::spring_green());
control1.location({50, 50});
control1.size({100, 50});
control1.click += [&] {
control1.back_color(control1.back_color() == colors::spring_green() ? colors::orange_red() : colors::spring_green());
};
}
private:
control control1;
};
}
auto main() -> int {
application::run(control_example::form1 {});
}
static xtd::drawing::color orange_red() noexcept
A system-defined color object.
static xtd::drawing::color spring_green() noexcept
A system-defined color object.
static void run()
Begins running a standard application message loop on the current thread, without a form.
static cursor hand()
Gets the hand cursor, typically used when hovering over a Web link.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
@ control
The left or right CTRL modifier key.
Definition console_modifiers.hpp:28
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