#include <xtd/drawing/drawing_2d/radial_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() {
start_position(form_start_position::manual);
client_size({200, 200});
double_buffered(true);
location({screen::from_control(*this).working_area().left() + screen::from_control(*this).working_area().width() / 2 - client_size().width() / 2, screen::from_control(*this).working_area().bottom() - client_size().height()});
top_most(true);
path.add_ellipse(client_rectangle());
auto gradient_color1 = color::from_argb(0xBC, 0, 0);
auto gradient_color2 = color::from_argb(0xFF, 0xAA, 0x7E);
};
mouse_location = e.location();
};
mouse_location = point::empty;
cursor(cursors::default_cursor());
};
if (mouse_location == point::empty) return;
auto working_area = screen::from_control(*this).working_area();
auto new_bounds = bounds();
new_bounds.location(new_bounds.location() + e.location() - mouse_location);
if (new_bounds.left() < working_area.left()) new_bounds.location({working_area.left(), new_bounds.top()});
if (new_bounds.top() < working_area.top()) new_bounds.location({new_bounds.left(), working_area.top()});
if (new_bounds.left() + new_bounds.width() > working_area.right()) new_bounds.location({working_area.right() - new_bounds.width(), new_bounds.top()});
if (new_bounds.top() + new_bounds.height() > working_area.bottom()) new_bounds.location({new_bounds.left(), working_area.bottom() - new_bounds.height()});
bounds(new_bounds);
};
}
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 radial gradient. This class cannot be inherited.
Definition radial_gradient_brush.h:30
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:175
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 brush.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10