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

frmSums.hpp

Go to the documentation of this file.
00001 /* 00002 * wxChecksums 00003 * Copyright (C) 2003-2004 Julien Couot 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 /** 00021 * \file frmSums.hpp 00022 * Application's main window definitions. 00023 */ 00024 00025 #ifndef INC_FRMSUMS_HPP 00026 #define INC_FRMSUMS_HPP 00027 00028 //--------------------------------------------------------------------------- 00029 // For compilers that support precompilation, includes "wx.h". 00030 #include <wx/wxprec.h> 00031 00032 #ifdef __BORLANDC__ 00033 #pragma hdrstop 00034 #endif 00035 00036 #ifndef WX_PRECOMP 00037 // Include your minimal set of headers here, or wx.h 00038 #include <wx/wx.h> 00039 #endif 00040 #include "lvwSums.hpp" 00041 //--------------------------------------------------------------------------- 00042 00043 00044 /** 00045 * The application main window. 00046 */ 00047 class frmSums : public wxFrame 00048 { 00049 public: 00050 // Creates a new frame. 00051 frmSums(); 00052 00053 // Creates a new frame. 00054 frmSums(const wxChar* title, int xpos, int ypos, int width, int height); 00055 00056 // Creates a new frame. 00057 frmSums(const wxChar* title); 00058 00059 // Destructor. 00060 virtual ~frmSums(); 00061 00062 protected: 00063 // Creates and initializes the controls of window. Creates the window's controls. 00064 void createControls(); 00065 00066 // Creates the tools bar 00067 void createToolbar(); 00068 00069 // Creates the status bar 00070 void createStatusbar(); 00071 00072 public: 00073 // Initializes some parameters from the command line. 00074 void initializeFromCmdLine(bool& error, bool& warning); 00075 00076 // Checks if the window should be closed after initialisation from the command line. 00077 bool closeAfterInitFromCmdLine(bool error, bool warning); 00078 00079 protected: 00080 // Sets the frame title 00081 void updateTitle(); 00082 00083 // Saves the current checksum file 00084 bool saveChecksumFile(const wxString& fileName); 00085 00086 // Checks if the current checksums' file has been saved before closing it 00087 int checkFileBeforeClose(); 00088 00089 // Initializes the open recent files. 00090 void initializeOpenRecent(); 00091 00092 // Adds a name of file to the open recent submenu. 00093 void addFileNameToOpenRecent(const wxString& fileName); 00094 00095 // Gets the name of the file corresponding to the given identifier. 00096 wxString getOpenRecentFileName(const int id); 00097 00098 // Gets the configuration key for the last files' names open recently. 00099 static wxString getOpenRecentConfigKey(const int n); 00100 00101 // Gets the number of maximal files in the open recent history. 00102 static int getOpenRecentHistoryMaxSize(); 00103 00104 static const int TOOL_BITMAP_SIZE; ///< The maximum size of a toolbar button. 00105 ChecksumsListView* lvwSums; ///< The listview which displays information about checksums. 00106 wxToolBar* tlbTools; ///< The tools bar. 00107 wxStatusBar* stbStatus; ///< The status bar. 00108 wxMenu* mnuOpenRecent; ///< Open recent sub menu. 00109 wxArrayString openRecent; ///< Open recent files. 00110 00111 00112 // Processes menu File->New 00113 void itmFileNewClick(wxCommandEvent& event); 00114 // Processes menu File->Open 00115 void itmFileOpenClick(wxCommandEvent& event); 00116 // Processes menu File->Open recent 00117 void itmFileOpenRecentClick(wxCommandEvent& event); 00118 // Processes menu File->Save 00119 void itmFileSaveClick(wxCommandEvent& event); 00120 // Processes menu File->Save as 00121 void itmFileSaveAsClick(wxCommandEvent& event); 00122 // Processes menu File->Close 00123 void itmFileCloseClick(wxCommandEvent& event); 00124 // Processes menu File->Quit 00125 void itmFileQuitClick(wxCommandEvent& event); 00126 00127 // Processes menu Sums->Add files... 00128 void itmSumsAddFilesClick(wxCommandEvent& event); 00129 // Processes menu Sums->Add directories... 00130 void itmSumsAddDirectoriesClick(wxCommandEvent& event); 00131 // Processes menu Sums->Add matching files... 00132 void itmSumsAddMatchingFilesClick(wxCommandEvent& event); 00133 // Processes menu Sums->Remove... 00134 void itmSumsRemoveClick(wxCommandEvent& event); 00135 // Processes menu Sums->Check 00136 void itmSumsCheckClick(wxCommandEvent& event); 00137 // Processes menu Sums->Recompute 00138 void itmSumsRecomputeClick(wxCommandEvent& event); 00139 // Processes menu Sums->Sort by... 00140 void itmSumsSortByClick(wxCommandEvent& event); 00141 // Update the state of the Sort by... submenu 00142 void itmSumsSortByUpdate(); 00143 // Processes menu Sums->Select all 00144 void itmSumsSelectAllClick(wxCommandEvent& event); 00145 // Processes menu Sums->Invert selection 00146 void itmSumsInvertSelectionClick(wxCommandEvent& event); 00147 00148 // Processes menu Tools->Check multiple checksum's files 00149 void itmToolsCheckMultipleClick(wxCommandEvent& event); 00150 // Processes menu Tools->Batch creation of checksums' files 00151 void itmToolsBatchCreationClick(wxCommandEvent& event); 00152 // Processes menu Tools->Show toolbar 00153 void itmToolsShowToolbarClick(wxCommandEvent& event); 00154 // Processes menu Tools->Show statusbar 00155 void itmToolsShowStatusbarClick(wxCommandEvent& event); 00156 // Processes menu Tools->Configure 00157 void itmToolsConfigureClick(wxCommandEvent& event); 00158 00159 // Processes menu Help->About 00160 void itmHelpAboutClick(wxCommandEvent& event); 00161 00162 // Event handler for a keypressed. 00163 void FrameCharHook(wxKeyEvent& event); 00164 00165 // Event handler to respond to system close events. 00166 void FrameClose(wxCloseEvent& event); 00167 00168 // Processes a click on a header of a column of the list of checksums. 00169 void lvwSumsColumnClick(wxListEvent& event); 00170 00171 // Processes the EVENT_UPDATE_SUMS_FRAME_TITLE_COMMAND event. 00172 void OnUpdateTitle(wxCommandEvent& event); 00173 00174 // Processes the EVENT_UPDATE_SUMS_FRAME_STATUSBAR_COMMAND event. 00175 void OnUpdateStatusBar(wxCommandEvent& event); 00176 00177 // Processes the EVENT_OPEN_RECENT_ADD_FILE event. 00178 void OnOpenRecentAddFile(wxCommandEvent& event); 00179 00180 /// Controls IDs 00181 enum 00182 { 00183 STB_STATUS = wxID_HIGHEST + 1, 00184 LVW_SUMS, 00185 ITM_FILE_NEW, 00186 ITM_FILE_OPEN, 00187 MNU_FILE_OPENRECENT, 00188 ITM_FILE_OPENRECENT1, // Must be the same number as getOpenRecentHistoryMaxSize() returns. 00189 ITM_FILE_OPENRECENT2, 00190 ITM_FILE_OPENRECENT3, 00191 ITM_FILE_OPENRECENT4, 00192 ITM_FILE_OPENRECENT5, 00193 ITM_FILE_OPENRECENT6, 00194 ITM_FILE_OPENRECENT7, 00195 ITM_FILE_OPENRECENT8, 00196 ITM_FILE_OPENRECENT9, 00197 ITM_FILE_OPENRECENT10, 00198 ITM_FILE_OPENRECENT11, 00199 ITM_FILE_OPENRECENT12, 00200 ITM_FILE_OPENRECENT13, 00201 ITM_FILE_OPENRECENT14, 00202 ITM_FILE_OPENRECENT15, 00203 ITM_FILE_OPENRECENT16, 00204 ITM_FILE_SAVE, 00205 ITM_FILE_SAVEAS, 00206 ITM_FILE_CLOSE, 00207 ITM_FILE_QUIT, 00208 ITM_SUMS_ADDFILES, 00209 ITM_SUMS_ADDDIRECTORIES, 00210 ITM_SUMS_ADDMATCHINGFILES, 00211 ITM_SUMS_REMOVE, 00212 ITM_SUMS_CHECK, 00213 ITM_SUMS_RECOMPUTE, 00214 ITM_SUMS_SORTBY, 00215 ITM_SUMS_SORTBY_FILENAME, 00216 ITM_SUMS_SORTBY_DIRECTORY, 00217 ITM_SUMS_SORTBY_CHECKSUMVALUE, 00218 ITM_SUMS_SORTBY_STATE, 00219 ITM_SUMS_SORTBY_SEPARATOR1, // needed to separate radio item groups 00220 ITM_SUMS_SORTBY_ASCENDING, 00221 ITM_SUMS_SORTBY_DESCENDING, 00222 ITM_SUMS_SORTBY_NONE, 00223 ITM_SUMS_SELECTALL, 00224 ITM_SUMS_INVERTSELECTION, 00225 ITM_TOOLS_CHECK_MULTIPLE, 00226 ITM_TOOLS_BATCH_CREATION, 00227 ITM_TOOLS_SHOW_TOOLBAR, 00228 ITM_TOOLS_SHOW_STATUSBAR, 00229 ITM_TOOLS_CONFIGURE, 00230 ITM_HELP_ABOUT 00231 }; 00232 00233 DECLARE_EVENT_TABLE() 00234 00235 private: 00236 DECLARE_DYNAMIC_CLASS(frmSums) 00237 }; 00238 //--------------------------------------------------------------------------- 00239 00240 00241 #endif // INC_FRMSUMS_HPP

Generated on Sun May 30 13:37:44 2004 for wxChecksums by doxygen 1.3.7