00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef _MAINWINDOW_H
00024
#define _MAINWINDOW_H
00025
00026
00027
#include "Grid.h"
00028
#include "DotCursor.h"
00029
00030
00031
00032
using gui::SDLControl;
00033
using gui::Color;
00034
using gui::TTFont;
00035
using gui::Static;
00036
using gui::Edit;
00037
using gui::Surface;
00038
using gui::Button;
00039
using gui::Output;
00040
using gui::surface_event_t;
00041
using gui::coord_t;
00042
00043
class MenuDialog;
00044
class OptionsDialog;
00045
class LoginDialog;
00046
class PlayerDialog;
00047
class TextDialog;
00048
class ConnectThread;
00049
class TestMenu;
00050
class Grid;
00051
class Player;
00052
class DotCursor;
00053
class DotMenu;
00054
00055
00056 typedef struct mapdotstruct
00057 {
00058 int x;
00059 int y;
00060 long cx;
00061 long cy;
00062 }
MAPDOT;
00063
00064 typedef std::vector<MAPDOT *>
mapdots_t;
00065
00066 class MainWindow :
public gui::Surface
00067 {
00068
public:
00069
MainWindow(SDLControl *);
00070
~MainWindow();
00071
00072
void Draw();
00073
void AddLine(
const string &);
00074
#ifdef USE_IMAGE
00075
void MoveImage(
int,
int);
00076
#endif
00077
void ShowMenu();
00078
void ShowOptions();
00079
void ShowLogin(Form::Form *);
00080
void ShowPlayers(Form::Form *,vector<string> &);
00081
void ShowText();
00082
00083
void OnEvent(surface_event_t *);
00084
void OnMouseMove(coord_t,coord_t,coord_t,coord_t);
00085
void OnRightClick(coord_t,coord_t);
00086
00087
void Connect();
00088
void Disconnect();
00089 Surface *
GetInput();
00090
void SetAngles(
double,
double);
00091
void IncreaseBase();
00092
void DecreaseBase();
00093
void Redraw();
00094
00095
static Grid m_grid;
00096
00097
private:
00098
int Get_h(
long,
long);
00099
int Get_t_left(
long,
long);
00100
int Get_t_up(
long,
long);
00101 TTFont
courier8;
00102 Edit
m_guiInput;
00103 MenuDialog *
m_pclMenuDialog;
00104 OptionsDialog *
m_pclOptionsDialog;
00105 LoginDialog *
m_pclLoginDialog;
00106 PlayerDialog *
m_pclPlayerDialog;
00107 TextDialog *
m_pclTextDialog;
00108 ConnectThread *
m_pclConnectThread;
00109 TestMenu *
m_pclTestMenu;
00110 DotMenu *
m_dotMenu;
00111
#ifdef USE_IMAGE
00112
SDL_Surface *m_image;
00113
int m_image_x;
00114
int m_image_y;
00115
#endif
00116 double m_test_v;
00117 double m_test_v_vertikal;
00118 mapdots_t m_dots;
00119 MAPDOT *
m_dot;
00120 DotCursor m_dc;
00121 };
00122
00123
00124
#endif // _MAINWINDOW_H