xtd 0.2.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 virtual bool auto_ellipsis() const noexcept;
48
52 virtual button_base& auto_ellipsis(bool auto_ellipsis);
53
54 bool auto_size() const noexcept override;
55 control& auto_size(bool auto_size) override;
56
59
62 virtual const xtd::forms::flat_button_appearance& flat_appearance() const noexcept;
65 virtual xtd::forms::button_base& flat_appearance(const xtd::forms::flat_button_appearance& value);
66
69 virtual xtd::forms::flat_style flat_style() const noexcept;
73
78 virtual const drawing::image& image() const noexcept;
83 virtual button_base& image(const drawing::image& value);
84
87 virtual content_alignment image_align() const noexcept;
90 virtual button_base& image_align(content_alignment value);
91
97 virtual int32 image_index() const noexcept;
103 virtual button_base& image_index(int32 value);
104
107 virtual const forms::image_list& image_list() const noexcept;
110 virtual forms::image_list& image_list() noexcept;
113 virtual button_base& image_list(const forms::image_list& value);
114
117 virtual content_alignment text_align() const noexcept ;
120 virtual button_base& text_align(content_alignment value);
122
124
131
132 protected:
134
137 button_base() noexcept;
139
141
145 forms::create_params create_params() const noexcept override;
146
151 bool is_default() const noexcept;
156 button_base& is_default(bool value);
158
160
165 drawing::size measure_control() const noexcept override;
166
167 void on_back_color_changed(const event_args& e) override;
168 void on_enabled_changed(const event_args& e) override;
169 void on_font_changed(const xtd::event_args& e) override;
170 void on_fore_color_changed(const event_args& e) override;
171
174 virtual void on_image_changed(const xtd::event_args& e);
175
176 void on_mouse_down(const mouse_event_args& e) override;
177 void on_mouse_enter(const event_args& e) override;
178 void on_mouse_leave(const event_args& e) override;
179 void on_mouse_up(const mouse_event_args& e) override;
180 void on_parent_back_color_changed(const event_args& e) override;
181 void on_parent_fore_color_changed(const event_args& e) override;
182 void on_resize(const xtd::event_args& e) override;
183 void on_text_changed(const xtd::event_args& e) override;
185
187 xtd::drawing::rectangle compute_image_bounds();
188 xtd::drawing::rectangle compute_image_bounds(const xtd::drawing::rectangle& rectangle);
189 text_format_flags to_text_format_flags(content_alignment text_align);
191
192 private:
193 xtd::sptr<data> data_;
194 };
195 }
196}
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:21
Implements the basic functionality common to button controls.
Definition button_base.hpp:37
virtual bool auto_ellipsis() const noexcept
Gets a value indicating whether the ellipsis character (...) appears at the right edge of the control...
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
Encapsulates the information needed when creating a control.
Definition create_params.hpp:29
Provides properties that specify the appearance of xtd::forms::button controls whose xtd::forms::flat...
Definition flat_button_appearance.hpp:24
Provides methods to manage a collection of xtd::drawing::image objects. This class cannot be inherite...
Definition image_list.hpp:30
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.hpp:34
Contains xtd::forms::flat_button_appearance class.
Contains xtd::forms::flat_style enum class.
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:32
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
text_format_flags
Specifies the display and layout information for text strings.
Definition text_format_flags.hpp:22
control_appearance
Specifies the appearance of a control.
Definition control_appearance.hpp:21
flat_style
Specifies the appearance of a control.
Definition flat_style.hpp:24
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.hpp:21
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::forms::text_format_flags enum class.
Contains xtd::forms::content_alignment enum class.
Contains xtd::forms::image_list component.
Contains xtd::forms::style_sheets::control class.