Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

WiPara.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net)
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
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 }

Generated on Wed Jun 1 09:54:32 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2