xtd 0.2.0
Loading...
Searching...
No Matches
combo_box.h
Go to the documentation of this file.
1
4#pragma once
6#include "combo_box_style.h"
7#include "list_control.h"
8
10namespace xtd {
12 namespace forms {
35 struct data;
36
37 public:
39
44
46 combo_box(combo_box&& rhs);
47 combo_box(const combo_box&) = default;
48 combo_box& operator =(const combo_box&) = default;
50
52
56 bool dropped_down() const noexcept;
60 combo_box& dropped_down(bool value);
61
65 combo_box_style drop_down_style() const noexcept;
69 combo_box& drop_down_style(combo_box_style drop_down_style);
70
74 object_collection& items() noexcept;
77 const object_collection& items() const noexcept;
81 const combo_box& items(const object_collection& items);
82
83 using list_control::selected_index;
87 list_control& selected_index(size_t selected_index) override;
88
91 const item& selected_item() const noexcept;
95 combo_box& selected_item(const item& selected_item);
96
100 virtual bool sorted() const noexcept;
105 virtual combo_box& sorted(bool sorted);
106
107 using list_control::text;
110 control& text(const xtd::ustring& text) override;
112
114
118 void begin_update();
119
122 void end_update();
124
126
130 static combo_box create();
134 static combo_box create(const drawing::point& location);
139 static combo_box create(const drawing::point& location, const drawing::size& size);
145 static combo_box create(const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
149 static combo_box create(const object_collection& items);
154 static combo_box create(const object_collection& items, const drawing::point& location);
160 static combo_box create(const object_collection& items, const drawing::point& location, const drawing::size& size);
167 static combo_box create(const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
172 static combo_box create(const object_collection& items, size_t selected_index);
178 static combo_box create(const object_collection& items, size_t selected_index, const drawing::point& location);
185 static combo_box create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
193 static combo_box create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
197 static combo_box create(const control& parent);
202 static combo_box create(const control& parent, const drawing::point& location);
208 static combo_box create(const control& parent, const drawing::point& location, const drawing::size& size);
215 static combo_box create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
220 static combo_box create(const control& parent, const object_collection& items);
226 static combo_box create(const control& parent, const object_collection& items, const drawing::point& location);
233 static combo_box create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size);
241 static combo_box create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
247 static combo_box create(const control& parent, const object_collection& items, size_t selected_index);
254 static combo_box create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location);
262 static combo_box create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
271 static combo_box create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::ustring& name);
273
275
282 event<combo_box, event_handler> drop_down_closed;
285 event<combo_box, event_handler> drop_down_style_changed;
287
288 protected:
290
292 forms::create_params create_params() const noexcept override;
294
296
302 std::unique_ptr<xtd::object> clone() const override;
303
308 virtual void on_drop_down(const event_args& e);
309
313 virtual void on_drop_down_closed(const event_args& e);
314
319 virtual void on_drop_down_style_changed(const event_args& e);
320
321 void on_handle_created(const event_args& e) override;
322 void on_selected_value_changed(const event_args& e) override;
323 void wnd_proc(message& message) override;
325
326 private:
327 void on_items_item_added(size_t pos, const item& item);
328 void on_items_item_removed(size_t pos, const item& item);
329 void on_items_item_updated(size_t pos, const item& item);
330 void wm_command_control(message& message);
331 void wm_command_control_selchange(message& message);
332 void wm_mouse_double_click(message& message);
333 void wm_mouse_down(message& message);
334 void wm_mouse_up(message& message);
335
336 std::shared_ptr<data> data_;
337 };
338 }
339}
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 an event.
Definition event.h:21
Represents a Windows combo box control.
Definition combo_box.h:34
combo_box()
Initializes a new instance of the combo_box class.
bool dropped_down() const noexcept
Gets a value indicating whether the combo box is displaying its drop-down portion.
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
Contains xtd::forms::combo_box_style enum class.
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
#define forms_export_
Define shared library export.
Definition forms_export.h:13
size_t size
Represents a size of any object in bytes.
Definition types.h:197
combo_box_style
Specifies the combo_box style.
Definition combo_box_style.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