xtd 0.2.0
Loading...
Searching...
No Matches
text_box.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "border_style.hpp"
7#include "text_box_base.hpp"
8
10namespace xtd {
12 namespace forms {
32 struct data;
33
34 public:
36
41
43
48 virtual bool accepts_return() const noexcept;
53 virtual text_box& accepts_return(bool value);
54
58 virtual xtd::forms::character_casing character_casing() const noexcept;
64
69 virtual char32 password_char() const noexcept;
75 virtual text_box& password_char(char32 value);
76
79 const xtd::string& placeholder_text() const noexcept;
83 text_box& placeholder_text(const xtd::string& value);
84
85 using text_box_base::selection_length;
89 size_t selection_length() const noexcept override;
90
91 using text_box_base::selection_start;
95 size_t selection_start() const noexcept override;
96
97 const xtd::string& text() const noexcept override;
98 control& text(const xtd::string& text) override;
99
103 virtual bool use_system_password_char() const noexcept;
108 virtual text_box& use_system_password_char(bool value);
110
112
114 void append_text(const xtd::string& value) override;
115
116 void select(size_t start, size_t length) override;
118
120
124 static text_box create();
128 static text_box create(const drawing::point& location);
133 static text_box create(const drawing::point& location, const drawing::size& size);
139 static text_box create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
143 static text_box create(const xtd::string& text);
148 static text_box create(const xtd::string& text, const drawing::point& location);
154 static text_box create(const xtd::string& text, const drawing::point& location, const drawing::size& size);
161 static text_box create(const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
165 static text_box create(const control& parent);
170 static text_box create(const control& parent, const drawing::point& location);
176 static text_box create(const control& parent, const drawing::point& location, const drawing::size& size);
183 static text_box create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
188 static text_box create(const control& parent, const xtd::string& text);
194 static text_box create(const control& parent, const xtd::string& text, const drawing::point& location);
201 static text_box create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size);
209 static text_box create(const control& parent, const xtd::string& text, const drawing::point& location, const drawing::size& size, const xtd::string& name);
211
213
217 event<text_box, event_handler> accepts_return_changed;
219
220 protected:
222
224 forms::create_params create_params() const noexcept override;
225 drawing::color default_back_color() const noexcept override;
226 drawing::color default_fore_color() const noexcept override;
228
230
236 xtd::uptr<xtd::object> clone() const override;
237
238 drawing::size measure_control() const noexcept override;
239
242 virtual void on_accepts_return_changed(const event_args& e);
243
244 void on_handle_created(const event_args& e) override;
245 void on_text_changed(const event_args& e) override;
246
250 void wnd_proc(message& message) override;
252
254 void wm_key_char(message& message);
255 void wm_set_text(message& message);
257
258 private:
259 xtd::sptr<data> data_;
260 };
261 }
262}
Contains xtd::forms::character_casing enum class.
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
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
Implements a Windows message.
Definition message.hpp:28
Implements the basic functionality required by text controls.
Definition text_box_base.hpp:26
Represents a standard Windows text box.
Definition text_box.hpp:31
text_box()
initializes a new instance of the text_box class.
virtual bool accepts_return() const noexcept
Gets a value indicating whether pressing ENTER in a multiline text_box control creates a new line of ...
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
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:26
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
character_casing
Specifies the case of characters in a text_box control.
Definition character_casing.hpp:22
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::style_sheets::border_style class.
Contains xtd::forms::text_box_base control.