xtd 0.2.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 combo_box(combo_box&& rhs);
49 combo_box(const combo_box&) = default;
50 combo_box& operator =(const combo_box&) = default;
52
54
58 bool dropped_down() const noexcept;
62 combo_box& dropped_down(bool value);
63
67 combo_box_style drop_down_style() const noexcept;
71 combo_box& drop_down_style(combo_box_style drop_down_style);
72
76 object_collection& items() noexcept;
79 const object_collection& items() const noexcept;
83 const combo_box& items(const object_collection& items);
84
85 using list_control::selected_index;
89 list_control& selected_index(size_t selected_index) override;
90
93 const item& selected_item() const noexcept;
97 combo_box& selected_item(const item& selected_item);
98
102 virtual bool sorted() const noexcept;
107 virtual combo_box& sorted(bool sorted);
108
109 using list_control::text;
112 control& text(const xtd::string& text) override;
114
116
120 void begin_update();
121
124 void end_update();
126
128
132 static combo_box create();
136 static combo_box create(const drawing::point& location);
141 static combo_box create(const drawing::point& location, const drawing::size& size);
147 static combo_box create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
151 static combo_box create(const object_collection& items);
156 static combo_box create(const object_collection& items, const drawing::point& location);
162 static combo_box create(const object_collection& items, const drawing::point& location, const drawing::size& size);
169 static combo_box create(const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::string& name);
174 static combo_box create(const object_collection& items, size_t selected_index);
180 static combo_box create(const object_collection& items, size_t selected_index, const drawing::point& location);
187 static combo_box create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
195 static combo_box create(const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size, const xtd::string& name);
199 static combo_box create(const control& parent);
204 static combo_box create(const control& parent, const drawing::point& location);
210 static combo_box create(const control& parent, const drawing::point& location, const drawing::size& size);
217 static combo_box create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
222 static combo_box create(const control& parent, const object_collection& items);
228 static combo_box create(const control& parent, const object_collection& items, const drawing::point& location);
235 static combo_box create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size);
243 static combo_box create(const control& parent, const object_collection& items, const drawing::point& location, const drawing::size& size, const xtd::string& name);
249 static combo_box create(const control& parent, const object_collection& items, size_t selected_index);
256 static combo_box create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location);
264 static combo_box create(const control& parent, const object_collection& items, size_t selected_index, const drawing::point& location, const drawing::size& size);
273 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::string& name);
275
277
284 event<combo_box, event_handler> drop_down_closed;
287 event<combo_box, event_handler> drop_down_style_changed;
289
290 protected:
292
294 forms::create_params create_params() const noexcept override;
296
298
304 xtd::uptr<xtd::object> clone() const override;
305
310 virtual void on_drop_down(const event_args& e);
311
315 virtual void on_drop_down_closed(const event_args& e);
316
321 virtual void on_drop_down_style_changed(const event_args& e);
322
323 void on_handle_created(const event_args& e) override;
324 void on_selected_value_changed(const event_args& e) override;
325 void wnd_proc(message& message) override;
327
328 private:
329 void on_items_item_added(size_t pos, const item& item);
330 void on_items_item_removed(size_t pos, const item& item);
331 void on_items_item_updated(size_t pos, const item& item);
332 void wm_command_control(message& message);
333 void wm_command_control_selchange(message& message);
334 void wm_mouse_double_click(message& message);
335 void wm_mouse_down(message& message);
336 void wm_mouse_up(message& message);
337
338 xtd::sptr<data> data_;
339 };
340 }
341}
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:21
Represents a Windows combo box control.
Definition combo_box.hpp:36
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.hpp:81
Encapsulates the information needed when creating a control.
Definition create_params.hpp:29
Represents a collection of objects.
Definition arranged_element_collection.hpp:34
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
Implements a Windows message.
Definition message.hpp:28
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.hpp:32
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
combo_box_style
Specifies the combo_box style.
Definition combo_box_style.hpp:24
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.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10