From d73230cdb22ebb8444a12e842ab196a8dd6972a7 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 16 Sep 2009 19:26:56 +0000 Subject: [PATCH] if GetStringHelper is set in Menu, invoke it previously it always returned raw string and ignored this helper function, but there might be cases when one would want to use its own function e.g. to parse the string somehow. --- src/menu.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/menu.cpp b/src/menu.cpp index e746db53..7b8095f5 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -47,5 +47,14 @@ bool List::Deselect() template <> std::string Menu::GetOption(size_t pos) { - return itsOptionsPtr->at(pos) ? (*itsOptionsPtr)[pos]->Item : ""; + if (itsOptionsPtr->at(pos)) + { + if (itsGetStringFunction) + return itsGetStringFunction((*itsOptionsPtr)[pos]->Item, itsGetStringFunctionUserData); + else + return (*itsOptionsPtr)[pos]->Item; + } + else + return ""; } +