| 1 | /***************************************************************************\ | 
 
 
 
 
 | 2 | | Project: AE Installer                                                                                                         | | 
 
 
 
 
 | 3 | | By: Gumby & Iritscen                                                                                                          | | 
 
 
 
 
 | 4 | | File: Main_Window.h                                                                                                           | | 
 
 
 
 
 | 5 | | Function: Handles GUI.                                                                                                        | | 
 
 
 
 
 | 6 | | Created: 07/05/2009 20:38:25                                                                                          | | 
 
 
 
 
 | 7 | \***************************************************************************/ | 
 
 
 
 
 | 8 |  | 
 
 
 
 
 | 9 |  | 
 
 
 
 
 | 10 | #ifndef _MAINWINDOW_H_ | 
 
 
 
 
 | 11 | #define _MAINWINDOW_H_ | 
 
 
 
 
 | 12 |  | 
 
 
 
 
 | 13 | /*! | 
 
 
 
 
 | 14 | * Includes | 
 
 
 
 
 | 15 | */ | 
 
 
 
 
 | 16 | #pragma mark INCLUDES | 
 
 
 
 
 | 17 | ////@begin includes | 
 
 
 
 
 | 18 | #include "wx/bmpbuttn.h" | 
 
 
 
 
 | 19 | #include "wx/checkbox.h" | 
 
 
 
 
 | 20 | #include "wx/checklst.h" | 
 
 
 
 
 | 21 | #include "wx/frame.h" | 
 
 
 
 
 | 22 | #include "wx/gauge.h" | 
 
 
 
 
 | 23 | #include "wx/generic/panelg.h" | 
 
 
 
 
 | 24 | #include "wx/radiobut.h" | 
 
 
 
 
 | 25 | #include "wx/splitter.h" | 
 
 
 
 
 | 26 | #include "wx/statline.h" | 
 
 
 
 
 | 27 | #include "wx/statusbr.h" | 
 
 
 
 
 | 28 | #include "wx/textctrl.h" | 
 
 
 
 
 | 29 | #include <vector> | 
 
 
 
 
 | 30 | using namespace std; | 
 
 
 
 
 | 31 | ////@end includes | 
 
 
 
 
 | 32 |  | 
 
 
 
 
 | 33 | /*! | 
 
 
 
 
 | 34 | * Forward declarations | 
 
 
 
 
 | 35 | */ | 
 
 
 
 
 | 36 |  | 
 
 
 
 
 | 37 | ////@begin forward declarations | 
 
 
 
 
 | 38 | class wxSplitterWindow; | 
 
 
 
 
 | 39 | class wxStatusBar; | 
 
 
 
 
 | 40 | ////@end forward declarations | 
 
 
 
 
 | 41 |  | 
 
 
 
 
 | 42 | /*! | 
 
 
 
 
 | 43 | * Control identifiers | 
 
 
 
 
 | 44 | */ | 
 
 
 
 
 | 45 | #pragma mark DEFINES | 
 
 
 
 
 | 46 | ////@begin control identifiers | 
 
 
 
 
 | 47 | #define ID_MAINWINDOW 10000 | 
 
 
 
 
 | 48 | #define ID_SPLITTERWINDOW 10001 | 
 
 
 
 
 | 49 | #define ID_PANEL 10011 | 
 
 
 
 
 | 50 | #define SelectAll_Checkbox 10012 | 
 
 
 
 
 | 51 | #define Refresh_Button 10007 | 
 
 
 
 
 | 52 | #define Mods_CheckboxList1 10002 | 
 
 
 
 
 | 53 | #define DescriptionHolder_Panel 10003 | 
 
 
 
 
 | 54 | #define Title_Text 10005 | 
 
 
 
 
 | 55 | #define Author_Text 10004 | 
 
 
 
 
 | 56 | #define Description_Text 10022 | 
 
 
 
 
 | 57 | #define ID_STATUSBAR 10008 | 
 
 
 
 
 | 58 | #define ProgressBar_Gauge 10009 | 
 
 
 
 
 | 59 | #define Install_Button 10010 | 
 
 
 
 
 | 60 | #define ID_PANEL1 10019 | 
 
 
 
 
 | 61 | #define Sep_RadioButton 10013 | 
 
 
 
 
 | 62 | #define NoSep_RadioButton 10014 | 
 
 
 
 
 | 63 | #define Seperated_RadioButton 10015 | 
 
 
 
 
 | 64 | #define Complete_RadioButton 10016 | 
 
 
 
 
 | 65 | #define ReGlobalize_Button 10018 | 
 
 
 
 
 | 66 | #define wxID_LOAD 10006 | 
 
 
 
 
 | 67 | #define wxID_OPTIONS 10017 | 
 
 
 
 
 | 68 | #define Dir_Button 10100 | 
 
 
 
 
 | 69 | #define SYMBOL_MAINWINDOW_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxSIMPLE_BORDER | 
 
 
 
 
 | 70 | #define SYMBOL_MAINWINDOW_TITLE _("Installer") | 
 
 
 
 
 | 71 | #define SYMBOL_MAINWINDOW_IDNAME ID_MAINWINDOW | 
 
 
 
 
 | 72 | #define SYMBOL_MAINWINDOW_SIZE wxSize(540, 500) | 
 
 
 
 
 | 73 | #define SYMBOL_MAINWINDOW_POSITION wxDefaultPosition | 
 
 
 
 
 | 74 | ////@end control identifiers | 
 
 
 
 
 | 75 |  | 
 
 
 
 
 | 76 | /*! | 
 
 
 
 
 | 77 | * MainWindow class declaration | 
 
 
 
 
 | 78 | */ | 
 
 
 
 
 | 79 |  | 
 
 
 
 
 | 80 | #pragma mark CLASS DECLARATIONS | 
 
 
 
 
 | 81 | class MainWindow: public wxFrame | 
 
 
 
 
 | 82 | { | 
 
 
 
 
 | 83 | DECLARE_CLASS( MainWindow ) | 
 
 
 
 
 | 84 | DECLARE_EVENT_TABLE() | 
 
 
 
 
 | 85 |  | 
 
 
 
 
 | 86 | public: | 
 
 
 
 
 | 87 | /// Constructors | 
 
 
 
 
 | 88 | MainWindow(); | 
 
 
 
 
 | 89 | MainWindow( wxWindow* parent, wxWindowID id = SYMBOL_MAINWINDOW_IDNAME, const wxString& caption = SYMBOL_MAINWINDOW_TITLE, | 
 
 
 
 
 | 90 | const wxPoint& pos = SYMBOL_MAINWINDOW_POSITION, const wxSize& size = SYMBOL_MAINWINDOW_SIZE, long style = SYMBOL_MAINWINDOW_STYLE ); | 
 
 
 
 
 | 91 |  | 
 
 
 
 
 | 92 | bool Create( wxWindow* parent, wxWindowID id = SYMBOL_MAINWINDOW_IDNAME, const wxString& caption = SYMBOL_MAINWINDOW_TITLE, | 
 
 
 
 
 | 93 | const wxPoint& pos = SYMBOL_MAINWINDOW_POSITION, const wxSize& size = SYMBOL_MAINWINDOW_SIZE, long style = SYMBOL_MAINWINDOW_STYLE ); | 
 
 
 
 
 | 94 |  | 
 
 
 
 
 | 95 | /// Destructor | 
 
 
 
 
 | 96 | ~MainWindow(); | 
 
 
 
 
 | 97 |  | 
 
 
 
 
 | 98 | /// Initialises member variables | 
 
 
 
 
 | 99 | void Init(); | 
 
 
 
 
 | 100 |  | 
 
 
 
 
 | 101 | /// Creates the controls and sizers | 
 
 
 
 
 | 102 | void CreateControls(); | 
 
 
 
 
 | 103 |  | 
 
 
 
 
 | 104 | ////@begin MainWindow event handler declarations | 
 
 
 
 
 | 105 |  | 
 
 
 
 
 | 106 | /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for SelectAll_Checkbox | 
 
 
 
 
 | 107 | void OnSelectAllCheckboxClick( wxCommandEvent& event ); | 
 
 
 
 
 | 108 |  | 
 
 
 
 
 | 109 | /// wxEVT_COMMAND_BUTTON_CLICKED event handler for Refresh_Button | 
 
 
 
 
 | 110 | void OnRefreshButtonClick( wxCommandEvent& event ); | 
 
 
 
 
 | 111 |  | 
 
 
 
 
 | 112 | /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for Mods_CheckboxList1 | 
 
 
 
 
 | 113 | void OnModsCheckboxList1Selected( wxCommandEvent& event ); | 
 
 
 
 
 | 114 |  | 
 
 
 
 
 | 115 | /// wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event handler for Mods_CheckboxList1 | 
 
 
 
 
 | 116 | void OnModsCheckboxList1Toggled( wxCommandEvent& event ); | 
 
 
 
 
 | 117 |  | 
 
 
 
 
 | 118 | /// wxEVT_CREATE event handler for Mods_CheckboxList1 | 
 
 
 
 
 | 119 | void ModList_OnCreate( wxWindowCreateEvent& event ); | 
 
 
 
 
 | 120 |  | 
 
 
 
 
 | 121 | /// wxEVT_UPDATE_UI event handler for ID_STATUSBAR | 
 
 
 
 
 | 122 | void OnStatusbarUpdate( wxUpdateUIEvent& event ); | 
 
 
 
 
 | 123 |  | 
 
 
 
 
 | 124 | /// wxEVT_COMMAND_BUTTON_CLICKED event handler for Install_Button | 
 
 
 
 
 | 125 | void OnInstallButtonClick( wxCommandEvent& event ); | 
 
 
 
 
 | 126 |  | 
 
 
 
 
 | 127 | /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Sep_RadioButton | 
 
 
 
 
 | 128 | void OnSepRadioButtonSelected( wxCommandEvent& event ); | 
 
 
 
 
 | 129 |  | 
 
 
 
 
 | 130 | /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for NoSep_RadioButton | 
 
 
 
 
 | 131 | void OnNoSepRadioButtonSelected( wxCommandEvent& event ); | 
 
 
 
 
 | 132 |  | 
 
 
 
 
 | 133 | /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton | 
 
 
 
 
 | 134 | void OnSeperatedRadioButtonSelected( wxCommandEvent& event ); | 
 
 
 
 
 | 135 |  | 
 
 
 
 
 | 136 | /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton | 
 
 
 
 
 | 137 | void OnCompleteRadioButtonSelected( wxCommandEvent& event ); | 
 
 
 
 
 | 138 |  | 
 
 
 
 
 | 139 | /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ReGlobalize_Button | 
 
 
 
 
 | 140 | void OnReGlobalizeButtonClick( wxCommandEvent& event ); | 
 
 
 
 
 | 141 |  | 
 
 
 
 
 | 142 | /// wxEVT_COMMAND_MENU_SELECTED event handler for wxID_LOAD | 
 
 
 
 
 | 143 | void OnLoadClick( wxCommandEvent& event ); | 
 
 
 
 
 | 144 |  | 
 
 
 
 
 | 145 | /// wxEVT_COMMAND_MENU_SELECTED event handler for wxID_SAVE | 
 
 
 
 
 | 146 | void OnSaveClick( wxCommandEvent& event ); | 
 
 
 
 
 | 147 |  | 
 
 
 
 
 | 148 | /// wxEVT_COMMAND_MENU_SELECTED event handler for wxID_EXIT | 
 
 
 
 
 | 149 | void OnExitClick( wxCommandEvent& event ); | 
 
 
 
 
 | 150 |  | 
 
 
 
 
 | 151 | /// wxEVT_COMMAND_MENU_SELECTED event handler for wxID_OPTIONS | 
 
 
 
 
 | 152 | void OnOptionsClick( wxCommandEvent& event ); | 
 
 
 
 
 | 153 |  | 
 
 
 
 
 | 154 | /// wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT | 
 
 
 
 
 | 155 | void OnAboutClick( wxCommandEvent& event ); | 
 
 
 
 
 | 156 |  | 
 
 
 
 
 | 157 | /// change currently directory | 
 
 
 
 
 | 158 | void OnDirButtonClick( wxCommandEvent& event ); | 
 
 
 
 
 | 159 | ////@end MainWindow event handler declarations | 
 
 
 
 
 | 160 |  | 
 
 
 
 
 | 161 | ////@begin MainWindow member function declarations | 
 
 
 
 
 | 162 |  | 
 
 
 
 
 | 163 | /// Retrieves bitmap resources | 
 
 
 
 
 | 164 | wxBitmap GetBitmapResource( const wxString& name ); | 
 
 
 
 
 | 165 |  | 
 
 
 
 
 | 166 | /// Retrieves icon resources | 
 
 
 
 
 | 167 | wxIcon GetIconResource( const wxString& name ); | 
 
 
 
 
 | 168 | ////@end MainWindow member function declarations | 
 
 
 
 
 | 169 |  | 
 
 
 
 
 | 170 | /// Should we show tooltips? | 
 
 
 
 
 | 171 | static bool ShowToolTips(); | 
 
 
 
 
 | 172 |  | 
 
 
 
 
 | 173 | ////@begin MainWindow member variables | 
 
 
 
 
 | 174 | wxSplitterWindow* MainSplitter; | 
 
 
 
 
 | 175 | wxCheckBox* SelectAll; | 
 
 
 
 
 | 176 | wxBitmapButton* RefreshButton; | 
 
 
 
 
 | 177 | wxCheckListBox* Mods_CheckboxList; | 
 
 
 
 
 | 178 | wxTextCtrl* titleText; | 
 
 
 
 
 | 179 | wxTextCtrl* creatorText; | 
 
 
 
 
 | 180 | wxTextCtrl* descriptionText; | 
 
 
 
 
 | 181 | wxStatusBar* StatusArea; | 
 
 
 
 
 | 182 | wxGauge* ProgressBar; | 
 
 
 
 
 | 183 | wxButton* InstallButton; | 
 
 
 
 
 | 184 | wxPanel* OptionsPanel; | 
 
 
 
 
 | 185 | wxRadioButton* SepRadio; | 
 
 
 
 
 | 186 | wxRadioButton* NoSepRadio; | 
 
 
 
 
 | 187 | wxRadioButton* SeperatedRadio; | 
 
 
 
 
 | 188 | wxRadioButton* CompleteRadio; | 
 
 
 
 
 | 189 | wxButton* ReglobalizeButton; | 
 
 
 
 
 | 190 | wxButton* ChangeDirectoryButton; | 
 
 
 
 
 | 191 | ////@end MainWindow member variables | 
 
 
 
 
 | 192 |  | 
 
 
 
 
 | 193 | void refreshMods( vector<string> ); | 
 
 
 
 
 | 194 | }; | 
 
 
 
 
 | 195 |  | 
 
 
 
 
 | 196 | #endif | 
 
 
 
 
 | 197 | // _MAINWINDOW_H_ |