Back to index

extremetuxracer  0.5beta
event_select.h
Go to the documentation of this file.
00001 /* 
00002  * PPRacer 
00003  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #ifndef _EVENT_SELECT_H_
00021 #define _EVENT_SELECT_H_
00022 
00023 #include "loop.h"
00024 
00025 #include "course_mgr.h"
00026 
00027 #include "model_hndl.h"
00028 
00029 #include "ppgltk/button.h"
00030 #include "ppgltk/ssbutton.h"
00031 #include "ppgltk/listbox.h"
00032 #include "ppgltk/label.h"
00033 #include "ppgltk/entry.h"
00034 
00035 class EventSelect : public GameMode
00036 {
00037        pp::Listbox<EventData>* mp_eventListbox;
00038        pp::Listbox<CupData>* mp_cupListbox;
00039        pp::Vec2d mp_cupListbox_pos;
00040        pp::Vec2d mp_cupListbox_size;
00041        
00042        std::list<EventData>::iterator m_curEvent;
00043        std::list<CupData>::iterator m_curCup;
00044        
00045        bool m_curCupComplete;
00046        bool m_curCupPlayable;
00047        
00048        pp::Button* mp_backBtn;
00049        pp::Button* mp_continueBtn;
00050     
00051     std::list<model_t> m_modelList;
00052     
00053     pp::SSButton* mp_modelSSBtn;
00054     pp::Listbox<model_t>* mp_modelEnt;
00055               
00056        pp::Label *mp_titleLbl;
00057        pp::Label *mp_eventLbl;
00058        pp::Label *mp_cupLbl;
00059        pp::Label *mp_statusLbl;
00060        pp::Label *mp_nameLbl;
00061        
00062        pp::Entry *mp_nameEnt; 
00063        
00064        void updateCupStates();
00065        void updateButtonEnabledStates();
00066        
00067 public:
00068        EventSelect();
00069        ~EventSelect();
00070 
00071        void loop(float timeStep);
00072 
00073        void cupChanged();
00074        void eventChanged();
00075     void listboxModelChange();
00076     void buttonModelChange();
00077 
00078        void back();
00079        void apply();
00080        
00081        bool keyPressEvent(SDLKey key);
00082 };
00083 
00084 #endif // _EVENT_SELECT_H_