1 #ifndef HEADERSDETECTORDLG_H 2 #define HEADERSDETECTORDLG_H 3 4 #include <wx/gauge.h> // Fix MSW bug which forbids using fwd declaration for wxGauge 5 6 //(*Headers(HeadersDetectorDlg) 7 #include "scrollingdialog.h" 8 #include <wx/timer.h> 9 class wxStaticBoxSizer; 10 class wxFlexGridSizer; 11 class wxGauge; 12 class wxStdDialogButtonSizer; 13 class wxBoxSizer; 14 class wxStaticText; 15 //*) 16 17 #include <cbproject.h> 18 19 class HeadersDetectorDlg: public wxScrollingDialog 20 { 21 public: 22 23 HeadersDetectorDlg(wxWindow* parent,cbProject* project,wxArrayString& headers); 24 virtual ~HeadersDetectorDlg(); 25 26 private: 27 28 //(*Declarations(HeadersDetectorDlg) 29 wxStaticText* m_ProjectName; 30 wxStaticText* m_FileNameTxt; 31 wxStaticText* StaticText1; 32 wxTimer Timer1; 33 wxGauge* m_ProgressBar; 34 wxStaticText* StaticText2; 35 //*) 36 37 //(*Identifiers(HeadersDetectorDlg) 38 static const long ID_STATICTEXT1; 39 static const long ID_STATICTEXT3; 40 static const long ID_STATICTEXT2; 41 static const long ID_STATICTEXT4; 42 static const long ID_GAUGE1; 43 static const long ID_TIMER1; 44 //*) 45 46 //(*Handlers(HeadersDetectorDlg) 47 void OnTimer1Trigger(wxTimerEvent& event); 48 void Cancel(wxCommandEvent& event); 49 //*) 50 51 class WorkThread: public wxThread 52 { 53 public: WorkThread()54 WorkThread(): wxThread(wxTHREAD_JOINABLE) {} Entry()55 ExitCode Entry() { m_Dlg->ThreadProc(); return 0; } 56 HeadersDetectorDlg* m_Dlg; 57 }; 58 59 void ThreadProc(); 60 void ProcessFile( ProjectFile* file, wxArrayString& includes ); 61 62 WorkThread m_Thread; 63 cbProject* m_Project; 64 wxArrayString& m_Headers; 65 wxCriticalSection m_Section; 66 wxString m_FileName; 67 int m_Progress; 68 bool m_Finished; 69 bool m_Cancel; 70 71 DECLARE_EVENT_TABLE() 72 }; 73 74 #endif 75