1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxProgressDialog class
4 // Author: Karsten Ballüder
8 // Copyright: (c) Karsten Ballüder
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __PROGDLGH_G__
13 #define __PROGDLGH_G__
16 #pragma interface "progdlgg.h"
26 /** Progress dialog which shows a moving progress bar.
27 Taken from the Mahogany project.*/
29 class WXDLLEXPORT wxProgressDialog
: public wxFrame
31 DECLARE_DYNAMIC_CLASS(wxProgressDialog
)
33 /** Creates and displays dialog, disables event handling for other
34 frames or parent frame to avoid recursion problems.
35 @param title title for window
36 @param message message to display in window
37 @param maximum value for status bar, if <= 0, no bar is shown
38 @param parent window or NULL
39 @param style is the bit mask of wxPD_XXX constants from wx/defs.h
41 wxProgressDialog(const wxString
&title
, wxString
const &message
,
43 wxWindow
*parent
= NULL
,
44 int style
= wxPD_APP_MODAL
| wxPD_AUTO_HIDE
);
46 Re-enables event handling for other windows.
50 /** Update the status bar to the new value.
51 @param value new value
52 @param newmsg if used, new message to display
53 @returns true if ABORT button has not been pressed
55 bool Update(int value
= -1, const wxString
& newmsg
= _T(""));
57 /** Can be called to continue after the cancel button has been pressed, but
58 the program decided to continue the operation (e.g., user didn't
61 void Resume() { m_state
= Continue
; }
63 /// Callback for optional abort button
64 void OnCancel(wxCommandEvent
& WXUNUSED(event
)) { m_state
= Canceled
; }
66 /// callback to disable "hard" window closing
67 void OnClose(wxCloseEvent
& event
);
71 class wxGauge
*m_gauge
;
72 /// the message displayed
73 class wxStaticText
*m_msg
;
74 /// disable all or parent window only
75 bool m_disableParentOnly
;
76 /// displayed elapsed, estimated, remaining time
77 class wxStaticText
*m_elapsed
, *m_estimated
, *m_remaining
;
78 /// time when the dialog was created or NULL
81 class wxWindow
*m_parent
;
82 /// continue processing or not (return value for Update())
85 Uncancelable
= -1, // dialog can't be canceled
86 Canceled
, // can be cancelled and, in fact, was
87 Continue
, // can be cancelled but wasn't
88 Finished
// finished, waiting to be removed from screen
90 /// the abort button (or NULL if none)
91 class wxButton
*m_btnAbort
;