1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include "wx/wxprec.h"
#include <wx/progdlg.h>
#include "progress.h"
wxProgressDialog *globalProgress=NULL;
bool UpdateProgress(int i){
bool res=globalProgress->Update(i);
if (!res) EndProgress();
return res;
}
void StartProgress(const char* str, int N){
EndProgress();
wxString st; st.Printf(_T("QuteMol: %s..."),str);
globalProgress= new wxProgressDialog(
//_T("QuteMol"), st,
st, _T(""),
N, NULL, wxPD_AUTO_HIDE|wxPD_APP_MODAL|wxPD_CAN_ABORT);
}
void EndProgress(){
if (globalProgress) {
globalProgress->Destroy();
globalProgress=NULL;
}
}
|