00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "WiPara.h"
00010
00011 #include "WiLabel.h"
00012 #include "StringTool.h"
00013
00014
00015 WiPara::WiPara(const std::string &text, const Font &font,
00016 const SDL_Color &color)
00017 {
00018 const std::string space = " ";
00019 StringTool::t_args lines = StringTool::split(text, '\n');
00020 for (unsigned int i = 0; i < lines.size(); ++i) {
00021 std::string line = lines[i];
00022 if (line.empty()) {
00023 line = space;
00024 }
00025 addWidget(new WiLabel(line, font, color));
00026 }
00027 }