xtd 1.0.0
Loading...
Searching...
No Matches
choice.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "list_control.hpp"
7
9namespace xtd {
11 namespace forms {
38 struct data;
39
40 public:
42
47
49
54 [[nodiscard]] auto items() noexcept -> object_collection&;
57 [[nodiscard]] auto items() const noexcept -> const object_collection&;
60 auto items(const object_collection& value) -> const choice&;
61
65 auto selected_index(xtd::usize value) -> list_control& override;
66
69 [[nodiscard]] auto selected_item() const noexcept -> const item&;
72 auto selected_item(const item& value) -> choice&;
73
77 [[nodiscard]] virtual auto sorted() const noexcept -> bool;
81 virtual auto sorted(bool value) -> choice&;
82
83 using xtd::forms::list_control::text;
86 auto text(const xtd::string& value) -> control& override;
88
90
94 auto begin_update() -> void;
95
98 auto end_update() -> void;
100
102
106 [[nodiscard]] static auto create() -> choice;
110 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> choice;
115 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> choice;
121 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> choice;
125 [[nodiscard]] static auto create(const object_collection& items) -> choice;
130 [[nodiscard]] static auto create(const object_collection& items, const xtd::drawing::point& location) -> choice;
136 [[nodiscard]] static auto create(const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size) -> choice;
143 [[nodiscard]] static auto create(const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> choice;
148 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index) -> choice;
154 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location) -> choice;
161 [[nodiscard]] static auto create(const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size) -> choice;
169 [[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) -> choice;
173 [[nodiscard]] static auto create(const control& parent) -> choice;
178 [[nodiscard]] static auto create(const control& parent, const xtd::drawing::point& location) -> choice;
184 [[nodiscard]] static auto create(const control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> choice;
191 [[nodiscard]] static auto create(const control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> choice;
196 [[nodiscard]] static auto create(const control& parent, const object_collection& items) -> choice;
202 [[nodiscard]] static auto create(const control& parent, const object_collection& items, const xtd::drawing::point& location) -> choice;
209 [[nodiscard]] static auto create(const control& parent, const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size) -> choice;
217 [[nodiscard]] static auto create(const control& parent, const object_collection& items, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> choice;
223 [[nodiscard]] static auto create(const control& parent, const object_collection& items, xtd::usize selected_index) -> choice;
230 [[nodiscard]] static auto create(const control& parent, const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location) -> choice;
238 [[nodiscard]] static auto create(const control& parent, const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size) -> choice;
247 [[nodiscard]] static auto create(const control& parent, const object_collection& items, xtd::usize selected_index, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> choice;
249
250 protected:
252
254 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
256
258
260 auto on_handle_created(const event_args& e) -> void override;
261 auto on_selected_value_changed(const event_args& e) -> void override;
262 auto set_bounds_core(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, bounds_specified specified) -> void override;
263 auto set_client_size_core(xtd::int32 width, xtd::int32 height) -> void override;
264 auto wnd_proc(message& message) -> void override;
266
267 private:
268 auto wm_command_control(xtd::forms::message& message) -> void;
269 auto wm_mouse_double_click(xtd::forms::message& message) -> void;
270 auto wm_mouse_down(xtd::forms::message& message) -> void;
271 auto wm_mouse_up(xtd::forms::message& message) -> void;
272
273 xtd::sptr<data> data_;
274 };
275 }
276}
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
auto items() noexcept -> object_collection &
Gets an object representing the collection of the items contained in this choice.
auto selected_item() const noexcept -> const item &
Gets currently selected item in the choice.
auto on_handle_created(const event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
auto set_bounds_core(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, bounds_specified specified) -> void override
Performs the work of setting the specified bounds of this control.
auto begin_update() -> void
Maintains performance while items are added to the choice one at a time by preventing the control fro...
virtual auto sorted() const noexcept -> bool
Gets a value indicating whether the items in the choice are sorted.
auto on_selected_value_changed(const event_args &e) -> void override
Raises the list_control::selected_value_changed event.
auto set_client_size_core(xtd::int32 width, xtd::int32 height) -> void override
Sets the size of the client area of the control.
auto text(const xtd::string &value) -> control &override
Sets the text associated with this control.
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.
auto wnd_proc(message &message) -> void override
Processes Windows messages.
choice()
Initializes a new instance of the choice class.
auto end_update() -> void
Resumes painting the choice control after painting is suspended by the begin_update method.
static auto create() -> choice
A factory to create an xtd::forms::choice.
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 width() const noexcept -> xtd::int32
Gets the 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...
virtual auto height() const noexcept -> xtd::int32
Gets the height of the control.
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.
#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::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
bounds_specified
Specifies the bounds of the control to use when defining a control's size and position....
Definition bounds_specified.hpp:22
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