Odamex
Setting the Standard in Multiplayer Doom
odalaunch/src/dlg_servers.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: dlg_servers.h 1788 2010-08-24 04:42:57Z russellrice $
00005 //
00006 // Copyright (C) 2006-2010 by The Odamex Team.
00007 //
00008 // This program is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU General Public License
00010 // as published by the Free Software Foundation; either version 2
00011 // of the License, or (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // DESCRIPTION:
00019 //      Custom Servers dialog
00020 //  AUTHOR:     Russell Rice, John D Corrado
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 
00025 #ifndef DLG_SERVERS_H
00026 #define DLG_SERVERS_H
00027 
00028 #include <wx/dialog.h>
00029 #include <wx/intl.h>
00030 #include <wx/settings.h>
00031 #include <wx/stattext.h>
00032 #include <wx/xrc/xmlres.h>
00033 #include <wx/listctrl.h>
00034 #include <wx/fileconf.h>
00035 #include <wx/checkbox.h>
00036 #include <wx/listbox.h>
00037 #include <wx/sizer.h>
00038 #include <wx/textctrl.h>
00039 #include <wx/checklst.h>
00040 #include <wx/textdlg.h>
00041 
00042 #include "net_packet.h"
00043 
00044 #include <vector>
00045 
00046 typedef struct
00047 {
00048     bool     Enabled;
00049     wxString Address;
00050     wxUint16 Port;
00051 } CS_Subst_t;
00052 
00053 typedef struct
00054 {
00055     wxString Address;
00056     wxUint16 Port;
00057     
00058     CS_Subst_t Subst;
00059 } CustomServer_t;
00060 
00061 class dlgServers: public wxDialog
00062 {
00063         public:
00064 
00065                 dlgServers(MasterServer *ms, wxWindow* parent, wxWindowID id = -1);
00066                 virtual ~dlgServers();
00067 
00068         CustomServer_t GetCustomServer(wxUint32);
00069 
00070         protected:
00071 
00072         void OnServerList(wxCommandEvent &event);
00073         void OnSubstChecked(wxCommandEvent &event);
00074 
00075         void OnButtonOK(wxCommandEvent &event);
00076         void OnButtonClose(wxCommandEvent &event);
00077         
00078         void OnButtonAddServer(wxCommandEvent &event);
00079         void OnButtonReplaceServer(wxCommandEvent &event);
00080         void OnButtonDeleteServer(wxCommandEvent &event);
00081         
00082         void OnButtonMoveServerUp(wxCommandEvent &event);
00083         void OnButtonMoveServerDown(wxCommandEvent &event);
00084 
00085         void ChkSetValueEx(wxInt32 XrcId, wxCheckBox *CheckBox, bool checked);
00086 
00087         wxFileConfig ConfigInfo;
00088 
00089         wxListBox *SERVER_LIST;
00090         wxTextCtrl *TEXT_SUBSTITUTE;
00091         wxCheckBox *CHECK_SUBSTITUTE;
00092                 
00093                 wxButton *ADD_SERVER_BUTTON;
00094                 wxButton *DEL_SERVER_BUTTON;
00095         wxButton *UP_SERVER_BUTTON;
00096         wxButton *DOWN_SERVER_BUTTON;
00097 
00098                 wxButton *CLOSE_BUTTON;
00099                 wxButton *OK_BUTTON;
00100 
00101         void SaveSettings();   
00102         void LoadSettings();
00103         
00104         void LoadServersIn();
00105 
00106         bool UserChangedSetting;
00107 
00108         MasterServer *MServer;
00109 
00110         private:
00111 
00112                 DECLARE_EVENT_TABLE()
00113 };
00114 
00115 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends