Main Page | Namespace List | Class List | Directories | File List | Namespace Members | Class Members | File Members

MPGFrame.hh

Go to the documentation of this file.
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.27 2005/09/28 03:43:33 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;
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 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 door checkbox is changed.
00114          *
00115          * @param event The triggering wxCommandEvent.
00116          */
00117         void onDoorChanged(wxCommandEvent &event);
00118         
00119         /**
00120          * Called when an energy tank checkbox is changed.
00121          *
00122          * @param event The triggering wxCommandEvent.
00123          */
00124         void onEnergyTankChanged(wxCommandEvent &event);
00125         
00126         /**
00127          * Called when exit is selected from the file menu.
00128          *
00129          * @param event The triggering wxCommandEvent (unused).
00130          */
00131         void onFileExit(wxCommandEvent &event);
00132         
00133         /**
00134          * Called when the fix checksum button is pressed.
00135          *
00136          * @param event The triggering wxCommandEvent (unused).
00137          */
00138         void onFixChecksum(wxCommandEvent &event);
00139         
00140         /**
00141          * Called when the game time is changed.
00142          *
00143          * @param event The triggering wxCommandEvent.
00144          */
00145         void onGameTimeChanged(wxCommandEvent &event);
00146         
00147         /**
00148          * Called when about from the help menu is selected.
00149          *
00150          * @param event The triggering wxCommandEvent (unused).
00151          */
00152         void onHelpAbout(wxCommandEvent &event);
00153         
00154         /**
00155          * Called when an item checkbox is changed.
00156          *
00157          * @param event The triggering wxCommandEvent.
00158          */
00159         void onItemChanged(wxCommandEvent &event);
00160         
00161         /**
00162          * Called when a missile container checkbox is changed.
00163          *
00164          * @param event The triggering wxCommandEvent.
00165          */
00166         void onMissileContainerChanged(wxCommandEvent &event);
00167         
00168         /**
00169          * Called when the missile count text is changed.
00170          *
00171          * @param event The triggering wxCommandEvent (unused).
00172          */
00173         void onMissilesTextChanged(wxCommandEvent &event);
00174         
00175         /**
00176          * Called when the metroid password is changed.
00177          *
00178          * @param event The triggering wxCommandEvent (unused).
00179          */
00180         void onPasswordChanged(wxCommandEvent &event);
00181         
00182         /**
00183          * Called when debug password from the password menu is selected.
00184          *
00185          * @param event The triggering wxCommandEvent (unused).
00186          */
00187         void onPasswordDebugPassword(wxCommandEvent &event);
00188         
00189         /**
00190          * Called when an ending is selected from the password menu.
00191          *
00192          * @param event The triggering wxCommandEvent.
00193          */
00194         void onPasswordEnding(wxCommandEvent &event);
00195         
00196         /**
00197          * Called when bosses is selected from the password's give menu.
00198          *
00199          * @param event The triggering wxCommandEvent (unused).
00200          */
00201         void onPasswordGiveBosses(wxCommandEvent &event);
00202         
00203         /**
00204          * Called when doors is selected from the password's give menu.
00205          *
00206          * @param event The triggering wxCommandEvent (unused).
00207          */
00208         void onPasswordGiveDoors(wxCommandEvent &event);
00209         
00210         /**
00211          * Called when energy tanks is selected from the password's give menu.
00212          *
00213          * @param event The triggering wxCommandEvent (unused).
00214          */
00215         void onPasswordGiveEnergyTanks(wxCommandEvent &event);
00216         
00217         /**
00218          * Called when items is selected from the password's give menu.
00219          *
00220          * @param event The triggering wxCommandEvent (unused).
00221          */
00222         void onPasswordGiveItems(wxCommandEvent &event);
00223         
00224         /**
00225          * Called when missiles is selected from the password's give menu.
00226          *
00227          * @param event The triggering wxCommandEvent (unused).
00228          */
00229         void onPasswordGiveMissiles(wxCommandEvent &event);
00230         
00231         /**
00232          * Called when missile containers is selected from the password's give
00233          * menu.
00234          *
00235          * @param event The triggering wxCommandEvent (unused).
00236          */
00237         void onPasswordGiveMissileContainers(wxCommandEvent &event);
00238         
00239         /**
00240          * Called when statues is selected from the password's give menu.
00241          *
00242          * @param event The triggering wxCommandEvent (unused).
00243          */
00244         void onPasswordGiveStatues(wxCommandEvent &event);
00245         
00246         /**
00247          * Called when zebetites is selected from the password's give menu.
00248          *
00249          * @param event The triggering wxCommandEvent (unused).
00250          */
00251         void onPasswordGiveZebetites(wxCommandEvent &event);
00252         
00253         /**
00254          * Called when perfect game from the password menu is selected.
00255          *
00256          * @param event The triggering wxCommandEvent (unused).
00257          */
00258         void onPasswordPerfectGame(wxCommandEvent &event);
00259         
00260         /**
00261          * Called when reset from the password menu is selected.
00262          *
00263          * @param event The triggerin wxCommandEvent (unused).
00264          */
00265         void onPasswordReset(wxCommandEvent &event);
00266         
00267         /**
00268          * Called when on of the bits in the raw bitlist is changed.
00269          *
00270          * @param event The triggering wxCommandEvent.
00271          */
00272         void onRawBitChanged(wxCommandEvent &event);
00273         
00274         /**
00275          * Called when the shift text is changed.
00276          *
00277          * @param event The triggering wxCommandEvent (unused).
00278          */
00279         void onShiftTextChanged(wxCommandEvent &event);
00280         
00281         /**
00282          * Called when the start location is changed.
00283          *
00284          * @param event The triggering wxCommandEvent.
00285          */
00286         void onStartLocationChanged(wxCommandEvent &event);
00287         
00288         /**
00289          * Called when a statue checkbox is changed.
00290          *
00291          * @param event The triggering wxCommandEvent.
00292          */
00293         void onStatueChanged(wxCommandEvent &event);
00294         
00295         /**
00296          * Called when a zebetite checkbox is changed.
00297          *
00298          * @param event The triggering wxCommandEvent.
00299          */
00300         void onZebetiteChanged(wxCommandEvent &event);
00301         
00302     public:
00303         /**
00304          * Creates a new MPGFrame.
00305          */
00306         MPGFrame();
00307     };
00308     
00309     inline void MPGFrame::onFileExit(wxCommandEvent &) { Close(); }
00310 }
00311 
00312 #endif
00313 

Generated on Wed Sep 28 03:19:06 2005 for Metroid Password Generator by  doxygen 1.4.2