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