From 2cb9b461358796fd06d3c453bd1a6eb388e5c0bf Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 17 Feb 2009 10:03:21 +0100 Subject: [PATCH] use vector of pointers to options rather than vector of options this way I can implement options filtering with much less effort. --- src/menu.h | 164 +++++++++++++++++++++------------------------ src/tag_editor.cpp | 4 +- 2 files changed, 78 insertions(+), 90 deletions(-) diff --git a/src/menu.h b/src/menu.h index f60621de..5172e7ee 100644 --- a/src/menu.h +++ b/src/menu.h @@ -56,16 +56,18 @@ template class Menu : public Window, public List struct Option { - Option() : Item(0), isBold(0), isSelected(0), isStatic(0), haveSeparator(0) { } - T *Item; + Option() : isBold(0), isSelected(0), isStatic(0) { } + Option(const T &t, bool is_bold, bool is_static) : + Item(t), isBold(is_bold), isSelected(0), isStatic(is_static) { } + + T Item; bool isBold; bool isSelected; bool isStatic; - bool haveSeparator; }; - typedef typename std::vector