xtd 1.0.0
Loading...
Searching...
No Matches
button_base.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "control.hpp"
7#include "image_list.hpp"
9#include "flat_style.hpp"
10#include "text_format_flags.hpp"
11#include <xtd/drawing/image>
12
14namespace xtd {
16 namespace forms {
38 struct data;
39
40 public:
42
47 [[nodiscard]] virtual auto auto_ellipsis() const noexcept -> bool;
51 virtual auto auto_ellipsis(bool auto_ellipsis) -> button_base&;
52
53 [[nodiscard]] bool auto_size() const noexcept override;
54 auto auto_size(bool auto_size) -> control& override;
55
58
61 [[nodiscard]] virtual auto flat_appearance() const noexcept -> const xtd::forms::flat_button_appearance&;
65
68 [[nodiscard]] virtual auto flat_style() const noexcept -> xtd::forms::flat_style;
71 virtual auto flat_style(xtd::forms::flat_style value) -> button_base&;
72
77 [[nodiscard]] virtual auto image() const noexcept -> const xtd::drawing::image&;
82 virtual auto image(const xtd::drawing::image& value) -> button_base&;
83
86 [[nodiscard]] virtual auto image_align() const noexcept -> xtd::forms::content_alignment;
90
96 [[nodiscard]] virtual auto image_index() const noexcept -> xtd::int32;
102 virtual auto image_index(xtd::int32 value) -> button_base&;
103
106 [[nodiscard]] virtual auto image_list() const noexcept -> const xtd::forms::image_list&;
109 [[nodiscard]] virtual auto image_list() noexcept -> xtd::forms::image_list&;
112 virtual auto image_list(const xtd::forms::image_list& value) -> button_base&;
113
116 [[nodiscard]] virtual auto text_align() const noexcept -> xtd::forms::content_alignment;
121
123
130
131 protected:
133
136 button_base() noexcept;
138
140
144 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
145
150 [[nodiscard]] auto is_default() const noexcept -> bool;
155 auto is_default(bool value) -> button_base&;
157
159
164 [[nodiscard]] auto measure_control() const noexcept -> xtd::drawing::size override;
165
166 auto on_back_color_changed(const event_args& e) -> void override;
167 auto on_enabled_changed(const event_args& e) -> void override;
168 auto on_font_changed(const xtd::event_args& e) -> void override;
169 auto on_fore_color_changed(const event_args& e) -> void override;
170
173 virtual auto on_image_changed(const xtd::event_args& e) -> void;
174
175 auto on_mouse_down(const mouse_event_args& e) -> void override;
176 auto on_mouse_enter(const event_args& e) -> void override;
177 auto on_mouse_leave(const event_args& e) -> void override;
178 auto on_mouse_up(const mouse_event_args& e) -> void override;
179 auto on_parent_back_color_changed(const event_args& e) -> void override;
180 auto on_parent_fore_color_changed(const event_args& e) -> void override;
181 auto on_resize(const xtd::event_args& e) -> void override;
182 auto on_text_changed(const xtd::event_args& e) -> void override;
184
186 [[nodiscard]] auto compute_image_bounds() -> xtd::drawing::rectangle;
187 [[nodiscard]] auto compute_image_bounds(const xtd::drawing::rectangle& rectangle) -> xtd::drawing::rectangle;
188 [[nodiscard]] auto to_text_format_flags(xtd::forms::content_alignment text_align) -> xtd::forms::text_format_flags;
190
191 private:
192 xtd::sptr<data> data_;
193 };
194 }
195}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Represents an event.
Definition event.hpp:23
auto on_fore_color_changed(const event_args &e) -> void override
Raises the xtd::forms::control::fore_color_changed event.
auto on_mouse_down(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_down event.
auto on_resize(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::region event.
virtual auto image_index() const noexcept -> xtd::int32
Gets the image list index value of the image displayed on the button control.
virtual auto image_align() const noexcept -> xtd::forms::content_alignment
Gets the alignment of the image on the button control.
virtual auto auto_ellipsis() const noexcept -> bool
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the control...
virtual auto flat_style() const noexcept -> xtd::forms::flat_style
Gets the flat style appearance of the button control.
virtual auto flat_appearance() const noexcept -> const xtd::forms::flat_button_appearance &
Gets the appearance of the border and the colors used to indicate check state and mouse state.
auto on_parent_back_color_changed(const event_args &e) -> void override
Raises the xtd::forms::control::parent_back_color_changed event.
auto measure_control() const noexcept -> xtd::drawing::size override
Measure this control.
event< button_base, event_handler > image_changed
Occurs when the value of the image property changes.
Definition button_base.hpp:128
auto on_back_color_changed(const event_args &e) -> void override
Raises the xtd::forms::control::back_color_changed event.
button_base() noexcept
Initializes a new instance of the ButtonBase class.
virtual auto image_list() const noexcept -> const xtd::forms::image_list &
Gets the image_list that contains the image displayed on a button control.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
auto on_mouse_leave(const event_args &e) -> void override
Raises the xtd::forms::control::mouse_leave event.
auto on_parent_fore_color_changed(const event_args &e) -> void override
Raises the xtd::forms::control::parent_fore_color_changed event.
bool auto_size() const noexcept override
Gets a value that indicates whether the control resizes based on its contents.
auto on_font_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::font_changed event.
virtual auto text_align() const noexcept -> xtd::forms::content_alignment
Gets the alignment of the text on the button control.
auto on_mouse_enter(const event_args &e) -> void override
Raises the xtd::forms::control::mouse_enter event.
auto is_default() const noexcept -> bool
Gets a value indicating whether the button control is the default button.
virtual auto on_image_changed(const xtd::event_args &e) -> void
Raises the button_base::image_changed event.
auto control_appearance(xtd::forms::control_appearance value) -> control &override
Sets control appearance.
auto on_mouse_up(const mouse_event_args &e) -> void override
Raises the xtd::forms::control::mouse_up event.
virtual auto image() const noexcept -> const xtd::drawing::image &
Gets the image that is displayed on a button control.
auto on_text_changed(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::text_changed event.
auto on_enabled_changed(const event_args &e) -> void override
Raises the xtd::forms::control::enabled_changed event.
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.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
Provides properties that specify the appearance of xtd::forms::button controls whose xtd::forms::flat...
Definition flat_button_appearance.hpp:24
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.hpp:34
Contains xtd::forms::content_alignment enum class.
Contains xtd::forms::control control.
Contains xtd::forms::flat_button_appearance class.
Contains xtd::forms::flat_style enum class.
generic_event_handler< const xtd::event_args & > event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:24
#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::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
text_format_flags
Specifies the display and layout information for text strings.
Definition text_format_flags.hpp:22
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.hpp:21
Contains xtd::forms::image_list component.
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::text_format_flags enum class.