Boost.UI
User Interface Boost library
Public Member Functions | List of all members
boost::ui::list_box Class Reference

Widget to select one or more strings. More...

Inheritance diagram for boost::ui::list_box:
[legend]

Public Member Functions

bool has_selection () const
 Returns true if list_box has selected options, false otherwise.
 
size_type selected_index () const
 Returns index of the selected option. If list_box has no selected options then returns npos.
 
uistring selected_string () const
 Returns selected option string.
 
 list_box (widget &parent)
 Creates empty list_box widget.
 
list_boxcreate (widget &parent)
 Creates empty list_box widget.
 
 list_box (widget &parent, const std::vector< uistring > &options)
 Creates list_box widget with options.
 
list_boxcreate (widget &parent, const std::vector< uistring > &options)
 Creates list_box widget with options.
 
template<class Iterator >
 list_box (widget &parent, Iterator first, Iterator last)
 Creates list_box widget with options.
 
template<class Iterator >
list_boxcreate (widget &parent, Iterator first, Iterator last)
 Creates list_box widget with options.
 
template<class Range >
 list_box (widget &parent, const Range &r)
 Creates list_box widget with options.
 
template<class Range >
list_boxcreate (widget &parent, const Range &r)
 Creates list_box widget with options.
 
template<class T >
 list_box (widget &parent, std::initializer_list< T > list)
 Creates list_box widget with options.
 
template<class T >
list_boxcreate (widget &parent, std::initializer_list< T > list)
 Creates list_box widget with options.
 
template<class F , class ... Args>
list_boxon_select (F &&f, Args &&... args)
 Connects item selection handler.
 
template<class F , class ... Args>
list_boxon_select_event (F &&f, Args &&... args)
 Connects item selection handler.
 
template<class F , class ... Args>
list_boxon_activate (F &&f, Args &&... args)
 Connects item activation handler.
 
template<class F , class ... Args>
list_boxon_activate_event (F &&f, Args &&... args)
 Connects item activation handler.
 
- Public Member Functions inherited from boost::ui::strings_box
uistring at (size_type pos) const
 Returns specified element with bounds checking. More...
 
uistring operator[] (size_type pos) const
 Retuns specified element.
 
bool empty () const
 Checks whether the container has options.
 
size_type size () const
 Returns the number of options.
 
void clear ()
 Clears the contents.
 
void push_back (const uistring &value)
 Appends the given string value to the end.
 
strings_boxselect (size_type pos)
 Selects specified element.
 
strings_boxassign (const std::vector< uistring > &options)
 Replaces the contents of the container.
 
strings_boxassign (size_type count, const value_type &value)
 Replaces the contents of the container.
 
template<class Iterator >
strings_boxassign (Iterator first, Iterator last)
 Replaces the contents of the container.
 
template<class Range >
strings_boxassign (const Range &r)
 Replaces the contents of the container.
 
template<class T >
strings_boxassign (std::initializer_list< T > list)
 Replaces the contents of the container.
 
strings_boxappend (const std::vector< uistring > &options)
 Appends contents to the end.
 
strings_boxappend (size_type count, const value_type &value)
 Appends contents to the end.
 
template<class Iterator >
strings_boxappend (Iterator first, Iterator last)
 Appends contents to the end.
 
template<class Range >
strings_boxappend (const Range &r)
 Appends contents to the end.
 
template<class T >
strings_boxappend (std::initializer_list< T > list)
 Appends contents to the end.
 
- Public Member Functions inherited from boost::ui::widget
ui::layout::item layout ()
 Returns layout::item with this widget.
 
widgetresize (coord_type width, coord_type height)
 Changes widget size to specified values.
 
coord_type x () const
 Returns x coordinate relative to the parent widget client area.
 
coord_type y () const
 Returns y coordinate relative to the parent widget client area.
 
coord_type width () const
 Returns widget width.
 
coord_type height () const
 Returns widget height.
 
point pos () const
 Returns widget position relative to the parent widget client area.
 
size dimensions () const
 Returns widget size.
 
rect bounds () const
 Returns widget bounds in client coordinates.
 
widgetenable (bool do_enable=true)
 Enables widget if do_enable is true, disables otherwise.
 
widgetdisable ()
 Disables widget.
 
bool is_enabled () const
 Returns true if widget is enabled, false otherwise.
 
widgetshow (bool do_show=true)
 Shows widget if do_show is true, hides otherwise.
 
widgethide ()
 Hides widget.
 
bool is_shown () const
 Returns true if widget is shown on screen, false otherwise.
 
widgettooltip (const uistring &text)
 Sets tooltip text. More...
 
uistring tooltip () const
 Returns tooltip text.
 
widgetfont (const ui::font &f)
 Sets font.
 
ui::font font () const
 Returns font.
 
bool native_valid () const noexcept
 Returns true only if native widget was created.
 
widgetappend (const widget &w)
 Creates native widget and appends it to this widget.
 
widgetoperator<< (const widget &w)
 Creates native widget and appends it to this widget.
 
widgetmove (coord_type x, coord_type y)
 Moves widget to specified position.
 
widgetmove (const point &pos)
 Moves widget to specified position.
 
template<class F , class ... Args>
widgeton_resize (F &&f, Args &&... args)
 Connects widget resize handler.
 
template<class F , class ... Args>
widgeton_key_press (F &&f, Args &&... args)
 Connects keyboard event handler.
 
template<class F , class ... Args>
widgeton_key_press_event (F &&f, Args &&... args)
 Connects keyboard event handler.
 
template<class F , class ... Args>
widgeton_key_down (F &&f, Args &&... args)
 Connects keyboard event handler.
 
template<class F , class ... Args>
widgeton_key_down_event (F &&f, Args &&... args)
 Connects keyboard event handler.
 
template<class F , class ... Args>
widgeton_key_up (F &&f, Args &&... args)
 Connects keyboard event handler.
 
template<class F , class ... Args>
widgeton_key_up_event (F &&f, Args &&... args)
 Connects keyboard event handler.
 
template<class F , class ... Args>
widgeton_left_mouse_down (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_left_mouse_down_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_left_mouse_up (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_left_mouse_up_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_right_mouse_down (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_right_mouse_down_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_right_mouse_up (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_right_mouse_up_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_middle_mouse_down (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_middle_mouse_down_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_middle_mouse_up (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_middle_mouse_up_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_left_mouse_double_click (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_left_mouse_double_click_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_right_mouse_double_click (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_right_mouse_double_click_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_middle_mouse_double_click (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_middle_mouse_double_click_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_move (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_move_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_drag (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_drag_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_enter (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_enter_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_leave (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_leave_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_context_menu (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_context_menu_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_wheel (F &&f, Args &&... args)
 Connects mouse event handler.
 
template<class F , class ... Args>
widgeton_mouse_wheel_event (F &&f, Args &&... args)
 Connects mouse event handler.
 
native_handle_type native_handle ()
 Returns the implementation-defined underlying widget handle.
 
const native_handle_type native_handle () const
 Returns the implementation-defined underlying widget handle.
 

Additional Inherited Members

- Public Types inherited from boost::ui::strings_box
typedef uistring value_type
 String type.
 
typedef index_type size_type
 Integral type.
 
- Public Types inherited from boost::ui::widget
typedef void * native_handle_type
 Implementation-defined widget type.
 
- Static Public Attributes inherited from boost::ui::strings_box
static const size_type npos = nindex
 Invalid index.
 

Detailed Description

Widget to select one or more strings.

Usage example:

ui::list_box list_box = ui::list_box(parent,
{ "Option 1", "Option 2", "Option 3" })
.on_select_event([&](ui::index_event& e)
{
ui::log::info() << "Selected option index: " << e.index();
})
.on_activate_event([&](ui::index_event& e)
{
ui::log::info() << "Activated option index: " << e.index();
})
;
See also
List box (Wikipedia)

The documentation for this class was generated from the following file:
boost::ui::list_box::on_activate_event
list_box & on_activate_event(F &&f, Args &&... args)
Connects item activation handler.
boost::ui::list_box::on_select_event
list_box & on_select_event(F &&f, Args &&... args)
Connects item selection handler.