00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00044 virtual void display();
00045 virtual void hide();
00046
00047
00048 virtual void buttonDown(unsigned int id);
00049
00050
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
00057 virtual void textChanged(unsigned int id, const LangString &text);
00058
00059
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