diff --git a/src/flistview.cpp b/src/flistview.cpp index 1e9fdcce..4ef43adb 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -1428,33 +1428,46 @@ inline void FListView::mapKeyFunctions() key_map_result[FKey('-')] = [this] { return collapseSubtree(); }; } +//---------------------------------------------------------------------- +std::vector FListView::getmultimark() +{ + return multi; +} +//---------------------------------------------------------------------- +void FListView::setmultimark(std::vector mark) +{ + multi=mark; +} //---------------------------------------------------------------------- void FListView::setindex(int index) { - if (index==-666) + if (index<0) current_iter=getNullIterator(); else { current_iter=itemlist.begin(); current_iter+=index; - scrollToY(index); } draw(); } //---------------------------------------------------------------------- void FListView::setmark(int index) { - if (index==-666) + if (index<0) current_iter=getNullIterator(); else { mark_iter=itemlist.begin(); mark_iter+=index; - scrollToY(index); } draw(); } //---------------------------------------------------------------------- +int FListView::getmark() +{ + return mark_iter.getPosition(); +} +//---------------------------------------------------------------------- int FListView::getindex() { return current_iter.getPosition(); @@ -1641,7 +1654,13 @@ void FListView::drawList() { const bool is_current_line( iter == current_iter ); const bool is_current_mark( iter == mark_iter ); - const bool is_current_selected=false; + bool is_current_selected=false; + for(int item: multi) + if (item==current_iter.getPosition()) + { + is_current_selected=true; + break; + } const auto& item = static_cast(*iter); const int tree_offset = tree_view ? int(item->getDepth() << 1) + 1 : 0; const int checkbox_offset = item->isCheckable() ? 1 : 0; @@ -1825,7 +1844,7 @@ inline void FListView::setLineAttributes ( bool is_current unsetBold(); } if ( is_selected ) - setColor ( FColor::White , FColor::Black ); + setColor ( FColor::White , FColor::Green ); if ( is_mark ) setColor ( FColor::White, FColor::Red ); } diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 2cf341c0..e4193cf0 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -342,7 +342,10 @@ class FListView : public FWidget // Methods int getindex(); void setindex(int); + int getmark(); void setmark(int); + std::vector getmultimark(); + void setmultimark(std::vector mark); virtual int addColumn (const FString&, int = USE_MAX_SIZE); void hide() override; iterator insert (FListViewItem*); @@ -527,7 +530,7 @@ class FListView : public FWidget bool tree_view{false}; bool hide_sort_indicator{false}; bool has_checkable_items{false}; - + std::vector multi; // Function Pointer bool (*user_defined_ascending) (const FObject*, const FObject*){nullptr}; bool (*user_defined_descending) (const FObject*, const FObject*){nullptr};