=== modified file 'win32/WinUtil.cpp' --- win32/WinUtil.cpp 2010-01-19 23:27:03 +0000 +++ win32/WinUtil.cpp 2010-01-20 15:13:33 +0000 @@ -657,7 +657,45 @@ if(j == string::npos) break; - string name = uc.getCommand().substr(i, j - i); + string tmp = uc.getCommand().substr(i, j - i); + string name = tmp; + TStringList values; + string::size_type pos1 = 0; + string::size_type pos2 = 0; + pos1 = tmp.find("/", pos1); + if(pos1 != string::npos){ + name = tmp.substr(0, pos1); + + } + dcdebug("name %s\n", name.c_str()); + + while((pos1 = tmp.find("/", pos1))!=string::npos){ + + pos1 +=1; + pos2 = tmp.find("/", pos1); + + + if(tmp.length() >= pos2+1){ + if(tmp.substr(pos2+1, 1)== "/") + pos2 = tmp.find("/", pos2+2); + } + if(pos2 != string::npos){ + string final = tmp.substr(pos1, pos2-pos1); + if(values.size() == 0) + Util::replace("//", "/",final); + values.push_back(Text::toT(final)); + pos1 = pos2; + + }else{ + values.push_back(Text::toT(tmp.substr(pos1))); + break; + } + + } + + + + if(find(names.begin(), names.end(), name) == names.end()) { string caption = name; /// @todo use the bool in UserCommand when we have one @@ -665,8 +703,17 @@ Util::replace("\\\\", "\\", caption); Util::replace("\\s", " ", caption); } - - dlg.addTextBox(Text::toT(caption), Text::toT(sm["line:" + name])); + if(values.size()>0){ + TStringIter i = values.begin(); + size_t sel= Util::toUInt(Text::fromT(*i)); + if(sel>0) + sel-=1; + values.erase(i); + dlg.addComboBox(Text::toT(caption), values, sel); + }else{ + dlg.addTextBox(Text::toT(caption), Text::toT(sm["line:" + name])); + } + names.push_back(name); } i = j + 1;