xtd 1.0.0
Loading...
Searching...
No Matches
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 xtd::forms::control {
35 struct data;
36
37 public:
39
41 picture_box();
43
45
49 [[nodiscard]] virtual auto border_sides() const noexcept -> xtd::forms::border_sides;
52 virtual auto border_sides(xtd::forms::border_sides border_sides) -> picture_box&;
53
57 [[nodiscard]] virtual auto border_style() const noexcept -> xtd::forms::border_style;
62 virtual auto border_style(forms::border_style value) -> picture_box&;
67 virtual auto border_style(xtd::null_ptr) -> picture_box&;
68
72 [[nodiscard]] virtual auto image() const noexcept -> std::optional<xtd::drawing::image>;
77 virtual auto image(const xtd::drawing::image& value) -> picture_box&;
82 virtual auto image(xtd::null_ptr) -> picture_box&;
83
87 [[nodiscard]] auto size_mode() const noexcept -> xtd::forms::picture_box_size_mode;
92 auto size_mode(xtd::forms::picture_box_size_mode value) -> picture_box&;
94
96
100 [[nodiscard]] static auto create() -> picture_box;
104 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> picture_box;
109 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> picture_box;
115 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> picture_box;
119 [[nodiscard]] static auto create(const xtd::drawing::image& image) -> picture_box;
124 [[nodiscard]] static auto create(const xtd::drawing::image& image, const xtd::drawing::point& location) -> picture_box;
130 [[nodiscard]] static auto create(const xtd::drawing::image& image, const xtd::drawing::point& location, const xtd::drawing::size& size) -> picture_box;
137 [[nodiscard]] static auto create(const xtd::drawing::image& image, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> picture_box;
142 [[nodiscard]] static auto create(const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode) -> picture_box;
148 [[nodiscard]] static auto create(const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode, const xtd::drawing::point& location) -> picture_box;
155 [[nodiscard]] static auto create(const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode, const xtd::drawing::point& location, const xtd::drawing::size& size) -> picture_box;
163 [[nodiscard]] static auto create(const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> picture_box;
167 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> picture_box;
172 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> picture_box;
178 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> picture_box;
185 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> picture_box;
190 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image) -> picture_box;
196 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, const xtd::drawing::point& location) -> picture_box;
203 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, const xtd::drawing::point& location, const xtd::drawing::size& size) -> picture_box;
211 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> picture_box;
217 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode) -> picture_box;
224 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode, const xtd::drawing::point& location) -> picture_box;
232 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode, const xtd::drawing::point& location, const xtd::drawing::size& size) -> picture_box;
241 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::image& image, xtd::forms::picture_box_size_mode size_mode, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> picture_box;
243
244 protected:
246
248 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
250
251 protected:
253
255 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
256
259 auto on_handle_created(const xtd::event_args& e) -> void override;
260 auto on_paint(xtd::forms::paint_event_args& e) -> void override;
262
263 private:
264 xtd::sptr<data> data_;
265 };
266 }
267}
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
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
auto on_handle_created(const xtd::event_args &e) -> void override
Overrides the on_handle_created(const event_args&) method.
virtual auto image() const noexcept -> std::optional< xtd::drawing::image >
Gets the image that is displayed by picture_box.
auto on_paint(xtd::forms::paint_event_args &e) -> void override
Raises the xtd::forms::control::paint event.
auto size_mode() const noexcept -> xtd::forms::picture_box_size_mode
Indicates how the image is displayed.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
static auto create() -> picture_box
A factory to create an xtd::forms::picture_box.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
virtual auto border_sides() const noexcept -> xtd::forms::border_sides
Gets the border sides for the control.
virtual auto border_style() const noexcept -> xtd::forms::border_style
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
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:26
picture_box_size_mode
Specifies how an image is positioned within a picture_box.
Definition picture_box_size_mode.hpp:22
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::picture_box_size_mode enum class.