Odamex
Setting the Standard in Multiplayer Doom
odalaunch/src/dlg_config.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: dlg_config.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 //      Config dialog
00020 //  AUTHOR:     Russell Rice, John D Corrado
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 
00025 #ifndef DLG_CONFIG_H
00026 #define DLG_CONFIG_H
00027 
00028 // configuration file structure
00029 struct launchercfg_t
00030 {
00031     bool     get_list_on_start;
00032     bool     show_blocked_servers;
00033     wxString    wad_paths;
00034     wxString    odamex_directory;
00035 };
00036 
00037 #include <wx/dialog.h>
00038 #include <wx/intl.h>
00039 #include <wx/settings.h>
00040 #include <wx/stattext.h>
00041 #include <wx/xrc/xmlres.h>
00042 #include <wx/listctrl.h>
00043 #include <wx/fileconf.h>
00044 #include <wx/checkbox.h>
00045 #include <wx/listbox.h>
00046 #include <wx/sizer.h>
00047 #include <wx/textctrl.h>
00048 #include <wx/filepicker.h>
00049 #include <wx/spinctrl.h>
00050 #include <wx/statbmp.h>
00051 
00052 // config file value names
00053 #define GETLISTONSTART      "GET_LIST_ON_START"
00054 #define SHOWBLOCKEDSERVERS  "SHOW_BLOCKED_SERVERS"
00055 #define DELIMWADPATHS       "DELIMITED_WAD_PATHS"
00056 #define ODAMEX_DIRECTORY    "ODAMEX_DIRECTORY"
00057 #define EXTRACMDLINEARGS    "ExtraCommandLineArguments"
00058 #define MASTERTIMEOUT       "MasterTimeout"
00059 #define SERVERTIMEOUT       "ServerTimeout"
00060 
00061 #ifdef __WXMSW__
00062 #define PATH_DELIMITER ';'
00063 #else
00064 #define PATH_DELIMITER ':'
00065 #endif
00066 
00067 // a more dynamic way of adding environment variables, even if they are
00068 // hardcoded.
00069 #define NUM_ENVVARS 2
00070 const wxString env_vars[NUM_ENVVARS] = { _T("DOOMWADDIR"), _T("DOOMWADPATH") };
00071 
00072 class dlgConfig: public wxDialog
00073 {
00074         public:
00075 
00076                 dlgConfig(launchercfg_t *cfg, wxWindow* parent, wxWindowID id = -1);
00077                 virtual ~dlgConfig();
00078 
00079         void LoadSettings();
00080         void SaveSettings();
00081 
00082         void Show();
00083 
00084         protected:
00085         void OnOK(wxCommandEvent &event);
00086         
00087         void OnChooseDir(wxFileDirPickerEvent &event);
00088         void OnAddDir(wxCommandEvent &event);
00089         void OnReplaceDir(wxCommandEvent &event);
00090         void OnDeleteDir(wxCommandEvent &event);
00091         
00092         void OnUpClick(wxCommandEvent &event);
00093         void OnDownClick(wxCommandEvent &event);
00094         
00095         void OnGetEnvClick(wxCommandEvent &event);
00096         
00097         void OnCheckedBox(wxCommandEvent &event);
00098         
00099         void OnChooseOdamexPath(wxFileDirPickerEvent &event);
00100         
00101         void OnTextChange(wxCommandEvent &event);
00102 
00103         void OnSpinValChange(wxSpinEvent &event);
00104         
00105         wxCheckBox *m_ChkCtrlGetListOnStart;
00106         wxCheckBox *m_ChkCtrlShowBlockedServers;
00107 
00108         wxListBox *m_LstCtrlWadDirectories;
00109 
00110         wxDirPickerCtrl *m_DirCtrlChooseWadDir;
00111 
00112         wxDirPickerCtrl *m_DirCtrlChooseOdamexPath;
00113 
00114         wxSpinCtrl *m_SpnCtrlMasterTimeout;
00115         wxSpinCtrl *m_SpnCtrlServerTimeout;
00116         wxTextCtrl *m_TxtCtrlExtraCmdLineArgs;
00117 
00118         wxSpinCtrl *m_SpnCtrlPQGood;
00119         wxSpinCtrl *m_SpnCtrlPQPlayable;
00120         wxSpinCtrl *m_SpnCtrlPQLaggy;
00121 
00122         wxStaticBitmap *m_StcBmpPQGood;
00123         wxStaticBitmap *m_StcBmpPQPlayable;
00124         wxStaticBitmap *m_StcBmpPQLaggy;
00125         wxStaticBitmap *m_StcBmpPQBad;
00126 
00127         wxFileConfig ConfigInfo;
00128 
00129         launchercfg_t *cfg_file;
00130         
00131         bool UserChangedSetting;
00132 
00133         private:
00134 
00135                 DECLARE_EVENT_TABLE()
00136 };
00137 
00138 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends