00001 /* 00002 * Metroid Password Generator 00003 * Copyright (C) 2005 emuWorks 00004 * http://games.technoplaza.net/ 00005 * 00006 * This file is part of Metroid Password Generator. 00007 * 00008 * Metroid Password Generator is free software; you can redistribute it and/or 00009 * modify 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 * Metroid Password Generator 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 Metroid Password Generator; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 // $Id: MPGFrame.hh,v 1.28 2005/09/29 05:42:31 technoplaza Exp $ 00024 00025 #ifndef _MPGFRAME_HH_ 00026 #define _MPGFRAME_HH_ 00027 00028 #include <wx/spinctrl.h> 00029 00030 #include "model/Password.hh" 00031 00032 namespace mpg { 00033 class PasswordPanel; 00034 00035 /// The main application frame 00036 class MPGFrame : public wxFrame { 00037 DECLARE_CLASS(MPGFrame) 00038 DECLARE_EVENT_TABLE() 00039 00040 private: 00041 wxButton *fixChecksumButton; 00042 Password password; 00043 bool ignoreTextEvent, pal; 00044 00045 enum { 00046 BRINSTAR, KRAIDSLAIR, NORFAIR, RIDLEYSLAIR, TOURIAN 00047 }; 00048 00049 static const int MAX_MISSILES = 255; 00050 00051 /** 00052 * Creates the controls for this MPGFrame. 00053 */ 00054 void CreateControls(); 00055 00056 /** 00057 * Gets the metroid password from the password text control removing the 00058 * separating spaces. 00059 * 00060 * @return The password sans separating spaces. 00061 */ 00062 wxString getUnifiedPassword() const; 00063 00064 /** 00065 * Updates all the controls based on the current password data. 00066 */ 00067 void updateControls(); 00068 00069 /** 00070 * Updates the text password when the password data has changed. 00071 */ 00072 void updatePasswordText(); 00073 00074 /** 00075 * Updates the raw game time bits. 00076 * 00077 * @param value The game time value. 00078 */ 00079 void updateRawGameTime(wxUint32 value); 00080 00081 /** 00082 * Updates the raw missile bits. 00083 * 00084 * @param value The missile count value. 00085 */ 00086 void updateRawMissiles(unsigned char value); 00087 00088 /** 00089 * Updates the approximate real time label. 00090 */ 00091 void updateRealTime(); 00092 00093 /** 00094 * Updates the start location radio box control. 00095 */ 00096 void updateStartLocation(); 00097 00098 /** 00099 * Updates the sizes for the text controls so they are wide enough. 00100 */ 00101 void updateTextCtrlSizes(); 00102 00103 /** 00104 * Called when Samus's armor is changed. 00105 * 00106 * @param event The triggering wxCommandEvent. 00107 */ 00108 void onArmorChanged(wxCommandEvent &event); 00109 00110 /** 00111 * Called when a boss checkbox is changed. 00112 * 00113 * @param event The triggering wxCommandEvent. 00114 */ 00115 void onBossChanged(wxCommandEvent &event); 00116 00117 /** 00118 * Called when a door checkbox is changed. 00119 * 00120 * @param event The triggering wxCommandEvent. 00121 */ 00122 void onDoorChanged(wxCommandEvent &event); 00123 00124 /** 00125 * Called when an energy tank checkbox is changed. 00126 * 00127 * @param event The triggering wxCommandEvent. 00128 */ 00129 void onEnergyTankChanged(wxCommandEvent &event); 00130 00131 /** 00132 * Called when exit is selected from the file menu. 00133 * 00134 * @param event The triggering wxCommandEvent (unused). 00135 */ 00136 void onFileExit(wxCommandEvent &event); 00137 00138 /** 00139 * Called when the fix checksum button is pressed. 00140 * 00141 * @param event The triggering wxCommandEvent (unused). 00142 */ 00143 void onFixChecksum(wxCommandEvent &event); 00144 00145 /** 00146 * Called when NTSC or PAL is selected from the game menu. 00147 * 00148 * @param event The triggering wxCommandEvent. 00149 */ 00150 void onGameChanged(wxCommandEvent &event); 00151 00152 /** 00153 * Called when the game time is changed. 00154 * 00155 * @param event The triggering wxCommandEvent. 00156 */ 00157 void onGameTimeChanged(wxCommandEvent &event); 00158 00159 /** 00160 * Called when about from the help menu is selected. 00161 * 00162 * @param event The triggering wxCommandEvent (unused). 00163 */ 00164 void onHelpAbout(wxCommandEvent &event); 00165 00166 /** 00167 * Called when an item checkbox is changed. 00168 * 00169 * @param event The triggering wxCommandEvent. 00170 */ 00171 void onItemChanged(wxCommandEvent &event); 00172 00173 /** 00174 * Called when a missile container checkbox is changed. 00175 * 00176 * @param event The triggering wxCommandEvent. 00177 */ 00178 void onMissileContainerChanged(wxCommandEvent &event); 00179 00180 /** 00181 * Called when the missile count text is changed. 00182 * 00183 * @param event The triggering wxCommandEvent (unused). 00184 */ 00185 void onMissilesTextChanged(wxCommandEvent &event); 00186 00187 /** 00188 * Called when the metroid password is changed. 00189 * 00190 * @param event The triggering wxCommandEvent (unused). 00191 */ 00192 void onPasswordChanged(wxCommandEvent &event); 00193 00194 /** 00195 * Called when debug password from the password menu is selected. 00196 * 00197 * @param event The triggering wxCommandEvent (unused). 00198 */ 00199 void onPasswordDebugPassword(wxCommandEvent &event); 00200 00201 /** 00202 * Called when an ending is selected from the password menu. 00203 * 00204 * @param event The triggering wxCommandEvent. 00205 */ 00206 void onPasswordEnding(wxCommandEvent &event); 00207 00208 /** 00209 * Called when bosses is selected from the password's give menu. 00210 * 00211 * @param event The triggering wxCommandEvent (unused). 00212 */ 00213 void onPasswordGiveBosses(wxCommandEvent &event); 00214 00215 /** 00216 * Called when doors is selected from the password's give menu. 00217 * 00218 * @param event The triggering wxCommandEvent (unused). 00219 */ 00220 void onPasswordGiveDoors(wxCommandEvent &event); 00221 00222 /** 00223 * Called when energy tanks is selected from the password's give menu. 00224 * 00225 * @param event The triggering wxCommandEvent (unused). 00226 */ 00227 void onPasswordGiveEnergyTanks(wxCommandEvent &event); 00228 00229 /** 00230 * Called when items is selected from the password's give menu. 00231 * 00232 * @param event The triggering wxCommandEvent (unused). 00233 */ 00234 void onPasswordGiveItems(wxCommandEvent &event); 00235 00236 /** 00237 * Called when missiles is selected from the password's give menu. 00238 * 00239 * @param event The triggering wxCommandEvent (unused). 00240 */ 00241 void onPasswordGiveMissiles(wxCommandEvent &event); 00242 00243 /** 00244 * Called when missile containers is selected from the password's give 00245 * menu. 00246 * 00247 * @param event The triggering wxCommandEvent (unused). 00248 */ 00249 void onPasswordGiveMissileContainers(wxCommandEvent &event); 00250 00251 /** 00252 * Called when statues is selected from the password's give menu. 00253 * 00254 * @param event The triggering wxCommandEvent (unused). 00255 */ 00256 void onPasswordGiveStatues(wxCommandEvent &event); 00257 00258 /** 00259 * Called when zebetites is selected from the password's give menu. 00260 * 00261 * @param event The triggering wxCommandEvent (unused). 00262 */ 00263 void onPasswordGiveZebetites(wxCommandEvent &event); 00264 00265 /** 00266 * Called when perfect game from the password menu is selected. 00267 * 00268 * @param event The triggering wxCommandEvent (unused). 00269 */ 00270 void onPasswordPerfectGame(wxCommandEvent &event); 00271 00272 /** 00273 * Called when reset from the password menu is selected. 00274 * 00275 * @param event The triggerin wxCommandEvent (unused). 00276 */ 00277 void onPasswordReset(wxCommandEvent &event); 00278 00279 /** 00280 * Called when on of the bits in the raw bitlist is changed. 00281 * 00282 * @param event The triggering wxCommandEvent. 00283 */ 00284 void onRawBitChanged(wxCommandEvent &event); 00285 00286 /** 00287 * Called when the shift text is changed. 00288 * 00289 * @param event The triggering wxCommandEvent (unused). 00290 */ 00291 void onShiftTextChanged(wxCommandEvent &event); 00292 00293 /** 00294 * Called when the start location is changed. 00295 * 00296 * @param event The triggering wxCommandEvent. 00297 */ 00298 void onStartLocationChanged(wxCommandEvent &event); 00299 00300 /** 00301 * Called when a statue checkbox is changed. 00302 * 00303 * @param event The triggering wxCommandEvent. 00304 */ 00305 void onStatueChanged(wxCommandEvent &event); 00306 00307 /** 00308 * Called when a zebetite checkbox is changed. 00309 * 00310 * @param event The triggering wxCommandEvent. 00311 */ 00312 void onZebetiteChanged(wxCommandEvent &event); 00313 00314 public: 00315 /** 00316 * Creates a new MPGFrame. 00317 */ 00318 MPGFrame(); 00319 }; 00320 00321 inline void MPGFrame::onFileExit(wxCommandEvent &) { Close(); } 00322 } 00323 00324 #endif 00325