xtd 1.0.0
Loading...
Searching...
No Matches
combo_box.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "combo_box_style.hpp"
7#include "list_control.hpp"
8
10namespace xtd {
12 namespace forms {
37 struct data;
38
39 public:
41
46
48
52 [[nodiscard]] auto dropped_down() const noexcept -> bool;
56 auto dropped_down(bool value) -> combo_box&;
57
61 [[nodiscard]] auto drop_down_style() const noexcept -> combo_box_style;
66
70 [[nodiscard]] auto items() noexcept -> object_collection&;
73 auto items() const noexcept -> const object_collection&;
77 [[nodiscard]] auto items(const object_collection& value) -> const combo_box&;
78
83 auto selected_index(xtd::usize value) -> list_control& override;
84
87 [[nodiscard]] auto selected_item() const noexcept -> const item&;
91 auto selected_item(const item& value) -> combo_box&;
92
96 [[nodiscard]] virtual auto sorted() const noexcept -> bool;
101 virtual auto sorted(bool value) -> combo_box&;
102
103 using xtd::forms::list_control::text;
106 auto text(const xtd::string& value) -> xtd::forms::control& override;
108
110
114 auto begin_update() -> void;
115
118 auto end_update() -> void;
120
122
126 [[nodiscard]] static auto create() -> combo_box;
130 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> combo_box;
135 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> combo_box;
141 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> combo_box;
145 [[nodiscard]] static auto create(const object_collection& items) -> combo_box;
150 [[nodiscard]] static auto create(const object_collection& items, const xtd::drawing::point& location) -> combo_box;
156 [[nodiscard]] static auto create(const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size) -> combo_box;
163 [[nodiscard]] static auto create(const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> combo_box;
168 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index) -> combo_box;
174 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location) -> combo_box;
181 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size) -> combo_box;
189 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> combo_box;
193 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> combo_box;
198 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> combo_box;
204 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> combo_box;
211 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> combo_box;
216 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items) -> combo_box;
222 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, const xtd::drawing::point& location) -> combo_box;
229 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size) -> combo_box;
237 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> combo_box;
243 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, xtd::usize selected_index) -> combo_box;
250 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location) -> combo_box;
258 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size) -> combo_box;
267 [[nodiscard]] static auto create(const xtd::forms::control& parent, const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> combo_box;
269
271
283
284 protected:
286
288 [[nodiscard]] xtd::forms::create_params create_params() const noexcept override;
290
292
298 virtual auto on_drop_down(const event_args& e) -> void;
299
303 virtual auto on_drop_down_closed(const event_args& e) -> void;
304
309 virtual auto on_drop_down_style_changed(const event_args& e) -> void;
310
311 auto on_handle_created(const event_args& e) -> void override;
312 auto on_selected_value_changed(const event_args& e) -> void override;
313 auto wnd_proc(message& message) -> void override;
315
316 private:
317 auto wm_command_control(message& message) -> void;
318 auto wm_command_control_selchange(message& message) -> void;
319 auto wm_mouse_double_click(message& message) -> void;
320 auto wm_mouse_down(message& message) -> void;
321 auto wm_mouse_up(message& message) -> void;
322
323 xtd::sptr<data> data_;
324 };
325 }
326}
Contains xtd::forms::layout::arranged_element_collection collection.
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
auto end_update() -> void
Resumes painting the combo_box control after painting is suspended by the begin_update method.
auto items() noexcept -> object_collection &
Gets an object representing the collection of the items contained in this combo_box....
xtd::forms::create_params create_params() const noexcept override
Gets the required creation parameters when the control handle is created.
virtual auto on_drop_down_closed(const event_args &e) -> void
Raises the xtd::forms::combo_box::drop_down_closed event.
auto selected_index(xtd::usize value) -> list_control &override
When overridden in a derived class, Sets the zero-based index of the currently selected item.
xtd::event< combo_box, xtd::event_handler > drop_down
Occurs when the drop-down portion of a xtd::forms::combo_box is shown.
Definition combo_box.hpp:275
virtual auto on_drop_down_style_changed(const event_args &e) -> void
Raises the xtd::forms::combo_box::drop_down_style_changed event.
auto text(const xtd::string &value) -> xtd::forms::control &override
Sets the text associated with this control.
auto begin_update() -> void
Maintains performance while items are added to the combo_box one at a time by preventing the control ...
combo_box()
Initializes a new instance of the combo_box class.
auto selected_item() const noexcept -> const item &
Gets currently selected item in the combo_box.
auto drop_down_style() const noexcept -> combo_box_style
Gets a value specifying the style of the combo box.
virtual auto on_drop_down(const event_args &e) -> void
Raises the xtd::forms::combo_box::drop_down event.
auto wnd_proc(message &message) -> void override
Processes Windows messages.
xtd::event< combo_box, xtd::event_handler > drop_down_closed
Occurs when the drop-down portion of the xtd::forms::combo_box is no longer visible.
Definition combo_box.hpp:278
static auto create() -> combo_box
A factory to create an xtd::forms::combo_box.
xtd::event< combo_box, xtd::event_handler > drop_down_style_changed
Occurs when the drop_down_style property has changed.
Definition combo_box.hpp:281
auto dropped_down() const noexcept -> bool
Gets a value indicating whether the combo box is displaying its drop-down portion.
virtual auto sorted() const noexcept -> bool
Gets a value indicating whether the items in the combo_box are sorted alphabetically.
auto on_handle_created(const event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
auto on_selected_value_changed(const event_args &e) -> void override
Raises the list_control::selected_value_changed event.
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Represent an item contained in the list_control::object_collection collection.
Definition list_control.hpp:32
Provides a common implementation of members for the list_box, choice and combo_box classes.
Definition list_control.hpp:27
xtd::forms::layout::arranged_element_collection< item, item::sorter > object_collection
Represents the collection of items in a list_control.
Definition list_control.hpp:128
list_control()
Initializes a new instance of the list_control class.
Contains xtd::forms::combo_box_style enum class.
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
#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
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
combo_box_style
Specifies the combo_box style.
Definition combo_box_style.hpp:24
Contains xtd::forms::list_control control.
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Implements a Windows message.
Definition message.hpp:33