FIX: trace the whole cat when selected, not just the last item

This commit is contained in:
qPCR4vir
2015-05-05 13:50:30 +02:00
parent 8aec3159b3
commit 52d040a95d

View File

@@ -1595,26 +1595,21 @@ namespace nana
bool categ_selected(size_type cat, bool sel) bool categ_selected(size_type cat, bool sel)
{ {
bool changed = false; bool changed = false;
auto & items = _m_at(cat)->items;
index_pair pos(cat, 0); cat_proxy cpx{ess_,cat};
for(auto & m : items) for (item_proxy &it : cpx )
{ {
if(m.flags.selected != sel) if (it.selected() != sel)
{
m.flags.selected = sel;
arg_listbox arg{ item_proxy(ess_, pos), sel };
wd_ptr()->events().selected.emit(arg);
changed = true; changed = true;
it.select(sel);
if (sel) // not check for single_selection_ if (sel) // not check for single_selection_
last_selected_abs = pos; last_selected_abs = it->pos();
else if (last_selected_abs == pos)
else if (last_selected_abs == it->pos())
last_selected_abs.set_both(npos); last_selected_abs.set_both(npos);
} }
++pos.item; last_selected_abs = index_pair{cat,npos};
}
return changed; return changed;
} }