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

source/view/MainFrame.hh

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004 emuWorks
00003  * http://games.technoplaza.net/
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 // $Id: MainFrame.hh,v 1.14 2004/12/08 06:39:53 technoplaza Exp $
00021 
00022 #ifndef _MAIN_FRAME_HH
00023 #define _MAIN_FRAME_HH
00024 
00025 #include <wx/xrc/xmlres.h>
00026 #include <wx/frame.h>
00027 #include <wx/notebook.h>
00028 #include <wx/statusbr.h>
00029 
00030 #include "FileDropTarget.hh"
00031 #include "../model/SaveSlot.hh"
00032 
00033 namespace ffse {
00034     class SaveSlot;
00035     
00036     /**
00037      * The main frame and primary view for the application.
00038      */
00039     class MainFrame : public wxFrame {
00040         public:
00041             /**
00042              * Constructor for a MainFrame.
00043              */
00044             MainFrame();
00045             
00046             /**
00047              * Creates the controls used by this MainFrame.
00048              */
00049             void CreateControls();
00050             
00051             friend class FileDropTarget;
00052             
00053         private:
00054             DECLARE_DYNAMIC_CLASS(MainFrame)
00055             DECLARE_EVENT_TABLE()
00056             
00057             /**
00058              * Checks if an SRAM file is currently open.
00059              *
00060              * @return true if open; false otherwise.
00061              */
00062             bool isOpen() { return open; }
00063             
00064             /**
00065              * Sets whether an SRAM file is open or not.
00066              *
00067              * @param open true if open; false otherwise.
00068              */
00069             void setOpen(bool open);
00070             
00071             /**
00072              * Loads the data for a particular member.
00073              *
00074              * @param member The member whose data to load.
00075              */
00076             void loadCharacterData(int member = 0);
00077             
00078             /**
00079              * Loads the game data into the frame controls.
00080              */
00081             void loadGameData();
00082             
00083             /**
00084              * Loads an SRAM file.
00085              *
00086              * @param filename The SRAM file to load.
00087              */
00088             void load(wxString &filename);
00089             
00090             /**
00091              * Callback triggered when open is selected from the file menu.
00092              *
00093              * @param event The associated command event.
00094              */
00095             void fileOpen(wxCommandEvent &event);
00096             
00097             /**
00098              * Closes the currently open SRAM file.
00099              *
00100              * @return true if closed; false otherwise.
00101              */
00102             bool close();
00103             
00104             /**
00105              * Callback triggered when close is selected from the file menu.
00106              *
00107              * @param event The associated command event.
00108              */
00109             void fileClose(wxCommandEvent &event);
00110             
00111             /**
00112              * Checks if all party members have valid equipment. Invalid
00113              * equipment only refers to duplicate equipped items, not to
00114              * invalid selections based on what a character's class can equip.
00115              *
00116              * @return true if valid; false otherwise.
00117              */
00118             bool isValidEquipment();
00119             
00120             /**
00121              * Saves the current SRAM to file.
00122              *
00123              * @param filename The filename to save to.
00124              *
00125              * @return true if the SRAM was saved; false otherwise.
00126              */
00127             bool save(wxString &filename);
00128             
00129             /**
00130              * Callback triggered when save is selected from the file menu.
00131              *
00132              * @param event The associated command event.
00133              */
00134             void fileSave(wxCommandEvent &event);
00135             
00136             /**
00137              * Callback triggered when "save as" is selected from the file menu.
00138              *
00139              * @param event The associated command event.
00140              */
00141             void fileSaveAs(wxCommandEvent &event);
00142             
00143             /**
00144              * Callback triggered when exit is selected from the file menu.
00145              *
00146              * @param event The associated command event.
00147              */
00148             void fileExit(wxCommandEvent &event);
00149             
00150             /**
00151              * Callback triggered when the window is being closed.
00152              *
00153              * @param event The associated command event.
00154              */
00155             void windowClosing(wxCloseEvent &event);
00156             
00157             /**
00158              * Callback triggered when one of the character menu items is
00159              * selected.
00160              *
00161              * @param event The associated command event.
00162              */
00163             void memberChange(wxCommandEvent &event);
00164             
00165             /**
00166              * Callback triggered when about is selected from the help menu.
00167              *
00168              * @param event The associated command event.
00169              */
00170             void helpAbout(wxCommandEvent &event);
00171             
00172             /**
00173              * Callback triggered when the amount of gold is changed.
00174              *
00175              * @param event The associated command event.
00176              */
00177             void goldChange(wxCommandEvent &event);
00178             
00179             /**
00180              * Callback triggered when an quantity item is changed.
00181              *
00182              * @param event The associated scroll event.
00183              */
00184             void itemQuantityChange(wxScrollEvent &event);
00185             
00186             /**
00187              * Callback triggered when an item is changed.
00188              *
00189              * @param event The associated command event.
00190              */
00191             void itemHaveChange(wxCommandEvent &event);
00192             
00193             /**
00194              * Callback when a member's name is changed.
00195              *
00196              * @param event The associated command event.
00197              */
00198             void nameChange(wxCommandEvent &event);
00199             
00200             /**
00201              * Callback triggered when class or condition is changed.
00202              *
00203              * @param event The associated command event.
00204              */
00205             void conditionChange(wxCommandEvent &event);
00206             
00207             /**
00208              * Callback triggered when a stat change occurs.
00209              *
00210              * @param event The associated command event.
00211              */
00212             void statChange(wxCommandEvent &event);
00213             
00214             /**
00215              * Callback triggered when a weapon change occurs.
00216              *
00217              * @param event The associated command event.
00218              */
00219             void weaponChange(wxCommandEvent &event);
00220             
00221             /**
00222              * Callback triggered when an equipped weapon change occurs.
00223              *
00224              * @param event The associated command event.
00225              */
00226             void weaponEquippedChange(wxCommandEvent &event);
00227             
00228             /**
00229              * Callback triggered when an armor change occurs.
00230              *
00231              * @param event The associated command event.
00232              */
00233             void armorChange(wxCommandEvent &event);
00234             
00235             /**
00236              * Callback triggered when an equipped armor change occurs.
00237              *
00238              * @param event The associated command event.
00239              */
00240             void armorEquippedChange(wxCommandEvent &event);
00241             
00242             /**
00243              * Callback triggered when the current magic level is changed.
00244              *
00245              * @param event The associated scroll event.
00246              */
00247             void currentMagicChange(wxScrollEvent &event);
00248             
00249             /**
00250              * Callback triggered when the max magic level is changed.
00251              *
00252              * @param event The associated scroll event.
00253              */
00254             void maxMagicChange(wxScrollEvent &event);
00255             
00256             /**
00257              * Callback triggered when the known magic is changed.
00258              *
00259              * @param event The associated command event.
00260              */
00261             void knownMagicChange(wxCommandEvent &event);
00262             
00263             wxString sramFile;
00264             char *sram;
00265             SaveSlot *game;
00266             int member;
00267             
00268             bool open;
00269             
00270             wxNotebook *notebook;
00271             
00272             wxMenuItem *fileCloseItem;
00273             wxMenuItem *fileSaveItem;
00274             wxMenuItem *fileSaveAsItem;
00275             wxMenuItem *memberItems[4];
00276 
00277             wxTextCtrl *goldText;
00278             
00279             wxSlider *healSlider;
00280             wxSlider *pureSlider;
00281             wxSlider *softSlider;
00282             wxSlider *tentSlider;
00283             wxSlider *cabinSlider;
00284             wxSlider *houseSlider;
00285             
00286             wxCheckBox *luteCheck;
00287             wxCheckBox *crownCheck;
00288             wxCheckBox *crystalCheck;
00289             wxCheckBox *herbCheck;
00290             wxCheckBox *keyCheck;
00291             wxCheckBox *tntCheck;
00292             wxCheckBox *adamentCheck;
00293             wxCheckBox *slabCheck;
00294             wxCheckBox *rubyCheck;
00295             wxCheckBox *rodCheck;
00296             wxCheckBox *floaterCheck;
00297             wxCheckBox *chimeCheck;
00298             wxCheckBox *tailCheck;
00299             wxCheckBox *cubeCheck;
00300             wxCheckBox *bottleCheck;
00301             wxCheckBox *oxyaleCheck;
00302             wxCheckBox *canoeCheck;
00303             wxCheckBox *fireOrbCheck;
00304             wxCheckBox *waterOrbCheck;
00305             wxCheckBox *windOrbCheck;
00306             wxCheckBox *earthOrbCheck;
00307             
00308             wxTextCtrl *nameText;
00309             wxChoice *classChoice;
00310             wxChoice *conditionChoice;
00311             
00312             wxTextCtrl *currentHPText;
00313             wxTextCtrl *maxHPText;
00314             wxTextCtrl *strengthText;
00315             wxTextCtrl *agilityText;
00316             wxTextCtrl *intelligenceText;
00317             wxTextCtrl *vitalityText;
00318             wxTextCtrl *luckText;
00319             wxTextCtrl *experienceText;
00320             wxTextCtrl *damageText;
00321             wxTextCtrl *hitPercentText;
00322             
00323             wxChoice *weaponChoice[4];
00324             wxCheckBox *weaponEquippedCheck[4];
00325             
00326             wxChoice *armorChoice[4];
00327             wxCheckBox *armorEquippedCheck[4];
00328             
00329             wxSlider *currentMagicSlider[8];
00330             wxSlider *maxMagicSlider[8];
00331             
00332             wxChoice *knownMagicChoice[8][3];
00333             
00334             wxStatusBar* statusbar;
00335             
00336             /**
00337              * XPM icon used for the Frame icon.
00338              */
00339             static const char *ICON[];
00340     };
00341 }
00342 
00343 #endif
00344 

Generated on Wed Dec 8 03:21:44 2004 for Final Fantasy SRAM Editor by  doxygen 1.3.9.1