diff options
Diffstat (limited to 'menuitems.c')
-rw-r--r-- | menuitems.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/menuitems.c b/menuitems.c index c07ad2a7..659c1a58 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 4.1 2015/07/18 10:38:31 kls Exp $ + * $Id: menuitems.c 4.2 2015/09/08 10:25:23 kls Exp $ */ #include "menuitems.h" @@ -774,6 +774,26 @@ void cMenuEditStraItem::Set(void) SetValue(strings[*value]); } +// --- cMenuEditStrlItem ----------------------------------------------------- + +cMenuEditStrlItem::cMenuEditStrlItem(const char *Name, char *Value, int Length, const cStringList *Strings) +:cMenuEditIntItem(Name, &index, 0, Strings->Size() - 1) +{ + strings = Strings; + value = Value; + length = Length; + index = strings->Find(value); + if (index < 0) + index = 0; + Set(); +} + +void cMenuEditStrlItem::Set(void) +{ + strn0cpy(value, strings->At(index), length); + SetValue(value); +} + // --- cMenuEditChanItem ----------------------------------------------------- cMenuEditChanItem::cMenuEditChanItem(const char *Name, int *Value, const char *NoneString) |