From 31639cb34d88609c562ce1f0ce116873465b2b72 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 5 May 2015 13:53:27 +0200 Subject: [PATCH] to find the first item or cat --- source/gui/widgets/listbox.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index a44d7d47..2de8d4c2 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -1639,7 +1639,20 @@ namespace nana /// absolute position of the last displayed item index_pair last_displ() const { - return absolute ( last_displ() ); + return absolute ( last() ); + } + + /// can be used as the absolute position of the first absolute item, or as the display pos of the first displayed item + index_pair first() const + { + index_pair fst{0,npos}; + good_item(fst,fst); + return fst; + } + /// absolute position of the first displayed item + index_pair first_displ() const + { + return absolute ( first() ); } bool good(size_type cat) const