summaryrefslogtreecommitdiff
path: root/cad/plugins/QuteMol/qutemol/src/progress.cpp
blob: 86e75be74255992de757443f52ec31e451b49abf (plain)
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(char* str, int N){
  EndProgress();
  wxString st; st.Printf("QuteMolX: %s...",str);
  globalProgress= new wxProgressDialog(
    //_T("QuteMolX"), st,
    st,  _T(""),
    N, NULL, wxPD_AUTO_HIDE|wxPD_APP_MODAL|wxPD_CAN_ABORT);
}

void EndProgress(){
  if (globalProgress) {
    globalProgress->Destroy();
    globalProgress=NULL;
  }
}