1 ////////////////////////////////////////////////////////////////////////// 2 // 3 // pgAdmin III - PostgreSQL Tools 4 // 5 // Copyright (C) 2002 - 2016, The pgAdmin Development Team 6 // This software is released under the PostgreSQL Licence 7 // 8 // ctlProgressStatusBar.h - Status bar indicating the current progress 9 // 10 ////////////////////////////////////////////////////////////////////////// 11 // 12 #ifndef CTLPROGRESS_STATUSBAR_H 13 #define CTLPROGRESS_STATUSBAR_H 14 15 // wxWindows headers 16 #include <wx/wx.h> 17 #include <wx/gauge.h> 18 #include <wx/timer.h> 19 20 class ctlProgressStatusBar : public wxStatusBar 21 { 22 public: 23 ctlProgressStatusBar(wxWindow *parent, bool showProgressInitially = true, bool autoProgressive = true, int max = -1); 24 virtual ~ctlProgressStatusBar(); 25 26 void ShowProgress(bool restart = true); 27 void StopProgress(); 28 void SetProgress(int val); 29 virtual void SetFieldsCount(int number = 1, const int *widths = NULL); 30 virtual void SetStatusWidths(int n, const int widths_field[]); 31 32 static const unsigned short ms_increment, 33 ms_progressbar_width, 34 ms_progressstatus_width; 35 36 protected: 37 void OnTimer(wxTimerEvent &WXUNUSED(event)); 38 void OnSize(wxSizeEvent &ev); 39 40 wxGauge *m_progress; 41 wxTimer m_timer; 42 43 bool m_progressStopped; 44 bool m_autoProgressive; 45 bool m_autoValIncrementing; 46 47 int m_hr, m_min, m_sec, m_mil; 48 int m_val; 49 50 enum 51 { 52 Status_field, 53 ProgressBar_field, 54 ProgressStatus_field, 55 Max_Field 56 }; 57 58 DECLARE_EVENT_TABLE() 59 }; 60 61 #endif // CTLPROGRESS_STATUSBAR_H 62