00001 /* 00002 * z2se 00003 * Copyright (C) 2004-2005 emuWorks 00004 * http://games.technoplaza.net/ 00005 * 00006 * This file is part of z2se. 00007 * 00008 * z2se is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * z2se 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 * You should have received a copy of the GNU General Public License 00019 * along with z2se; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 // $Id: MainFrame.hh,v 1.9 2005/08/04 05:23:21 technoplaza Exp $ 00024 00025 #ifndef _MAIN_FRAME_HH 00026 #define _MAIN_FRAME_HH 00027 00028 #include "wx/xrc/xmlres.h" 00029 #include "wx/frame.h" 00030 #include "wx/statusbr.h" 00031 00032 #include "model/SRAMFile.hh" 00033 #include "FileDropTarget.hh" 00034 00035 namespace emuWorks { 00036 class MainFrame : public wxFrame { 00037 public: 00038 MainFrame(); 00039 void CreateControls(); 00040 00041 friend class FileDropTarget; 00042 00043 private: 00044 DECLARE_DYNAMIC_CLASS(MainFrame) 00045 DECLARE_EVENT_TABLE() 00046 00047 /** 00048 * Checks if we have an opem SRAM file. 00049 */ 00050 bool isOpen() const { return open; } 00051 00052 /** 00053 * Sets whether we have an open SRAM file or not. 00054 * 00055 * @param open true if open; false otherwise. 00056 */ 00057 void setOpen(bool open); 00058 00059 /** 00060 * Closes the current SRAM file. 00061 * 00062 * @return true if closed; false otherwise. 00063 */ 00064 bool close(); 00065 00066 /** 00067 * Loads game data into the controls. 00068 * 00069 * @param game Which game to load. 00070 */ 00071 void loadGameData(int game); 00072 00073 /** 00074 * Loads an SRAM file for editing. 00075 * 00076 * @param filename The file to load. 00077 */ 00078 void load(wxString &filename); 00079 00080 /** 00081 * Callback triggered when open is selected from the file menu. 00082 * 00083 * @param event The associated command event. 00084 */ 00085 void fileOpen(wxCommandEvent &event); 00086 00087 /** 00088 * Callback triggered when close is selected from the file menu. 00089 * 00090 * @param event The associated command event. 00091 */ 00092 void fileClose(wxCommandEvent &event); 00093 00094 /** 00095 * Callback triggered when save is selected from the file menu. 00096 * 00097 * @param event The associated command event. 00098 */ 00099 void fileSave(wxCommandEvent &event); 00100 00101 /** 00102 * Callback triggered when save as is selected from the file menu. 00103 * 00104 * @param event The associated command event. 00105 */ 00106 void fileSaveAs(wxCommandEvent &event); 00107 00108 /** 00109 * Callback triggered when exit is selected from the file menu. 00110 * 00111 * @param event The associated command event. 00112 */ 00113 void fileExit(wxCommandEvent &event); 00114 00115 /** 00116 * Callback triggered when the window is being closed. 00117 * 00118 * @param event The associated command event. 00119 */ 00120 void windowClosing(wxCloseEvent &event); 00121 00122 /** 00123 * Callback triggered when the current game is changed. 00124 * 00125 * @param event The associated command event. 00126 */ 00127 void gameChange(wxCommandEvent &event); 00128 00129 /** 00130 * Callback triggered when something on the have menu is selected. 00131 * 00132 * @param event The associated command event. 00133 */ 00134 void multiChange(wxCommandEvent &event); 00135 00136 /** 00137 * Callback triggered when about is selected from the help menu. 00138 * 00139 * @param event The associated command event. 00140 */ 00141 void helpAbout(wxCommandEvent &event); 00142 00143 /** 00144 * Callback triggered when the name is changed. 00145 * 00146 * @param event The associated command event. 00147 */ 00148 void nameChange(wxCommandEvent &event); 00149 00150 /** 00151 * Callback triggered when the play count is changed. 00152 * 00153 * @param event The associated scroll event. 00154 */ 00155 void playCountChange(wxScrollEvent &event); 00156 00157 /** 00158 * Callback triggered when the triforce is changed. 00159 * 00160 * @param event The associated command event. 00161 */ 00162 void triforceChange(wxCommandEvent &event); 00163 00164 /** 00165 * Callback triggered when an experience level is changed. 00166 * 00167 * @param event The associated scroll event. 00168 */ 00169 void levelChange(wxScrollEvent &event); 00170 00171 /** 00172 * Callback triggered when a container value is changed. 00173 * 00174 * @param event The associated scroll event. 00175 */ 00176 void containerChange(wxScrollEvent &event); 00177 00178 /** 00179 * Callback triggered when a technique is changed. 00180 * 00181 * @param event The associated command event. 00182 */ 00183 void techniqueChange(wxCommandEvent &event); 00184 00185 /** 00186 * Callback triggered when a spell is changed. 00187 * 00188 * @param event The associated command event. 00189 */ 00190 void spellChange(wxCommandEvent &event); 00191 00192 /** 00193 * Callback triggered when an item is changed. 00194 * 00195 * @param event The associated command event. 00196 */ 00197 void itemChange(wxCommandEvent &event); 00198 00199 /** 00200 * Callback triggered when a palace seal is changed. 00201 * 00202 * @param event The associated command event. 00203 */ 00204 void sealChange(wxCommandEvent &event); 00205 00206 /** 00207 * Callback triggered when the keys are changed. 00208 * 00209 * @param event The associated scroll event. 00210 */ 00211 void keyChange(wxScrollEvent &event); 00212 00213 bool open; 00214 00215 SRAMFile *sram; 00216 00217 wxMenuItem *fileCloseItem; 00218 wxMenuItem *fileSaveItem; 00219 wxMenuItem *fileSaveAsItem; 00220 wxMenuItem *gameItems[3]; 00221 00222 wxPanel *panel; 00223 00224 wxTextCtrl *nameText; 00225 wxSlider *playCountSlider; 00226 wxCheckBox *triforceCheck; 00227 00228 wxSlider *swordLevelSlider; 00229 wxSlider *magicLevelSlider; 00230 wxSlider *lifeLevelSlider; 00231 00232 wxSlider *magicContainerSlider; 00233 wxSlider *lifeContainerSlider; 00234 00235 wxCheckBox *downwardThrustCheck; 00236 wxCheckBox *upwardThrustCheck; 00237 00238 wxCheckBox *shieldCheck; 00239 wxCheckBox *jumpCheck; 00240 wxCheckBox *lifeCheck; 00241 wxCheckBox *fairyCheck; 00242 wxCheckBox *fireCheck; 00243 wxCheckBox *reflectCheck; 00244 wxCheckBox *spellCheck; 00245 wxCheckBox *thunderCheck; 00246 00247 wxCheckBox *candleCheck; 00248 wxCheckBox *gloveCheck; 00249 wxCheckBox *raftCheck; 00250 wxCheckBox *bootsCheck; 00251 wxCheckBox *crossCheck; 00252 wxCheckBox *fluteCheck; 00253 wxCheckBox *magicKeyCheck; 00254 wxCheckBox *hammerCheck; 00255 00256 wxCheckBox *palaceCheck[6]; 00257 wxSlider *keySlider; 00258 00259 /** 00260 * XPM icon used for the Frame icon. 00261 */ 00262 static const char *ICON[]; 00263 }; 00264 } 00265 00266 #endif