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 {
38 struct data;
39
40 public:
42
47
49 choice(choice&& rhs);
50 choice(const choice&) = default;
51 choice& operator =(const choice&) = default;
53
55
63 const object_collection& items() const noexcept;
66 const choice& items(const object_collection& items);
67
68 using list_control::selected_index;
71 list_control& selected_index(size_t selected_index) override;
72
75 const item& selected_item() const noexcept;
78 choice& selected_item(const item& selected_item);
79
83 virtual bool sorted() const noexcept;
87 virtual choice& sorted(bool sorted);
88
89 using list_control::text;
92 control& text(const xtd::string& text) override;
94
96
100 void begin_update();
101
104 void end_update();
106
108
112 static choice create();
116 static choice create(const drawing::point& location);
121 static choice create(const drawing::point& location, const drawing::size& size);
127 static choice create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
131 static choice create(const object_collection& items);
136 static choice create(const object_collection& items, const drawing::point& location);
142 static choice create(const object_collection& items, const drawing::point& location, const drawing::size& size);
149 static choice create(const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::string& name);
154 static choice create(const object_collection& items, size_t selected_index);
160 static choice create(const object_collection& items, size_t selected_index, const drawing::point& location);
167 static choice create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
175 static choice create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::string& name);
179 static choice create(const control& parent);
184 static choice create(const control& parent, const drawing::point& location);
190 static choice create(const control& parent, const drawing::point& location, const drawing::size& size);
197 static choice create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
202 static choice create(const control& parent, const object_collection& items);
208 static choice create(const control& parent, const object_collection& items, const drawing::point& location);
215 static choice create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size);
223 static choice create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::string& name);
229 static choice create(const control& parent, const object_collection& items, size_t selected_index);
236 static choice create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location);
244 static choice create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
253 static choice create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::string& name);
255
256 protected:
258
260 forms::create_params create_params() const noexcept override;
262
264
270 xtd::uptr<xtd::object> clone() const override;
271
272 void on_handle_created(const event_args& e) override;
273 void on_selected_value_changed(const event_args& e) override;
274 void set_bounds_core(int32 x, int32 y, int32 width, int32 height, bounds_specified specified) override;
275 void set_client_size_core(int32 width, int32 height) override;
276 void wnd_proc(message& message) override;
278
279 private:
280 void on_items_item_added(size_t pos, const item& item);
281 void on_items_item_removed(size_t pos, const item& item);
282 void on_items_item_updated(size_t pos, const item& item);
283 void wm_command_control(message& message);
284 void wm_mouse_double_click(message& message);
285 void wm_mouse_down(message& message);
286 void wm_mouse_up(message& message);
287
288 xtd::sptr<data> data_;
289 };
290 }
291}
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:37
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:81
Encapsulates the information needed when creating a control.
Definition create_params.h:29
Represents a collection of objects.
Definition arranged_element_collection.h:34
Represent an item contained in the list_control::object_collection collection.
Definition list_control.h:32
Provides a common implementation of members for the list_box, choice and combo_box classes.
Definition list_control.h:27
Implements a Windows message.
Definition message.h:28
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25
size_t size
Represents a size of any object in bytes.
Definition size.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
bounds_specified
Specifies the bounds of the control to use when defining a control's size and position....
Definition bounds_specified.h:22
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