xtd 0.2.0
picture_box.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "border_sides.hpp"
6#include "border_style.hpp"
7#include "control.hpp"
9#include <xtd/drawing/image>
10#include <xtd/optional>
11
13namespace xtd {
15 namespace forms {
34 class forms_export_ picture_box : public control {
35 struct data;
36
37 public:
39
41 picture_box();
43
45
49 virtual forms::border_sides border_sides() const noexcept;
53
57 virtual forms::border_style border_style() const noexcept;
67 virtual picture_box& border_style(std::nullptr_t);
68
72 std::optional<drawing::image> image() const noexcept;
77 picture_box& image(const drawing::image& image);
82 picture_box& image(std::nullptr_t);
83
94
96
100 static picture_box create();
104 static picture_box create(const drawing::point& location);
109 static picture_box create( const drawing::point& location, const drawing::size& size);
115 static picture_box create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
119 static picture_box create(const xtd::drawing::image& image);
124 static picture_box create(const xtd::drawing::image& image, const drawing::point& location);
130 static picture_box create(const xtd::drawing::image& image, const drawing::point& location, const drawing::size& size);
137 static picture_box create(const xtd::drawing::image& image, const drawing::point& location, const drawing::size& size, const xtd::string& name);
141 static picture_box create(const control& parent);
146 static picture_box create(const control& parent, const drawing::point& location);
152 static picture_box create(const control& parent, const drawing::point& location, const drawing::size& size);
159 static picture_box create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
164 static picture_box create(const control& parent, const xtd::drawing::image& image);
170 static picture_box create(const control& parent, const xtd::drawing::image& image, const drawing::point& location);
177 static picture_box create(const control& parent, const xtd::drawing::image& image, const drawing::point& location, const drawing::size& size);
185 static picture_box create(const control& parent, const xtd::drawing::image& image, const drawing::point& location, const drawing::size& size, const xtd::string& name);
187
188 protected:
190
192 forms::create_params create_params() const noexcept override;
194
195 protected:
197
203 xtd::uptr<xtd::object> clone() const override;
204
205 drawing::size measure_control() const noexcept override;
206
209 void on_handle_created(const event_args& e) override;
210 void on_paint(paint_event_args& e) override;
212
213 private:
214 xtd::sptr<data> data_;
215 };
216 }
217}
Contains xtd::forms::border_sides enum class.
Contains xtd::forms::border_style enum class.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
virtual drawing::point location() const noexcept
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
virtual const xtd::string & name() const noexcept
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual drawing::size size() const noexcept
Gets the height and width of the control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
picture_box_size_mode size_mode() const noexcept
Indicates how the image is displayed.
virtual forms::border_sides border_sides() const noexcept
Gets the border sides for the control.
void on_paint(paint_event_args &e) override
Raises the xtd::forms::control::paint event.
static picture_box create()
A factory to create an xtd::forms::picture_box.
std::optional< drawing::image > image() const noexcept
Gets the image that is displayed by picture_box.
drawing::size measure_control() const noexcept override
Measure this control.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
void on_handle_created(const event_args &e) override
Overrides the on_handle_created(const event_args&) method.
forms::create_params create_params() const noexcept override
Gets the required creation parameters when the control handle is created.
virtual forms::border_style border_style() const noexcept
Gets the border style for the control.
Contains xtd::forms::control control.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:25
picture_box_size_mode
Specifies how an image is positioned within a picture_box.
Definition picture_box_size_mode.hpp:22
border_sides
Specifies how a control anchors to the edges of its container.
Definition border_sides.hpp:23
@ e
The E key.
Definition keys.hpp:207
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:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::forms::picture_box_size_mode enum class.