NetworkSelectDialog.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #if !defined(__INCLUDE_NetworkSelectDialogh_INCLUDE__)
00022 #define __INCLUDE_NetworkSelectDialogh_INCLUDE__
00023 
00024 #include <GLW/GLWWindow.h>
00025 #include <GLW/GLWTextButton.h>
00026 #include <GLW/GLWIconTable.h>
00027 #include <GLW/GLWTextBox.h>
00028 #include <GLW/GLWDropDownText.h>
00029 #include <common/ToolTip.h>
00030 
00031 class NetworkSelectDialog : 
00032         public GLWWindow,
00033         public GLWButtonI,
00034         public GLWIconTableI,
00035         public GLWTextBoxI,
00036         public GLWDropDownI
00037 {
00038 public:
00039         static NetworkSelectDialog *instance();
00040 
00041         virtual void simulate(float frameTime);
00042 
00043         // GLWWindow
00044         virtual void display();
00045         virtual void hide();
00046 
00047         // GLWButtonI
00048         virtual void buttonDown(unsigned int id);
00049 
00050         // GLWIconTableI
00051         virtual void drawColumn(unsigned int id, int row, int column, float x, float y, float w);
00052         virtual void rowSelected(unsigned int id, int row);
00053         virtual void rowChosen(unsigned int id, int row);
00054         virtual void columnSelected(unsigned int id, int col);
00055 
00056         // GLWTextBoxI
00057         virtual void textChanged(unsigned int id, const LangString &text);
00058 
00059         // GLWDropDownI
00060         virtual void select(unsigned int id, const int pos, GLWSelectorEntry value);
00061 
00062 protected:
00063         static NetworkSelectDialog *instance_;
00064 
00065         float totalTime_;
00066         GLTexture *okTex_, *questionTex_;
00067         GLTexture *warningTex_, *noentryTex_;
00068         GLTexture *tankTex_, *exclaimTex_;
00069         GLTexture *keyTex_, *cogTex_;
00070         GLWIconTable *gamesIconTable_;
00071         GLWIconTable *playersIconTable_;
00072         GLWTextButton *ok_, *refresh_, *favourites_;
00073         GLWTextBox *ipaddress_;
00074         GLWDropDownText *refreshType_;
00075         unsigned int invalidateId_;
00076         unsigned int cancelId_, addFavouriteId_;
00077         ToolTip colToolTip_;
00078 
00079         void updateTable();
00080         void startRefresh();
00081         void stopRefresh();
00082         bool serverCompatable(std::string pversion, std::string version);
00083         GLTexture *getTexture(int row, LangString *&message);
00084         void drawIcon(GLTexture *tex, float &x, float y, LangString &message);
00085 
00086         void drawColumnGames(unsigned int id, int row, int column, float x, float y, float w);
00087         void drawColumnPlayers(unsigned int id, int row, int col, float x, float y, float w);
00088         void rowSelectedGames(unsigned int id, int row);
00089         void rowChosenGames(unsigned int id, int row);
00090         void columnSelectedGames(unsigned int id, int col);
00091 
00092 private:
00093         NetworkSelectDialog();
00094         virtual ~NetworkSelectDialog();
00095 
00096 };
00097 
00098 #endif

Generated on Mon Feb 16 15:14:37 2009 for Scorched3D by  doxygen 1.5.3