00001 00011 /*************************************************************************** 00012 * Copyright (C) 2007 by Jan Koci * 00013 * honza.koci@email.cz * 00014 * http://kengine.sourceforge.net/tutorial/ 00015 * * 00016 * This program is free software; you can redistribute it and/or modify * 00017 * it under the terms of the GNU General Public License as published by * 00018 * the Free Software Foundation; either version 2 of the License, or * 00019 * (at your option) any later version. * 00020 * * 00021 * This program is distributed in the hope that it will be useful, * 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00024 * GNU General Public License for more details. * 00025 * * 00026 * You should have received a copy of the GNU General Public License * 00027 * along with this program; if not, write to the * 00028 * Free Software Foundation, Inc., * 00029 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00030 ***************************************************************************/ 00031 00032 #pragma once 00033 00034 #include <guichan.hpp> 00035 #include "../System/K3dTypedef.h" 00036 #include "K3dGuiObject.h" 00037 00038 00047 class K3dGuiListModel: public gcn::ListModel, public K3dGuiObject 00048 { 00049 TStringArray m_tStrArray; 00050 public: 00051 00052 K3dGuiListModel() 00053 { 00054 } 00055 ~K3dGuiListModel() 00056 { 00057 m_tStrArray.clear(); 00058 } 00059 00060 void AddElement ( std::string _strEl ) 00061 { 00062 m_tStrArray.push_back ( _strEl ); 00063 } 00064 00065 void DeleteElements() 00066 { 00067 m_tStrArray.clear(); 00068 } 00069 00070 int getNumberOfElements() 00071 { 00072 return ( int ) m_tStrArray.size(); 00073 } 00074 00075 std::string getElementAt ( int i ) 00076 { 00077 return m_tStrArray[i]; 00078 } 00079 }; 00080