#include <xtd/drawing/drawing_2d/linear_gradient_brush>
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/startup>
class form_main :
public form {
public:
static auto main() {
application::run(form_main());
}
form_main() {
client_size({300, 300});
path.add_ellipse(client_rectangle());
e.graphics().fill_rectangle(
linear_gradient_brush(e.clip_rectangle(), {color::black, color::blue, color::black}, 90), e.clip_rectangle());
};
mouse_location = e.location();
cursor(cursors::no_move_2d());
};
mouse_location = point::empty;
cursor(cursors::default_cursor());
};
if (mouse_location != point::empty) location(location() + e.location() - mouse_location);
};
close_button.parent(*this);
close_button.location({client_size().width() / 2 - close_button.width() / 2, client_size().height() / 2 - close_button.height() / 2});
close_button.back_color(color::from_argb(32, color::white));
close_button.fore_color(color::dark_blue);
close_button.text("close");
close_button.click += [&] {
close();
};
}
private:
point mouse_location = point::empty;
};
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.h:35
Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited.
Definition linear_gradient_brush.h:31
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inh...
Definition region.h:32
#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::drawing_2d namespace provides advanced two-dimensional and vector graphics function...
Definition compositing_mode.h:12
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10