xtd 0.2.0
Loading...
Searching...
No Matches
choice.h
Go to the documentation of this file.
1
4#pragma once
6#include "list_control.h"
7
9namespace xtd {
11 namespace forms {
36 struct data;
37
38 public:
40
45
47 choice(choice&& rhs);
48 choice(const choice&) = default;
49 choice& operator =(const choice&) = default;
51
53
61 const object_collection& items() const noexcept;
64 const choice& items(const object_collection& items);
65
66 using list_control::selected_index;
69 list_control& selected_index(size_t selected_index) override;
70
73 const item& selected_item() const noexcept;
76 choice& selected_item(const item& selected_item);
77
81 virtual bool sorted() const noexcept;
85 virtual choice& sorted(bool sorted);
86
87 using list_control::text;
90 control& text(const xtd::ustring& text) override;
92
94
98 void begin_update();
99
102 void end_update();
104
106
110 static choice create();
114 static choice create(const drawing::point& location);
119 static choice create(const drawing::point& location, const drawing::size& size);
125 static choice create(const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
129 static choice create(const object_collection& items);
134 static choice create(const object_collection& items, const drawing::point& location);
140 static choice create(const object_collection& items, const drawing::point& location, const drawing::size& size);
147 static choice create(const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
152 static choice create(const object_collection& items, size_t selected_index);
158 static choice create(const object_collection& items, size_t selected_index, const drawing::point& location);
165 static choice create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
173 static choice create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
177 static choice create(const control& parent);
182 static choice create(const control& parent, const drawing::point& location);
188 static choice create(const control& parent, const drawing::point& location, const drawing::size& size);
195 static choice create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
200 static choice create(const control& parent, const object_collection& items);
206 static choice create(const control& parent, const object_collection& items, const drawing::point& location);
213 static choice create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size);
221 static choice create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
227 static choice create(const control& parent, const object_collection& items, size_t selected_index);
234 static choice create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location);
242 static choice create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
251 static choice create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
253
254 protected:
256
258 forms::create_params create_params() const noexcept override;
260
262
268 std::unique_ptr<xtd::object> clone() const override;
269
270 void on_handle_created(const event_args& e) override;
271 void on_selected_value_changed(const event_args& e) override;
272 void set_bounds_core(int32 x, int32 y, int32 width, int32 height, bounds_specified specified) override;
273 void set_client_size_core(int32 width, int32 height) override;
274 void wnd_proc(message& message) override;
276
277 private:
278 void on_items_item_added(size_t pos, const item& item);
279 void on_items_item_removed(size_t pos, const item& item);
280 void on_items_item_updated(size_t pos, const item& item);
281 void wm_command_control(message& message);
282 void wm_mouse_double_click(message& message);
283 void wm_mouse_down(message& message);
284 void wm_mouse_up(message& message);
285
286 std::shared_ptr<data> data_;
287 };
288 }
289}
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.h:18
Represents a choice control.
Definition choice.h:35
object_collection & items() noexcept
Gets an object representing the collection of the items contained in this choice.
choice()
Initializes a new instance of the choice class.
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
Encapsulates the information needed when creating a control.
Definition create_params.h:27
Represents a collection of objects.
Definition arranged_element_collection.h:32
Represent an item contained in the list_control::object_collection collection.
Definition list_control.h:30
Provides a common implementation of members for the list_box, choice and combo_box classes.
Definition list_control.h:25
Implements a Windows message.
Definition message.h:26
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
size_t size
Represents a size of any object in bytes.
Definition types.h:197
bounds_specified
Specifies the bounds of the control to use when defining a control's size and position....
Definition bounds_specified.h:20
Contains xtd::forms::list_control control.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10