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.29 2005/09/29 22:23:07 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 * Updates all the controls based on the current password data. 00058 */ 00059 void updateControls(); 00060 00061 /** 00062 * Updates the text password when the password data has changed. 00063 * 00064 * @param updateCtrl true to update the text control value; false 00065 * otherwise. 00066 */ 00067 void updatePasswordText(bool updateCtrl = true); 00068 00069 /** 00070 * Updates the raw game time bits. 00071 * 00072 * @param value The game time value. 00073 */ 00074 void updateRawGameTime(wxUint32 value); 00075 00076 /** 00077 * Updates the raw missile bits. 00078 * 00079 * @param value The missile count value. 00080 */ 00081 void updateRawMissiles(unsigned char value); 00082 00083 /** 00084 * Updates the approximate real time label. 00085 */ 00086 void updateRealTime(); 00087 00088 /** 00089 * Updates the start location radio box control. 00090 */ 00091 void updateStartLocation(); 00092 00093 /** 00094 * Updates the sizes for the text controls so they are wide enough. 00095 */ 00096 void updateTextCtrlSizes(); 00097 00098 /** 00099 * Called when Samus's armor is changed. 00100 * 00101 * @param event The triggering wxCommandEvent. 00102 */ 00103 void onArmorChanged(wxCommandEvent &event); 00104 00105 /** 00106 * Called when a boss checkbox is changed. 00107 * 00108 * @param event The triggering wxCommandEvent. 00109 */ 00110 void onBossChanged(wxCommandEvent &event); 00111 00112 /** 00113 * Called when a shift value from the checksum menu is selected. 00114 * 00115 * @param event The triggering wxCommandEvent. 00116 */ 00117 void onChecksumShift(wxCommandEvent &event); 00118 00119 /** 00120 * Called when a door checkbox is changed. 00121 * 00122 * @param event The triggering wxCommandEvent. 00123 */ 00124 void onDoorChanged(wxCommandEvent &event); 00125 00126 /** 00127 * Called when an energy tank checkbox is changed. 00128 * 00129 * @param event The triggering wxCommandEvent. 00130 */ 00131 void onEnergyTankChanged(wxCommandEvent &event); 00132 00133 /** 00134 * Called when exit is selected from the file menu. 00135 * 00136 * @param event The triggering wxCommandEvent (unused). 00137 */ 00138 void onFileExit(wxCommandEvent &event); 00139 00140 /** 00141 * Called when the fix checksum button is pressed. 00142 * 00143 * @param event The triggering wxCommandEvent (unused). 00144 */ 00145 void onFixChecksum(wxCommandEvent &event); 00146 00147 /** 00148 * Called when NTSC or PAL is selected from the game menu. 00149 * 00150 * @param event The triggering wxCommandEvent. 00151 */ 00152 void onGameSystem(wxCommandEvent &event); 00153 00154 /** 00155 * Called when the game time is changed. 00156 * 00157 * @param event The triggering wxCommandEvent. 00158 */ 00159 void onGameTimeChanged(wxCommandEvent &event); 00160 00161 /** 00162 * Called when about from the help menu is selected. 00163 * 00164 * @param event The triggering wxCommandEvent (unused). 00165 */ 00166 void onHelpAbout(wxCommandEvent &event); 00167 00168 /** 00169 * Called when an item checkbox is changed. 00170 * 00171 * @param event The triggering wxCommandEvent. 00172 */ 00173 void onItemChanged(wxCommandEvent &event); 00174 00175 /** 00176 * Called when a missile container checkbox is changed. 00177 * 00178 * @param event The triggering wxCommandEvent. 00179 */ 00180 void onMissileContainerChanged(wxCommandEvent &event); 00181 00182 /** 00183 * Called when the missile count text is changed. 00184 * 00185 * @param event The triggering wxCommandEvent (unused). 00186 */ 00187 void onMissilesTextChanged(wxCommandEvent &event); 00188 00189 /** 00190 * Called when the metroid password is changed. 00191 * 00192 * @param event The triggering wxCommandEvent (unused). 00193 */ 00194 void onPasswordChanged(wxCommandEvent &event); 00195 00196 /** 00197 * Called when debug password from the password menu is selected. 00198 * 00199 * @param event The triggering wxCommandEvent (unused). 00200 */ 00201 void onPasswordDebugPassword(wxCommandEvent &event); 00202 00203 /** 00204 * Called when an ending is selected from the password menu. 00205 * 00206 * @param event The triggering wxCommandEvent. 00207 */ 00208 void onPasswordEnding(wxCommandEvent &event); 00209 00210 /** 00211 * Called when bosses is selected from the password's give menu. 00212 * 00213 * @param event The triggering wxCommandEvent (unused). 00214 */ 00215 void onPasswordGiveBosses(wxCommandEvent &event); 00216 00217 /** 00218 * Called when doors is selected from the password's give menu. 00219 * 00220 * @param event The triggering wxCommandEvent (unused). 00221 */ 00222 void onPasswordGiveDoors(wxCommandEvent &event); 00223 00224 /** 00225 * Called when energy tanks is selected from the password's give menu. 00226 * 00227 * @param event The triggering wxCommandEvent (unused). 00228 */ 00229 void onPasswordGiveEnergyTanks(wxCommandEvent &event); 00230 00231 /** 00232 * Called when items is selected from the password's give menu. 00233 * 00234 * @param event The triggering wxCommandEvent (unused). 00235 */ 00236 void onPasswordGiveItems(wxCommandEvent &event); 00237 00238 /** 00239 * Called when missiles is selected from the password's give menu. 00240 * 00241 * @param event The triggering wxCommandEvent (unused). 00242 */ 00243 void onPasswordGiveMissiles(wxCommandEvent &event); 00244 00245 /** 00246 * Called when missile containers is selected from the password's give 00247 * menu. 00248 * 00249 * @param event The triggering wxCommandEvent (unused). 00250 */ 00251 void onPasswordGiveMissileContainers(wxCommandEvent &event); 00252 00253 /** 00254 * Called when statues is selected from the password's give menu. 00255 * 00256 * @param event The triggering wxCommandEvent (unused). 00257 */ 00258 void onPasswordGiveStatues(wxCommandEvent &event); 00259 00260 /** 00261 * Called when zebetites is selected from the password's give menu. 00262 * 00263 * @param event The triggering wxCommandEvent (unused). 00264 */ 00265 void onPasswordGiveZebetites(wxCommandEvent &event); 00266 00267 /** 00268 * Called when perfect game from the password menu is selected. 00269 * 00270 * @param event The triggering wxCommandEvent (unused). 00271 */ 00272 void onPasswordPerfectGame(wxCommandEvent &event); 00273 00274 /** 00275 * Called when reset from the password menu is selected. 00276 * 00277 * @param event The triggerin wxCommandEvent (unused). 00278 */ 00279 void onPasswordReset(wxCommandEvent &event); 00280 00281 /** 00282 * Called when on of the bits in the raw bitlist is changed. 00283 * 00284 * @param event The triggering wxCommandEvent. 00285 */ 00286 void onRawBitChanged(wxCommandEvent &event); 00287 00288 /** 00289 * Called when the shift text is changed. 00290 * 00291 * @param event The triggering wxCommandEvent (unused). 00292 */ 00293 void onShiftTextChanged(wxCommandEvent &event); 00294 00295 /** 00296 * Called when the start location is changed. 00297 * 00298 * @param event The triggering wxCommandEvent. 00299 */ 00300 void onStartLocationChanged(wxCommandEvent &event); 00301 00302 /** 00303 * Called when a statue checkbox is changed. 00304 * 00305 * @param event The triggering wxCommandEvent. 00306 */ 00307 void onStatueChanged(wxCommandEvent &event); 00308 00309 /** 00310 * Called when a zebetite checkbox is changed. 00311 * 00312 * @param event The triggering wxCommandEvent. 00313 */ 00314 void onZebetiteChanged(wxCommandEvent &event); 00315 00316 public: 00317 /** 00318 * Creates a new MPGFrame. 00319 */ 00320 MPGFrame(); 00321 }; 00322 00323 inline void MPGFrame::onFileExit(wxCommandEvent &) { Close(); } 00324 } 00325 00326 #endif 00327