Home | Libraries | People | FAQ | More |
boost::ui::combo_box — Widget to select one or more strings and edit it.
// In header: <boost/ui/combo_box.hpp> class combo_box : public boost::ui::strings_box { public: // construct/copy/destruct explicit combo_box(widget &); explicit combo_box(widget &, const uistring &); explicit combo_box(widget &, const std::vector< uistring > &); template<typename Iterator> explicit combo_box(widget &, Iterator, Iterator); template<typename Range> explicit combo_box(widget &, const Range &); template<typename T> explicit combo_box(widget &, std::initializer_list< T >); explicit combo_box(widget &, const uistring &, const std::vector< uistring > &); template<typename Range> explicit combo_box(widget &, const uistring &, const Range &); template<typename T> explicit combo_box(widget &, const uistring &, std::initializer_list< T >); combo_box(); // public member functions combo_box & text(const uistring &); uistring text() const; // private member functions void on_select_raw(const boost::function< void()> &); void on_select_event_raw(const boost::function< void(index_event &)> &); detail_impl * get_impl(); const detail_impl * get_impl() const; };
Usage example:
ui::combo_box combo_box = ui::combo_box(parent, "Initial text", { "Option 1", "Option 2", "Option 3" }) .on_select_event([&](ui::index_event& e) { ui::log::info() << "Selected option index: " << e.index() << ", text: " << combo_box.text(); });
See Also:
combo_box
public
construct/copy/destructexplicit combo_box(widget & parent);Creates empty combo box widget.
explicit combo_box(widget & parent, const uistring & text);Creates combo box widget without options and with initial text.
explicit combo_box(widget & parent, const std::vector< uistring > & options);Creates combo box widget with options and without initial text.
template<typename Iterator> explicit combo_box(widget & parent, Iterator first, Iterator last);Creates combo box widget with options and without initial text.
template<typename Range> explicit combo_box(widget & parent, const Range & r);Creates combo box widget with options and without initial text.
template<typename T> explicit combo_box(widget & parent, std::initializer_list< T > list);Creates combo box widget with options and without initial text.
explicit combo_box(widget & parent, const uistring & text, const std::vector< uistring > & options);Creates
combo_box
widget with options and initial text. template<typename Range> explicit combo_box(widget & parent, const uistring & text, const Range & r);Creates
combo_box
widget with options and initial text. template<typename T> explicit combo_box(widget & parent, const uistring & text, std::initializer_list< T > list);Creates
combo_box
widget with options and initial text. combo_box();
combo_box
private member functionsvoid on_select_raw(const boost::function< void()> & handler);
void on_select_event_raw(const boost::function< void(index_event &)> & handler);
detail_impl * get_impl();
const detail_impl * get_impl() const;