xtd 1.0.0
Loading...
Searching...
No Matches
text_box_base.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"
8#include <xtd/argument_out_of_range_exception>
9#include <xtd/bit_converter>
10
12namespace xtd {
14 namespace forms {
27 struct data;
28
29 public:
31
35 [[nodiscard]] virtual auto accepts_tab() const noexcept -> bool;
39 virtual auto accepts_tab(bool value) -> text_box_base&;
40
43 [[nodiscard]] virtual auto border_sides() const noexcept -> xtd::forms::border_sides;
46 virtual auto border_sides(xtd::forms::border_sides value) -> text_box_base&;
47
50 [[nodiscard]] virtual auto border_style() const noexcept -> xtd::forms::border_style;
54 virtual auto border_style(xtd::forms::border_style value) -> text_box_base&;
60
64 [[nodiscard]] virtual auto lines() const noexcept -> xtd::array<xtd::string>;
69 virtual auto lines(const xtd::array<xtd::string>& value) -> text_box_base&;
70
74 [[nodiscard]] virtual auto multiline() const noexcept -> bool;
79 virtual auto multiline(bool value) -> text_box_base&;
80
84 [[nodiscard]] virtual auto read_only() const noexcept -> bool;
89 virtual auto read_only(bool value) -> text_box_base&;
90
94 [[nodiscard]] virtual auto selection_length() const noexcept -> xtd::usize;
99 virtual auto selection_length(xtd::usize value) -> text_box_base&;
100
104 [[nodiscard]] virtual auto selection_start() const noexcept -> xtd::usize;
109 virtual auto selection_start(xtd::usize value) -> text_box_base&;
110
113 [[nodiscard]] virtual auto word_wrap() const noexcept -> bool;
117 virtual auto word_wrap(bool value) -> text_box_base&;
119
121
125 virtual auto append_text(const xtd::string& text) -> void;
126
129 auto clear() -> void;
130
135 virtual auto select(xtd::usize start, xtd::usize length) -> void;
136
139 auto select_all() -> void;
141
143
148
152
156
161
162 protected:
164
169
171
173 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
174 [[nodiscard]] auto default_cursor() const noexcept -> xtd::forms::cursor override;
176
178
182 virtual auto on_accepts_tab_changed(const xtd::event_args& e) -> void;
183
186 virtual auto on_border_style_changed(const xtd::event_args& e) -> void;
187
190 virtual auto on_multiline_changed(const xtd::event_args& e) -> void;
191
194 virtual auto on_read_only_changed(const xtd::event_args& e) -> void;
196
197 private:
198 xtd::sptr<data> data_;
199 };
200 }
201}
Contains xtd::forms::border_sides enum class.
Contains xtd::forms::border_style enum class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
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
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto cursor() const noexcept -> xtd::forms::cursor
Gets the cursor that is displayed when the mouse pointer is over the control.
virtual auto border_style() const noexcept -> xtd::forms::border_style
Gets the border type of the text box control.
virtual auto selection_length() const noexcept -> xtd::usize
Gets the number of characters selected in the text box.
virtual auto append_text(const xtd::string &text) -> void
Appends text to the current text of a text box.
virtual auto on_accepts_tab_changed(const xtd::event_args &e) -> void
Raises the text_box_base::accepts_tab_changed event.
auto default_cursor() const noexcept -> xtd::forms::cursor override
Gets the default cursor for the control.
virtual auto select(xtd::usize start, xtd::usize length) -> void
Selects a range of text in the text box.
xtd::event< text_box_base, xtd::event_handler > accepts_tab_changed
Occurs when the value of the accepts_tab property has changed.
Definition text_box_base.hpp:147
virtual auto read_only() const noexcept -> bool
Gets a value indicating whether text in the text box is read-only.
virtual auto selection_start() const noexcept -> xtd::usize
Gets o the starting point of text selected in the text box.
auto clear() -> void
Clears all text from the text box control.
virtual auto on_multiline_changed(const xtd::event_args &e) -> void
Raises the text_box_base::text_box_base::multiline_changed event.
virtual auto multiline() const noexcept -> bool
Gets a value indicating whether this is a multiline text box control.
text_box_base()
initializes a new instance of the text_box_base class.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
virtual auto on_border_style_changed(const xtd::event_args &e) -> void
Raises the text_box_base::border_style_changed event.
virtual auto lines() const noexcept -> xtd::array< xtd::string >
Gets the lines of text in a text box control.
virtual auto border_sides() const noexcept -> xtd::forms::border_sides
Gets the border sides for the control.
xtd::event< text_box_base, xtd::event_handler > read_only_changed
Occurs when the value of the read_only property has changed.
Definition text_box_base.hpp:159
virtual auto word_wrap() const noexcept -> bool
Indicates whether a multiline text box control automatically wraps words to the beginning of the next...
virtual auto accepts_tab() const noexcept -> bool
Gets a value indicating whether pressing the TAB key in a multiline text box control types a TAB char...
auto select_all() -> void
Selects all text in the text box.
xtd::event< text_box_base, xtd::event_handler > multiline_changed
Occurs when the value of the accepts_tab border_style has changed.
Definition text_box_base.hpp:155
xtd::event< text_box_base, xtd::event_handler > border_style_changed
Occurs when the value of the accepts_tab border_style has changed.
Definition text_box_base.hpp:151
virtual auto on_read_only_changed(const xtd::event_args &e) -> void
Raises the text_box_base::read_only_changed event.
Contains xtd::forms::control control.
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
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::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
@ e
The E key.
Definition keys.hpp:207
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
constexpr auto length() const noexcept -> size_type
Returns the length of the current read_only_span.
Definition read_only_span.hpp:213