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

Classes

struct  emit_cancel
 
struct  pred_cancel
 
struct  sort_attributes
 

Public Types

using container = std::list< category_t >
 
using item_type = item_data
 

Public Member Functions

 es_lister ()
 
void bind (essence *ess, widget &wd) noexcept
 
nana::listboxwd_ptr () const noexcept
 
nana::anyanyobj (const index_pair &id, bool allocate_if_empty) const
 
std::string to_string (const export_options &exp_opt) const
 
void emit_cs (const index_pair &pos, bool for_selection)
 
unsigned column_content_pixels (size_type pos) const
 
const sort_attributessort_attrs () const noexcept
 
void sort ()
 each sort() invalidates any existing reference from display position to absolute item, that is after sort() display offset point to different items More...
 
bool sort_column (std::size_t pos, const bool *reverse)
 Sorts the specified column. More...
 
bool active_sort (bool resort) noexcept
 
void scroll_into_view (const index_pair &abs_pos, view_action vw_act)
 Scroll the selected item into the view. More...
 
category_tcreate_category (std::shared_ptr< nana::detail::key_interface > &ptr)
 will use the key to insert new cat before the first cat with compare less than the key, or at the end of the list of cat and return a ref to that new cat. ? More...
 
category_tcreate_category (native_string_type &&text, std::size_t pos=nana::npos)
 Inserts a new category at position specified by pos. More...
 
void insert (const index_pair &pos, std::string &&text, const std::size_t columns)
 Insert before item in absolute "pos" a new item with "text" in column 0, and place it in last display position of this cat. More...
 
index_pair index_cast (const index_pair &from, bool from_display_order) const
 Converts an index between display position and absolute real position. More...
 
index_pair index_cast_noexcept (const index_pair &from, bool from_display_order, const index_pair &default_value=index_pair{npos, npos}) const noexcept
 
void throw_if_immutable_model (const index_pair &pos) const
 
void assign_model (const index_pair &pos, const std::vector< cell > &cells)
 
bool has_model (const index_pair &pos) const
 
category_t::container::value_type & at_abs (const index_pair &pos)
 
std::vector< cellat_model_abs (const index_pair &pos) const
 
category_t::container::value_type & at (const index_pair &pos)
 return a ref to the real item object at display position More...
 
const
category_t::container::value_type & 
at (const index_pair &pos) const
 
std::vector< cellat_model (const index_pair &pos) const
 
void append_active_panes (inline_pane *p)
 
void clear (size_type cat)
 
void clear ()
 
index_pair advance (const index_pair &pos, int n) const
 
size_type distance (index_pair from, index_pair to) const
 change to index arg More...
 
void text (category_t *cat, size_type pos, size_type abs_col, cell &&cl, size_type columns)
 
void text (category_t *cat, size_type pos, size_type abs_col, std::string &&str, size_type columns)
 
void erase (const index_pair &pos)
 
void erase (size_type cat)
 
void erase ()
 
bool expand (size_type cat, bool exp) noexcept
 
bool expand (size_type cat) const noexcept
 
containercat_container () noexcept
 
const containercat_container () const noexcept
 
bool enable_ordered (bool enb) noexcept
 
bool enable_ordered () const noexcept
 
size_type the_number_of_expanded () const noexcept
 
index_pair find_next_good (index_pair pos, bool ignore_category) const noexcept
 Finds a good item or category if an item specified by pos is invalid. More...
 
template<typename Pred >
std::vector< std::pair
< index_pair, bool > > 
select_display_range_if (index_pair fr_abs, index_pair to_dpl, bool deselect_others, Pred pred)
 
bool select_for_all (bool sel, const index_pair &except_abs=index_pair{npos, npos})
 
index_pairs pick_items (bool for_selection, bool find_first=false, bool *items_status=nullptr) const
 return absolute positions, no relative to display More...
 
void move_select (bool upwards=true, bool unselect_previous=true, bool into_view=false) noexcept
 
void cancel_others_if_single_enabled (bool for_selection, const index_pair &except)
 
bool single_status (bool for_selection) const noexcept
 
void enable_single (bool for_selection, bool category_limited)
 
void disable_single (bool for_selection) noexcept
 
bool is_single_enabled (bool for_selection) const noexcept
 
size_type size_item (size_type cat) const
 
bool cat_status (size_type pos, bool for_selection) const
 
bool cat_status (size_type pos, bool for_selection, bool value)
 
bool cat_status_reverse (size_type pos, bool for_selection) noexcept
 
index_pair last () const noexcept
 can be used as the absolute position of the last absolute item, or as the display pos of the last displayed item More...
 
index_pair first () const noexcept
 can be used as the absolute position of the first absolute item, or as the display pos of the first displayed item More...
 
bool good (size_type cat) const noexcept
 
bool good (const index_pair &pos) const noexcept
 
container::iterator get (size_type pos)
 categories iterator More...
 
container::const_iterator get (size_type pos) const
 

Static Public Member Functions

static void throw_if_immutable_model (model_interface *model)
 

Public Attributes

std::function< std::function
< bool(const ::std::string
&,::nana::any *, const
::std::string &,::nana::any
*, bool reverse)>std::size_t) > 
fetch_ordering_comparer
 
index_pair latest_selected_abs
 

Member Typedef Documentation

Constructor & Destructor Documentation

nana::drawerbase::listbox::es_lister::es_lister ( )
inline

Member Function Documentation

bool nana::drawerbase::listbox::es_lister::active_sort ( bool  resort)
inlinenoexcept
index_pair nana::drawerbase::listbox::es_lister::advance ( const index_pair pos,
int  n 
) const
inline
nana::any* nana::drawerbase::listbox::es_lister::anyobj ( const index_pair id,
bool  allocate_if_empty 
) const
inline
void nana::drawerbase::listbox::es_lister::append_active_panes ( inline_pane p)
inline
void nana::drawerbase::listbox::es_lister::assign_model ( const index_pair pos,
const std::vector< cell > &  cells 
)
inline
category_t::container::value_type& nana::drawerbase::listbox::es_lister::at ( const index_pair pos)
inline

return a ref to the real item object at display position

const category_t::container::value_type& nana::drawerbase::listbox::es_lister::at ( const index_pair pos) const
inline
category_t::container::value_type& nana::drawerbase::listbox::es_lister::at_abs ( const index_pair pos)
inline
std::vector<cell> nana::drawerbase::listbox::es_lister::at_model ( const index_pair pos) const
inline
std::vector<cell> nana::drawerbase::listbox::es_lister::at_model_abs ( const index_pair pos) const
inline
void nana::drawerbase::listbox::es_lister::bind ( essence ess,
widget wd 
)
inlinenoexcept
void nana::drawerbase::listbox::es_lister::cancel_others_if_single_enabled ( bool  for_selection,
const index_pair except 
)
inline
container& nana::drawerbase::listbox::es_lister::cat_container ( )
inlinenoexcept
const container& nana::drawerbase::listbox::es_lister::cat_container ( ) const
inlinenoexcept
bool nana::drawerbase::listbox::es_lister::cat_status ( size_type  pos,
bool  for_selection 
) const
inline
bool nana::drawerbase::listbox::es_lister::cat_status ( size_type  pos,
bool  for_selection,
bool  value 
)
bool nana::drawerbase::listbox::es_lister::cat_status_reverse ( size_type  pos,
bool  for_selection 
)
inlinenoexcept
void nana::drawerbase::listbox::es_lister::clear ( size_type  cat)
inline
void nana::drawerbase::listbox::es_lister::clear ( )
inline
unsigned nana::drawerbase::listbox::es_lister::column_content_pixels ( size_type  pos) const
category_t* nana::drawerbase::listbox::es_lister::create_category ( std::shared_ptr< nana::detail::key_interface > &  ptr)
inline

will use the key to insert new cat before the first cat with compare less than the key, or at the end of the list of cat and return a ref to that new cat. ?

category_t* nana::drawerbase::listbox::es_lister::create_category ( native_string_type &&  text,
std::size_t  pos = nana::npos 
)
inline

Inserts a new category at position specified by pos.

void nana::drawerbase::listbox::es_lister::disable_single ( bool  for_selection)
inlinenoexcept
size_type nana::drawerbase::listbox::es_lister::distance ( index_pair  from,
index_pair  to 
) const
inline

change to index arg

void nana::drawerbase::listbox::es_lister::emit_cs ( const index_pair pos,
bool  for_selection 
)
inline
bool nana::drawerbase::listbox::es_lister::enable_ordered ( bool  enb)
inlinenoexcept
bool nana::drawerbase::listbox::es_lister::enable_ordered ( ) const
inlinenoexcept
void nana::drawerbase::listbox::es_lister::enable_single ( bool  for_selection,
bool  category_limited 
)
inline
void nana::drawerbase::listbox::es_lister::erase ( const index_pair pos)
void nana::drawerbase::listbox::es_lister::erase ( size_type  cat)
inline
void nana::drawerbase::listbox::es_lister::erase ( )
inline
bool nana::drawerbase::listbox::es_lister::expand ( size_type  cat,
bool  exp 
)
inlinenoexcept
bool nana::drawerbase::listbox::es_lister::expand ( size_type  cat) const
inlinenoexcept
index_pair nana::drawerbase::listbox::es_lister::find_next_good ( index_pair  pos,
bool  ignore_category 
) const
inlinenoexcept

Finds a good item or category if an item specified by pos is invalid.

index_pair nana::drawerbase::listbox::es_lister::first ( ) const
inlinenoexcept

can be used as the absolute position of the first absolute item, or as the display pos of the first displayed item

container::iterator nana::drawerbase::listbox::es_lister::get ( size_type  pos)
inline

categories iterator

container::const_iterator nana::drawerbase::listbox::es_lister::get ( size_type  pos) const
inline
bool nana::drawerbase::listbox::es_lister::good ( size_type  cat) const
inlinenoexcept
bool nana::drawerbase::listbox::es_lister::good ( const index_pair pos) const
inlinenoexcept
bool nana::drawerbase::listbox::es_lister::has_model ( const index_pair pos) const
inline
index_pair nana::drawerbase::listbox::es_lister::index_cast ( const index_pair from,
bool  from_display_order 
) const
inline

Converts an index between display position and absolute real position.

Parameters
fromAn index to be converted
from_display_orderIf this parameter is true, the method convert a display position to the absolute position. If the parameter is false, the method converts an absolute position to the display position.
Returns
A display position or absolute position that are depending on from_display_order.
index_pair nana::drawerbase::listbox::es_lister::index_cast_noexcept ( const index_pair from,
bool  from_display_order,
const index_pair default_value = index_pair{nposnpos} 
) const
inlinenoexcept
void nana::drawerbase::listbox::es_lister::insert ( const index_pair pos,
std::string &&  text,
const std::size_t  columns 
)
inline

Insert before item in absolute "pos" a new item with "text" in column 0, and place it in last display position of this cat.

bool nana::drawerbase::listbox::es_lister::is_single_enabled ( bool  for_selection) const
inlinenoexcept
index_pair nana::drawerbase::listbox::es_lister::last ( ) const
inlinenoexcept

can be used as the absolute position of the last absolute item, or as the display pos of the last displayed item

void nana::drawerbase::listbox::es_lister::move_select ( bool  upwards = true,
bool  unselect_previous = true,
bool  into_view = false 
)
noexcept

is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected

index_pairs nana::drawerbase::listbox::es_lister::pick_items ( bool  for_selection,
bool  find_first = false,
bool *  items_status = nullptr 
) const
inline

return absolute positions, no relative to display

Parameters
for_selectionIndicates whether the selected items or checked items to be returned.
find_firstIndicates whether or not to return the first item which
items_statusa pointer refers to a bool object to receive the status whether the picked items are all selected or all checked, in contrast to for_selectionSelects an item besides the current selected item in the display. we are moving in display, but the selection ocurre in abs position
void nana::drawerbase::listbox::es_lister::scroll_into_view ( const index_pair abs_pos,
view_action  vw_act 
)

Scroll the selected item into the view.

template<typename Pred >
std::vector<std::pair<index_pair, bool> > nana::drawerbase::listbox::es_lister::select_display_range_if ( index_pair  fr_abs,
index_pair  to_dpl,
bool  deselect_others,
Pred  pred 
)
inline
bool nana::drawerbase::listbox::es_lister::select_for_all ( bool  sel,
const index_pair except_abs = index_pair{nposnpos} 
)
inline
bool nana::drawerbase::listbox::es_lister::single_status ( bool  for_selection) const
inlinenoexcept
size_type nana::drawerbase::listbox::es_lister::size_item ( size_type  cat) const
inline
void nana::drawerbase::listbox::es_lister::sort ( )
inline

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

comp(x, y) != comp(x, y)

comp(x, y) != comp(x, y)

const sort_attributes& nana::drawerbase::listbox::es_lister::sort_attrs ( ) const
inlinenoexcept
bool nana::drawerbase::listbox::es_lister::sort_column ( std::size_t  pos,
const bool *  reverse 
)
inline

Sorts the specified column.

It sorts the specified column and invalidates all existing item reference from display position to absolute position. The side effect of this method is that all display positions point to different absolute positions.

Parameters
posThe position of the specified column.
reverseA pointer to a boolean which indicates whether to reverse sort. If this parameter is nullptr, the sort is negated to the current reverse state.
Returns
true if the column is sorted, false otherwise.
void nana::drawerbase::listbox::es_lister::text ( category_t cat,
size_type  pos,
size_type  abs_col,
cell &&  cl,
size_type  columns 
)
inline
void nana::drawerbase::listbox::es_lister::text ( category_t cat,
size_type  pos,
size_type  abs_col,
std::string &&  str,
size_type  columns 
)
inline
size_type nana::drawerbase::listbox::es_lister::the_number_of_expanded ( ) const
inlinenoexcept
static void nana::drawerbase::listbox::es_lister::throw_if_immutable_model ( model_interface model)
inlinestatic
void nana::drawerbase::listbox::es_lister::throw_if_immutable_model ( const index_pair pos) const
inline
std::string nana::drawerbase::listbox::es_lister::to_string ( const export_options exp_opt) const
nana::listbox* nana::drawerbase::listbox::es_lister::wd_ptr ( ) const
inlinenoexcept

Member Data Documentation

std::function<std::function<bool(const ::std::string&, ::nana::any*, const ::std::string&, ::nana::any*, bool reverse)>std::size_t) > nana::drawerbase::listbox::es_lister::fetch_ordering_comparer
index_pair nana::drawerbase::listbox::es_lister::latest_selected_abs