xtd 0.2.0
Loading...
Searching...
No Matches
button_base.h
Go to the documentation of this file.
1
4#pragma once
5#include "control.h"
6#include "content_alignment.h"
7#include "image_list.h"
9#include "flat_style.h"
10#include "text_format_flags.h"
11#include <xtd/drawing/image>
12
14namespace xtd {
16 namespace forms {
36 struct data;
37
38 public:
40
45 virtual bool auto_ellipsis() const noexcept;
46
50 virtual button_base& auto_ellipsis(bool auto_ellipsis);
51
52 bool auto_size() const noexcept override;
53 control& auto_size(bool auto_size) override;
54
57
60 virtual const xtd::forms::flat_button_appearance& flat_appearance() const noexcept;
63 virtual xtd::forms::button_base& flat_appearance(const xtd::forms::flat_button_appearance& value);
64
67 virtual xtd::forms::flat_style flat_style() const noexcept;
71
76 virtual const drawing::image& image() const noexcept;
81 virtual button_base& image(const drawing::image& value);
82
85 virtual content_alignment image_align() const noexcept;
88 virtual button_base& image_align(content_alignment value);
89
95 virtual int32 image_index() const noexcept;
101 virtual button_base& image_index(int32 value);
102
105 virtual const forms::image_list& image_list() const noexcept;
108 virtual forms::image_list& image_list() noexcept;
111 virtual button_base& image_list(const forms::image_list& value);
112
115 virtual content_alignment text_align() const noexcept ;
118 virtual button_base& text_align(content_alignment value);
120
122
129
130 protected:
132
135 button_base() noexcept;
137
139
143 forms::create_params create_params() const noexcept override;
144
149 bool is_default() const noexcept;
154 button_base& is_default(bool value);
156
158
163 drawing::size measure_control() const noexcept override;
164
165 void on_back_color_changed(const event_args& e) override;
166 void on_enabled_changed(const event_args& e) override;
167 void on_font_changed(const xtd::event_args& e) override;
168 void on_fore_color_changed(const event_args& e) override;
169
172 virtual void on_image_changed(const xtd::event_args& e);
173
174 void on_mouse_down(const mouse_event_args& e) override;
175 void on_mouse_enter(const event_args& e) override;
176 void on_mouse_leave(const event_args& e) override;
177 void on_mouse_up(const mouse_event_args& e) override;
178 void on_parent_back_color_changed(const event_args& e) override;
179 void on_parent_fore_color_changed(const event_args& e) override;
180 void on_resize(const xtd::event_args& e) override;
181 void on_text_changed(const xtd::event_args& e) override;
183
185 xtd::drawing::rectangle compute_image_bounds();
186 xtd::drawing::rectangle compute_image_bounds(const xtd::drawing::rectangle& rectangle);
187 text_format_flags to_text_format_flags(content_alignment text_align);
189
190 private:
191 std::shared_ptr<data> data_;
192 };
193 }
194}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents an event.
Definition event.h:21
Implements the basic functionality common to button controls.
Definition button_base.h:35
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.h:79
Encapsulates the information needed when creating a control.
Definition create_params.h:27
Provides properties that specify the appearance of xtd::forms::button controls whose xtd::forms::flat...
Definition flat_button_appearance.h:22
Provides methods to manage a collection of xtd::drawing::image objects. This class cannot be inherite...
Definition image_list.h:28
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.h:32
Contains xtd::forms::content_alignment enum class.
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.h:32
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
size_t size
Represents a size of any object in bytes.
Definition types.h:197
text_format_flags
Specifies the display and layout information for text strings.
Definition text_format_flags.h:20
control_appearance
Specifies the appearance of a control.
Definition control_appearance.h:19
flat_style
Specifies the appearance of a control.
Definition flat_style.h:22
content_alignment
Specifies alignment of content on the drawing surface.
Definition content_alignment.h:19
Contains xtd::forms::image_list component.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::style_sheets::control class.
Contains xtd::forms::text_format_flags enum class.