xtd 0.2.0
command_link_button.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "button_base.hpp"
6#include "dialog_result.hpp"
7#include "ibutton_control.hpp"
8#include "timer.hpp"
9#include <xtd/environment>
10#include <tuple>
11
13namespace xtd {
15 namespace forms {
40 struct data;
41
42 public:
44
50
52
56 virtual forms::auto_size_mode auto_size_mode() const noexcept;
60
63 virtual xtd::string& main_text() const noexcept;
67 virtual command_link_button& main_text(const xtd::string& value);
68
71 virtual xtd::string& supplementary_text() const noexcept;
75 virtual command_link_button& supplementary_text(const xtd::string& value);
76
79 xtd::string& text() const noexcept override;
84 xtd::forms::control& text(const xtd::string& value) override;
85
88 virtual std::tuple<xtd::string, xtd::string> texts() const noexcept;
93 virtual command_link_button& texts(const std::tuple<xtd::string, xtd::string>& texts);
95
97
104 void set_texts(const xtd::string& text, const xtd::string& supplementary_text);
105
112 [[deprecated("Replaced by xtd::forms::command_link_button::set_texts - Will be removed in version 0.4.0.")]]
113 control& texts(const xtd::string& text, const xtd::string& supplementary_text);
115
117
125 static command_link_button create(const xtd::string& text);
130 static command_link_button create(const xtd::string& text, const drawing::point& location);
136 static command_link_button create(const xtd::string& text, const drawing::point& location, const drawing::size& size);
143 static command_link_button create(const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
147 static command_link_button create(const std::tuple<xtd::string, xtd::string>& texts);
152 static command_link_button create(const std::tuple<xtd::string, xtd::string>& texts, const drawing::point& location);
158 static command_link_button create(const std::tuple<xtd::string, xtd::string>& texts, const drawing::point& location, const drawing::size& size);
165 static command_link_button create(const std::tuple<xtd::string, xtd::string>& texts, const drawing::point& location, const drawing::size& size, const xtd::string& name);
174 static command_link_button create(const control& parent, const xtd::string& text);
180 static command_link_button create(const control& parent, const xtd::string& text, const drawing::point& location);
187 static command_link_button create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size);
195 static command_link_button create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
200 static command_link_button create(const control& parent, const std::tuple<xtd::string, xtd::string>& texts);
206 static command_link_button create(const control& parent, const std::tuple<xtd::string, xtd::string>& texts, const drawing::point& location);
213 static command_link_button create(const control& parent, const std::tuple<xtd::string, xtd::string>& texts, const drawing::point& location, const drawing::size& size);
221 static command_link_button create(const control& parent, const std::tuple<xtd::string, xtd::string>& texts, const drawing::point& location, const drawing::size& size, const xtd::string& name);
223
224 protected:
226
228 forms::create_params create_params() const noexcept override;
230
232
238 xtd::uptr<xtd::object> clone() const override;
239
240 drawing::size measure_control() const noexcept override;
241 void on_handle_created(const event_args& e) override;
243
244 private:
245 xtd::sptr<data> data_;
246 };
247 }
248}
Contains xtd::forms::button_base class.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
button_base() noexcept
Initializes a new instance of the ButtonBase class.
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
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.
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.
Contains xtd::forms::dialog_result enum class.
#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
auto_size_mode
Specifies how a control will behave when its auto_size property is enabled.
Definition auto_size_mode.hpp:22
@ e
The E key.
Definition keys.hpp:207
Contains xtd::forms::ibutton_control interface.
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::timer component.