File: progress.cpp

package info (click to toggle)
qutemol 0.4.1~cvs20081111-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 13,482
  • sloc: cpp: 66,664; makefile: 51; sh: 21
file content (28 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (4)
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;
  }
}