wxWidgets进度条
#include <wx/wx.h>
#include <wx/progdlg.h>
class myApp : public wxApp {
public:
bool OnInit(void);
int OnExit(void);
};
IMPLEMENT_APP(myApp)
bool myApp :: OnInit(){
int max = 500;
wxFrame* frame = new wxFrame(NULL, wxID_ANY, wxT("blah blah"));
this->SetTopWindow(frame);
frame->Show(true);
wxProgressDialog* dialog = new wxProgressDialog(wxT("Wait..."), wxT("Keep waiting..."), max, frame, wxPD_AUTO_HIDE | wxPD_APP_MODAL );
for(int i = 0; i < max; i++){
wxMilliSleep(10); //here are computations
dialog->Update(i,wxString::Format(wxT("%i"),i),NULL);
}
// dialog->Update(max);
delete dialog;
return true;
}
int myApp :: OnExit(){
return 0;
}
转载于//www.cnblogs.com/tiandsp/p/7440788.html
还没有评论,来说两句吧...