Changeset 212
- Timestamp:
- 02/07/08 15:57:30 (4 years ago)
- Files:
-
- branches/2.3.2beta3/src/include/progressManager.h (modified) (2 diffs)
- branches/2.3.2beta3/src/progressManager.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.3.2beta3/src/include/progressManager.h
r38 r212 15 15 */ 16 16 17 /** 18 * \file progressManager.h 19 * Manages progress bar. 20 * \author François Ingelrest 21 * \author Andrew Schofield 22 **/ 23 17 24 #ifndef _PROGRESSMANAGER_H 18 25 #define _PROGRESSMANAGER_H … … 22 29 23 30 24 // This class displays some progress information to the user, thanks to a wxProgressDialog 25 // 26 // It is easier to use when different tasks have to be performed, because each of them does not have to 27 // know the percentage of work they represent compared to the total work to be done 28 // 29 // It is also easier to use in the case where a method will sometimes not display its progress (silent mode) 30 // Thus, the test does not have to be done in the method itself, making it clearer to read (and to write) 31 /** 32 * Progress management class. 33 * This class displays some progress information to the user, thanks to a wxProgressDialog 34 * 35 * It is easier to use when different tasks have to be performed, because each of them does not have to 36 * know the percentage of work they represent compared to the total work to be done 37 * 38 * It is also easier to use in the case where a method will sometimes not display its progress (silent mode) 39 * Thus, the test does not have to be done in the method itself, making it clearer to read (and to write). 40 **/ 31 41 class ProgressManager 32 42 { 33 43 protected: 34 bool mIsInSilentMode; 35 bool mIsATaskActive; 36 wxUint32 mCurrentProgress; 37 wxUint32 mTaskCurrentProgress; 38 wxUint32 mTaskPercentageOfTotal; 39 wxString mCurrentText; 40 wxProgressDialog *mProgressDlg; 44 bool mIsInSilentMode; /**< Is manager in silent mode */ 45 bool mIsATaskActive; /**< Is a task active */ 46 wxUint32 mCurrentProgress; /**< Current overall progress */ 47 wxUint32 mTaskCurrentProgress; /**< Current task progress */ 48 wxUint32 mTaskPercentageOfTotal; /**< How much task is worth */ 49 wxString mCurrentText; /**< Text value */ 50 wxProgressDialog *mProgressDlg; /**< Progress Dialog object */ 41 51 42 52 43 53 public: 54 /** 55 * Constructor. 56 * 57 * If silent mode is on, future calls to methods won't do anything. 58 **/ 44 59 ProgressManager(bool isInSilentMode); 60 61 /** 62 * Destructor. 63 **/ 45 64 ~ProgressManager(void); 46 65 66 /** 67 * Change the displayed text. 68 * 69 * Return false if the user wants to cancel the process 70 * @param text The text to set. 71 **/ 47 72 bool SetText(const wxString& text); 73 74 /** 75 * Change the displayed progress. 76 * 77 * Return false if the user wants to cancel the process 78 * @param progress The progress to set. 79 **/ 48 80 bool SetProgress(wxUint32 progress); 81 82 /** 83 * Change both text and progress, 84 * This is the same as calling SetText() and SetProgress() 85 * 86 * Return false if the user wants to cancel the process. 87 * @param text The text to set. 88 * @param progress The progress to set. 89 **/ 49 90 bool SetTextAndProgress(const wxString& text, wxUint32 progress); 50 91 92 /** 93 * A task is represented by the percentage of the total work it represents. 94 * Only one task can be active at a time (EndTask() must be called before calling CreateTask() a second time) 95 * @param percentageOfTotal How much the task is worth. 96 **/ 51 97 void CreateTask(wxUint32 percentageOfTotal); 98 99 /** 100 * End a task previously created with CreateTask(). 101 **/ 52 102 void EndTask(void); 53 103 }; branches/2.3.2beta3/src/progressManager.cpp
r148 r212 15 15 */ 16 16 17 /** 18 * \file progressManager.cpp 19 * Manages progress bar. 20 * \author François Ingelrest 21 * \author Andrew Schofield 22 **/ 23 17 24 #include "fahmon.h" 18 25 #include "progressManager.h" … … 22 29 23 30 24 /**25 * Constructor26 *27 * If silent mode is on, future calls to methods won't do anything28 **/29 31 ProgressManager::ProgressManager(bool isInSilentMode) 30 32 { … … 46 48 47 49 48 /**49 * Destructor50 **/51 50 ProgressManager::~ProgressManager(void) 52 51 { … … 58 57 59 58 60 /**61 * Change the displayed text62 *63 * Return false if the user wants to cancel the process64 **/65 59 bool ProgressManager::SetText(const wxString& text) 66 60 { … … 94 88 95 89 96 /**97 * Change the displayed progress98 *99 * Return false if the user wants to cancel the process100 **/101 90 bool ProgressManager::SetProgress(wxUint32 progress) 102 91 { … … 134 123 135 124 136 /**137 * Change both text and progress138 * This is the same as calling SetText() and SetProgress()139 *140 * Return false if the user wants to cancel the process141 **/142 125 bool ProgressManager::SetTextAndProgress(const wxString& text, wxUint32 progress) 143 126 { … … 152 135 153 136 154 /**155 * A task is represented by the percentage of the total work it represents156 * Only one task can be active at a time (EndTask() must be called before calling CreateTask() a second time)157 **/158 137 void ProgressManager::CreateTask(wxUint32 percentageOfTotal) 159 138 { … … 171 150 172 151 173 /**174 * End a task previously created with CreateTask()175 **/176 152 void ProgressManager::EndTask(void) 177 153 {
