From 063968a803ec5daf71311aaab87da85495b6c02b Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sat, 25 Apr 2015 10:16:51 +0200 Subject: [PATCH] working on listbox export to string CSV: listbox, header, dummy list --- source/gui/widgets/listbox.cpp | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index daf9bc2f..506c7f38 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -333,6 +333,24 @@ namespace nana typedef std::vector container; + nana::string to_string() const + { + nana::string sep{STR(";")}, endl{STR("\n")}, head_str; + bool first{true}; + for(auto & i: cont()) + { + if(i.visible) + { + if(first) + first=false; + else + head_str += sep; + head_str += i.text; + } + } + return head_str; + } + bool visible() const { return visible_; @@ -651,6 +669,39 @@ namespace nana } return nullptr; } + nana::string to_string() const + { + nana::string sep{STR(";")}, endl{STR("\n")}, list_str{STR("Empieza list: ")}; + bool first{true}; + for(auto & cat: cat_container()) + { + list_str += STR("categorias: ") ; + if(first) + first=false; + else + { + //if(cat.selected()) + list_str += (cat.text + STR("categorias 2 ") + endl); + } + list_str += STR("categorias: ") ; + bool first_it{true}; + for (auto i : cat.sorted) + { + auto& it= cat.items[i] ; + if(it.flags.selected) + { + list_str += (it.cells[0].text + endl); + if(first_it) + first_it=false; + else + { + } + } + + } + } + return list_str + STR("Termina: "); + } /// each sort() ivalidate any existing reference from display position to absolute item, that is after sort() display offset point to different items void sort() @@ -1838,6 +1889,13 @@ namespace nana lister.fetch_ordering_comparer = std::bind(&es_header::fetch_comp, &header, std::placeholders::_1); } + nana::string to_string() const + { + nana::string sep{STR(";")}, endl{STR("\n")}; + lister.to_string(); + return header.to_string() + endl + lister.to_string() ; + } + const index_pair& scroll_y_abs() const { return scroll.offset_y_abs;