Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::listbox Class Reference

A rectangle containing a list of strings from which the user can select. This widget contain a list of categories, with in turn contain a list of items. A category is a text with can be selected, checked and expanded to show the items. An item is formed by column-fields, each corresponding to one of the headers. An item can be selected and checked. The user can drag the header to resize it or to reorganize it. By clicking on one header the list get reordered, first up, and then down alternatively. More...

Inheritance diagram for nana::listbox:
nana::widget_object< category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme > nana::concepts::any_objective< drawerbase::listbox::size_type, 2 > nana::detail::widget_base nana::widget

Public Types

using size_type = drawerbase::listbox::size_type
 An unsigned integral type. More...
 
using index_pair = drawerbase::listbox::index_pair
 The representation of a category/item. More...
 
using index_pairs = drawerbase::listbox::index_pairs
 A index_pair package. More...
 
using cat_proxy = drawerbase::listbox::cat_proxy
 Iterator to access category. More...
 
using item_proxy = drawerbase::listbox::item_proxy
 Iterator to access item. More...
 
using iresolver = drawerbase::listbox::iresolver
 The input resolver that converts an object to an item. More...
 
using oresolver = drawerbase::listbox::oresolver
 The output resolver that converts an item to an object. More...
 
using cell = drawerbase::listbox::cell
 The representation of an item cell. More...
 
using export_options = drawerbase::listbox::export_options
 The options for exporting items into a string variable. More...
 
using inline_notifier_interface = drawerbase::listbox::inline_notifier_interface
 The interface for user-defined inline widgets. More...
 
using column_interface = drawerbase::listbox::column_interface
 Column operations. More...
 
- Public Types inherited from nana::widget_object< category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme >
using scheme_type = drawerbase::listbox::scheme
 
using event_type = drawerbase::listbox::listbox_events
 
- Public Types inherited from nana::widget
using native_string_type = detail::native_string_type
 

Public Member Functions

 listbox ()=default
 
 listbox (window, bool visible)
 
 listbox (window, const rectangle &={}, bool visible=true)
 
cat_proxy at (size_type pos)
 Returns the category at specified location pos, with bounds checking. More...
 
const cat_proxy at (size_type pos) const
 
item_proxy at (const index_pair &abs_pos)
 Returns the item at specified absolute position. More...
 
const item_proxy at (const index_pair &abs_pos) const
 
cat_proxy operator[] (size_type pos)
 Returns the category at specified location pos, no bounds checking is performed. More...
 
const cat_proxy operator[] (size_type pos) const
 
item_proxy operator[] (const index_pair &abs_pos)
 Returns the item at specified absolute position, no bounds checking is performed. More...
 
const item_proxy operator[] (const index_pair &abs_pos) const
 
template<typename Key >
cat_proxy assoc (Key &&key)
 Returns a proxy to the category of the key or create a new one in the right order. More...
 
template<typename Key >
cat_proxy assoc_at (Key &&key)
 Returns a proxy to the category of the key or create a new one in the right order. More...
 
template<typename Key >
void assoc_erase (Key &&key)
 Removes the category associated with the specified key. More...
 
bool assoc_ordered (bool)
 
void auto_draw (bool) noexcept
 Set state: Redraw automatically after an operation. More...
 
template<typename Function >
void avoid_drawing (Function fn)
 
void scroll (bool to_bottom, size_type cat_pos=::nana::npos)
 Scrolls the view to the first or last item of a specified category. More...
 
void scroll (bool to_bottom, const index_pair &abs_pos)
 Scrolls the view to show an item specified by absolute position at top/bottom of the listbox. More...
 
size_type append_header (std::string text_utf8, unsigned width=120)
 
size_type append_header (std::wstring text, unsigned width=120)
 
void clear_headers ()
 Removes all the columns. More...
 
cat_proxy append (std::string category)
 Appends a new category to the end. More...
 
cat_proxy append (std::wstring category)
 Appends a new category to the end. More...
 
void append (std::initializer_list< std::string > categories)
 Appends categories to the end. More...
 
void append (std::initializer_list< std::wstring > categories)
 Appends categories to the end. More...
 
column_interfacecolumn_at (size_type pos, bool disp_order=false)
 Access a column at specified position. More...
 
const column_interfacecolumn_at (size_type pos, bool disp_order=false) const
 Access a column at specified position. More...
 
size_type column_size () const
 Returns the number of columns. More...
 
void move_column (size_type abs_pos, size_type view_pos)
 Move column to view_position. More...
 
void reorder_columns (size_type first_col, size_type last_col, index_pair row, bool reverse, std::function< bool(const std::string &cell1, size_type col1, const std::string &cell2, size_type col2, const nana::any *rowval, bool reverse)> comp)
 Sort columns in range first_col to last_col inclusive using the values from a row. More...
 
void column_resizable (bool resizable)
 
bool column_resizable () const
 
void column_movable (bool)
 
bool column_movable () const
 
rectangle content_area () const
 Returns the rectangle where the content is drawn. More...
 
cat_proxy insert (cat_proxy,::std::string)
 
cat_proxy insert (cat_proxy,::std::wstring)
 
void insert_item (const index_pair &abs_pos,::std::string text)
 Inserts an item before a specified position. More...
 
void insert_item (const index_pair &abs_pos, const ::std::wstring &text)
 Inserts an item before a specified position. More...
 
void insert_item (index_pair abs_pos, const listbox &rhs, const index_pairs &indexes)
 
index_pair cast (const point &screen_pos) const
 Returns the index pair of the item which contains the specified "screen" point. More...
 
index_pair hovered (bool return_end) const
 Returns the item which is hovered. More...
 
size_type column_from_pos (const point &screen_pos) const
 Returns the absolute position of the column which contains the specified "screen" point. More...
 
void checkable (bool make_checkeable)
 Display a checkbox at te links of each item if make_checkeable=true. More...
 
index_pairs checked () const
 Returns all the items which are checked. More...
 
void clear (size_type cat)
 Removes all the items from the specified category. More...
 
void clear ()
 Removes all the items from all categories. More...
 
void erase (size_type cat)
 Erases a category. More...
 
void erase ()
 Erases all categories. More...
 
void erase (index_pairs indexes)
 Erases specified items. More...
 
item_proxy erase (item_proxy indx)
 Erases specified item. More...
 
bool sortable () const
 return whether the listbox is set to be sortable More...
 
void sortable (bool enable)
 set the listbox to be or not to be sortable More...
 
void set_sort_compare (size_type col, std::function< bool(const std::string &, nana::any *, const std::string &, nana::any *, bool reverse)> strick_ordering)
 Sets a strict weak ordering comparer for a column. More...
 
void sort_col (size_type col, bool reverse=false)
 sort() and invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items More...
 
size_type sort_col () const
 return the column currently used to sort items More...
 
void unsort ()
 Prevent sorting until freeze is set to false. More...
 
bool freeze_sort (bool freeze)
 
index_pairs selected () const
 Get the absolute indexes of all the selected items. More...
 
void show_header (bool)
 
bool visible_header () const
 
void move_select (bool upwards)
 Selects an item besides the current selected item in the display. More...
 
size_type size_categ () const
 Get the number of categories. More...
 
size_type size_item (size_type cat) const
 The number of items in category "cat". More...
 
void enable_single (bool for_selection, bool category_limited)
 
void disable_single (bool for_selection)
 
bool is_single_enabled (bool for_selection) const noexcept
 Determines whether the single selection/check is enabled. More...
 
export_optionsdef_export_options ()
 return a modifiable reference to the export options in use More...
 
listboxcategory_icon (std::function< void(paint::graphics &graph, const rectangle &rt_icon, bool expanded)> icon_renderer)
 Sets a renderer for category icon. More...
 
listboxcategory_icon (const paint::image &img_expanded, const paint::image &img_collapsed)
 Sets category icons. More...
 
index_pair first_visible () const
 Returns first visible element. More...
 
index_pair last_visible () const
 Returns last visible element. More...
 
index_pairs visibles () const
 Returns all visible items. More...
 
void set_deselect (std::function< bool(nana::mouse)> predicate)
 Sets a predicate that indicates whether to deselect items when mouse_up is triggered. More...
 
unsigned suspension_width () const
 
- Public Member Functions inherited from nana::widget_object< category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme >
 widget_object ()
 
 ~widget_object ()
 
event_typeevents () const
 
bool create (window parent_wd, bool visible)
 
bool create (window parent_wd, const rectangle &r={}, bool visible=true)
 
widget_objectborderless (bool enable)
 
bool borderless () const
 
scheme_typescheme () const
 
void filter_event (const event_code evt_code, const bool bDisabled)
 
void filter_event (const std::vector< event_code > evt_codes, const bool bDisabled)
 
void filter_event (const event_filter_status &evt_all_states)
 
bool filter_event (const event_code evt_code)
 
event_filter_status filter_event ()
 
void clear_filter ()
 
- Public Member Functions inherited from nana::detail::widget_base
window handle () const override
 Returns the handle of window, returns 0 if window is not created. More...
 
- Public Member Functions inherited from nana::widget
 widget ()=default
 
virtual ~widget ()=default
 
bool empty () const
 Determines whether the manipulator is handling a window. More...
 
void close ()
 
window parent () const
 
::std::string caption () const noexcept
 
::std::wstring caption_wstring () const noexcept
 
native_string_type caption_native () const noexcept
 
widgetcaption (std::string utf8)
 
widgetcaption (std::wstring)
 
template<typename... Args>
void i18n (std::string msgid, Args &&...args)
 
void i18n (i18n_eval)
 
void cursor (nana::cursor)
 
nana::cursor cursor () const
 Retrieves the shape of cursor. More...
 
void typeface (const paint::font &font)
 
paint::font typeface () const
 
bool enabled () const
 Determines whether the window is enabled for mouse and keyboard input. More...
 
void enabled (bool)
 
void enable_dropfiles (bool)
 Enables/Disables a window to accept dropped files. More...
 
void focus ()
 
bool focused () const
 
std::shared_ptr
< scroll_operation_interface
scroll_operation ()
 
void show ()
 Sets the window visible. More...
 
void hide ()
 Sets the window invisible. More...
 
bool visible () const
 
nana::size size () const
 
void size (const nana::size &)
 
void set_capture (bool ignore_children)
 Enables the widget to grab the mouse input. More...
 
void release_capture ()
 Disables the widget to grab the mouse input. More...
 
point pos () const
 
void move (int x, int y)
 
void move (const point &)
 
void move (const rectangle &)
 
void fgcolor (const nana::color &)
 
nana::color fgcolor () const
 
void bgcolor (const nana::color &)
 
nana::color bgcolor () const
 
general_eventsevents () const
 
void umake_event (event_handle eh) const
 Deletes an event callback by a handle. More...
 
widgetregister_shortkey (wchar_t)
 Registers a shortkey. To remove a registered key, pass 0. More...
 
widgettake_active (bool activated, window take_if_not_activated)
 
widgettooltip (const ::std::string &)
 
 operator dummy_bool_type () const
 
 operator window () const
 
- Public Member Functions inherited from nana::concepts::any_objective< drawerbase::listbox::size_type, 2 >
virtual ~any_objective ()=default
 
void anyobj (const Target &t)
 
void anyobj (Target &&t)
 
Target * anyobj () const
 < Retrieves the attached object. Returns a nullptr if empty or if the type not match. More...
 

Additional Inherited Members

- Protected Types inherited from nana::widget_object< category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme >
typedef
drawerbase::listbox::trigger 
drawer_trigger_t
 
- Protected Member Functions inherited from nana::widget_object< category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme >
drawerbase::listbox::triggerget_drawer_trigger ()
 
const
drawerbase::listbox::trigger
get_drawer_trigger () const
 
- Protected Member Functions inherited from nana::widget
std::unique_ptr
<::nana::detail::widget_notifier_interface
_m_wdg_notifier ()
 
virtual void _m_complete_creation ()
 
virtual native_string_type _m_caption () const noexcept
 
virtual void _m_caption (native_string_type &&)
 
virtual nana::cursor _m_cursor () const
 
virtual void _m_cursor (nana::cursor)
 
virtual void _m_close ()
 
virtual bool _m_enabled () const
 
virtual void _m_enabled (bool)
 
virtual bool _m_show (bool)
 
virtual bool _m_visible () const
 
virtual void _m_size (const nana::size &)
 
virtual void _m_move (int x, int y)
 
virtual void _m_move (const rectangle &)
 
virtual void _m_typeface (const nana::paint::font &font)
 
virtual nana::paint::font _m_typeface () const
 
virtual void _m_fgcolor (const nana::color &)
 
virtual nana::color _m_fgcolor () const
 
virtual void _m_bgcolor (const nana::color &)
 
virtual nana::color _m_bgcolor () const
 
- Protected Attributes inherited from nana::detail::widget_base
window handle_ { nullptr }
 

Detailed Description

A rectangle containing a list of strings from which the user can select. This widget contain a list of categories, with in turn contain a list of items. A category is a text with can be selected, checked and expanded to show the items. An item is formed by column-fields, each corresponding to one of the headers. An item can be selected and checked. The user can drag the header to resize it or to reorganize it. By clicking on one header the list get reordered, first up, and then down alternatively.

  1. The resolver is used to resolute an object of the specified type into (or back from) a listbox item.
  2. nana::listbox creates the category 0 by default. This is an special category, because it is invisible, while the associated items are visible. The optional, user-created categories begin at index 1 and are visible. The member functions without the categ parameter operate the items that belong to category 0.
  3. A sort compare is used for sorting the items. It is a strict weak ordering comparer that must meet the requirement: Irreflexivity (comp(x, x) returns false) and Antisymmetry(comp(a, b) != comp(b, a) returns true) A simple example. bool sort_compare( const std::string& s1, nana::any*, const std::string& s2, nana::any*, bool reverse) { return (reverse ? s1 > s2 : s1 < s2); } listbox.set_sort_compare(0, sort_compare); The listbox supports attaching a customer's object for each item, therefore the items can be sorted by comparing these customer's object. bool sort_compare( const std::string&, nana::any* o1, const std::string&, nana::any* o2, bool reverse) { if(o1 && o2) //some items may not attach a customer object. { int * i1 = any_cast<int>(*o1); int * i2 = any_cast<int>(*o2); return (i1 && i2 && (reverse ? *i1 > *i2 : *i1 < *i2)); ^ some types may not be int. } return false; } auto cat = listbox.at(0); cat.at(0).value(10); //10 is custom data. cat.at(1).value(20); //20 is custom data.
  4. listbox is a widget_object, with template parameters drawerbase::listbox::trigger and drawerbase::listbox::scheme among others. That means that listbox have a member trigger_ constructed first and accessible with get_drawer_trigger() and a member (unique pointer to) scheme_ accessible with scheme_type& scheme() created in the constructor with API::dev::make_scheme<Scheme>() which call API::detail::make_scheme(::nana::detail::scheme_factory<Scheme>()) which call restrict::bedrock.make_scheme(static_cast<::nana::detail::scheme_factory_base&&>(factory)); which call pi_data_->scheme.create(std::move(factory)); which call factory.create(scheme_template(std::move(factory))); which call (new Scheme(static_cast<Scheme&>(other))); and which in create is set with: API::dev::set_scheme(handle_, scheme_.get()); which save the scheme pointer in the nana::detail::basic_window member pointer scheme
    Todo:
    doc: actualize this example listbox.at(0)...
    See Also
    nana::drawerbase::listbox::cat_proxy
    nana::drawerbase::listbox::item_proxy
Examples:
example_listbox.cpp, file_explorer.cpp, listbox_inline_widget.cpp, listbox_Resolver.cpp, widget_show.cpp, and widget_show2.cpp.

Member Typedef Documentation

Iterator to access category.

The representation of an item cell.

The options for exporting items into a string variable.

The representation of a category/item.

The interface for user-defined inline widgets.

The input resolver that converts an object to an item.

The output resolver that converts an item to an object.

An unsigned integral type.

Constructor & Destructor Documentation

nana::listbox::listbox ( )
default
nana::listbox::listbox ( window  wd,
bool  visible 
)
nana::listbox::listbox ( window  wd,
const rectangle r = {},
bool  visible = true 
)

Member Function Documentation

listbox::cat_proxy nana::listbox::append ( std::string  category)

Appends a new category to the end.

listbox::cat_proxy nana::listbox::append ( std::wstring  category)

Appends a new category to the end.

void nana::listbox::append ( std::initializer_list< std::string categories)

Appends categories to the end.

void nana::listbox::append ( std::initializer_list< std::wstring categories)

Appends categories to the end.

listbox::size_type nana::listbox::append_header ( std::string  text_utf8,
unsigned  width = 120 
)

Appends a new column with a header text and the specified width at the end, and return it position

If a width of 0 is passed the width will be set to fit the header text.

Examples:
example_listbox.cpp, and listbox_inline_widget.cpp.
listbox::size_type nana::listbox::append_header ( std::wstring  text,
unsigned  width = 120 
)
template<typename Key >
cat_proxy nana::listbox::assoc ( Key &&  key)
inline

Returns a proxy to the category of the key or create a new one in the right order.

Parameters
keyThe key of category to find
Returns
A category proxy
template<typename Key >
cat_proxy nana::listbox::assoc_at ( Key &&  key)
inline

Returns a proxy to the category of the key or create a new one in the right order.

Parameters
keyThe key of category to find
Returns
A category proxy
template<typename Key >
void nana::listbox::assoc_erase ( Key &&  key)
inline

Removes the category associated with the specified key.

Parameters
keyThe key of category to remove
bool nana::listbox::assoc_ordered ( bool  enable)
listbox::cat_proxy nana::listbox::at ( size_type  pos)

Returns the category at specified location pos, with bounds checking.

Examples:
example_listbox.cpp.
const listbox::cat_proxy nana::listbox::at ( size_type  pos) const
listbox::item_proxy nana::listbox::at ( const index_pair abs_pos)

Returns the item at specified absolute position.

const listbox::item_proxy nana::listbox::at ( const index_pair abs_pos) const
void nana::listbox::auto_draw ( bool  enabled)
noexcept

Set state: Redraw automatically after an operation.

template<typename Function >
void nana::listbox::avoid_drawing ( Function  fn)
inline
listbox::index_pair nana::listbox::cast ( const point screen_pos) const

Returns the index pair of the item which contains the specified "screen" point.

listbox & nana::listbox::category_icon ( std::function< void(paint::graphics &graph, const rectangle &rt_icon, bool expanded)>  icon_renderer)

Sets a renderer for category icon.

Parameters
icon_rendererThe renderer of category icon
Returns
the reference of *this.
listbox & nana::listbox::category_icon ( const paint::image img_expanded,
const paint::image img_collapsed 
)

Sets category icons.

Parameters
img_expandedAn icon displayed in front of category title when the category is expanded.
img_collapsedAn icon displayed in front of category title when the category is collapsed.
Returns
the reference of *this.
void nana::listbox::checkable ( bool  make_checkeable)

Display a checkbox at te links of each item if make_checkeable=true.

auto nana::listbox::checked ( ) const

Returns all the items which are checked.

void nana::listbox::clear ( size_type  cat)

Removes all the items from the specified category.

void nana::listbox::clear ( )

Removes all the items from all categories.

void nana::listbox::clear_headers ( )

Removes all the columns.

auto nana::listbox::column_at ( size_type  pos,
bool  disp_order = false 
)

Access a column at specified position.

Parameters
posPosition of column
disp_orderIndicates whether the pos is display position or absolute position.
Returns
Reference to the requested column std::out_of_range if !(pos < columns())
auto nana::listbox::column_at ( size_type  pos,
bool  disp_order = false 
) const

Access a column at specified position.

Parameters
posPosition of column
disp_orderIndicates whether the pos is display position or absolute position.
Returns
Constant reference to the requested column std::out_of_range if !(pos < columns())
listbox::size_type nana::listbox::column_from_pos ( const point screen_pos) const

Returns the absolute position of the column which contains the specified "screen" point.

void nana::listbox::column_movable ( bool  movable)
bool nana::listbox::column_movable ( ) const
void nana::listbox::column_resizable ( bool  resizable)
bool nana::listbox::column_resizable ( ) const
auto nana::listbox::column_size ( ) const

Returns the number of columns.

rectangle nana::listbox::content_area ( ) const

Returns the rectangle where the content is drawn.

listbox::export_options & nana::listbox::def_export_options ( )

return a modifiable reference to the export options in use

void nana::listbox::disable_single ( bool  for_selection)
void nana::listbox::enable_single ( bool  for_selection,
bool  category_limited 
)
void nana::listbox::erase ( size_type  cat)

Erases a category.

Examples:
listbox_inline_widget.cpp.
void nana::listbox::erase ( )

Erases all categories.

void nana::listbox::erase ( index_pairs  indexes)

Erases specified items.

listbox::item_proxy nana::listbox::erase ( item_proxy  indx)

Erases specified item.

auto nana::listbox::first_visible ( ) const

Returns first visible element.

It may return an item or a category item.

Returns
the index of first visible element.
bool nana::listbox::freeze_sort ( bool  freeze)
listbox::index_pair nana::listbox::hovered ( bool  return_end) const

Returns the item which is hovered.

Parameters
return_endIndicates whether to return an end position instead of an empty position if no item is hovered.
Returns
The position of the hovered item. If return_end is true and no item is hovered it returns the position next to the last item of last category.
cat_proxy nana::listbox::insert ( cat_proxy  ,
::std::string   
)
cat_proxy nana::listbox::insert ( cat_proxy  ,
::std::wstring   
)
void nana::listbox::insert_item ( const index_pair abs_pos,
::std::string  text 
)

Inserts an item before a specified position.

Parameters
abs_posThe absolute position before which an item will be inserted.
textText of the first column, UTF-8 encoded.
void nana::listbox::insert_item ( const index_pair abs_pos,
const ::std::wstring text 
)

Inserts an item before a specified position.

Parameters
abs_posThe absolute position before which an item will be inserted.
textText of the first column.
void nana::listbox::insert_item ( index_pair  abs_pos,
const listbox rhs,
const index_pairs indexes 
)
bool nana::listbox::is_single_enabled ( bool  for_selection) const
noexcept

Determines whether the single selection/check is enabled.

auto nana::listbox::last_visible ( ) const

Returns last visible element.

It may return an item or a category item.

Returns
the index of last visible element.
void nana::listbox::move_column ( size_type  abs_pos,
size_type  view_pos 
)

Move column to view_position.

void nana::listbox::move_select ( bool  upwards)

Selects an item besides the current selected item in the display.

Parameters
upwardsSelects an item besides the current selected item in the display.
cat_proxy nana::listbox::operator[] ( size_type  pos)

Returns the category at specified location pos, no bounds checking is performed.

const cat_proxy nana::listbox::operator[] ( size_type  pos) const
item_proxy nana::listbox::operator[] ( const index_pair abs_pos)

Returns the item at specified absolute position, no bounds checking is performed.

const item_proxy nana::listbox::operator[] ( const index_pair abs_pos) const
void nana::listbox::reorder_columns ( size_type  first_col,
size_type  last_col,
index_pair  row,
bool  reverse,
std::function< bool(const std::string &cell1, size_type col1, const std::string &cell2, size_type col2, const nana::any *rowval, bool reverse)>  comp 
)

Sort columns in range first_col to last_col inclusive using the values from a row.

Sort columns in range first_col to last_col inclusive using a row.

void nana::listbox::scroll ( bool  to_bottom,
size_type  cat_pos = ::nana::npos 
)

Scrolls the view to the first or last item of a specified category.

void nana::listbox::scroll ( bool  to_bottom,
const index_pair abs_pos 
)

Scrolls the view to show an item specified by absolute position at top/bottom of the listbox.

auto nana::listbox::selected ( ) const

Get the absolute indexes of all the selected items.

void nana::listbox::set_deselect ( std::function< bool(nana::mouse)>  predicate)

Sets a predicate that indicates whether to deselect items when mouse_up is triggered.

The predicate is called before the listbox attempts to deselect the selected items in the mouse_up event. Other situations, the predicates isn't called, for example, releasing mouse button after user performed a box selection, because listbox doesn't deselect the items during this operation.

Parameters
predicateDecides to deselect the items. The paramater of predicate indicates the mouse button which is releasing. It returns true to deselect the selected items. It returns false to cancel to deselect the selected items.
void nana::listbox::set_sort_compare ( size_type  col,
std::function< bool(const std::string &, nana::any *, const std::string &, nana::any *, bool reverse)>  strick_ordering 
)

Sets a strict weak ordering comparer for a column.

void nana::listbox::show_header ( bool  sh)
listbox::size_type nana::listbox::size_categ ( ) const

Get the number of categories.

listbox::size_type nana::listbox::size_item ( size_type  cat) const

The number of items in category "cat".

void nana::listbox::sort_col ( size_type  col,
bool  reverse = false 
)

sort() and invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items

Sort the items using the specified column.

Invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items

auto nana::listbox::sort_col ( ) const

return the column currently used to sort items

bool nana::listbox::sortable ( ) const

return whether the listbox is set to be sortable

void nana::listbox::sortable ( bool  enable)

set the listbox to be or not to be sortable

unsigned nana::listbox::suspension_width ( ) const
void nana::listbox::unsort ( )

Prevent sorting until freeze is set to false.

potentially invalidates any existing reference from display position to absolute item, that is: after sort() display offset point to different items

Eliminate any "column sorting", effectively setting the items in the order of creation.

Potentially invalidates any existing reference from display position to absolute item, that is: after unsort() display offset may point to different items

bool nana::listbox::visible_header ( ) const
auto nana::listbox::visibles ( ) const

Returns all visible items.

It returns all visible items that are displayed in listbox window.

Returns
index_pairs containing all visible items.