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"
25 /** Progress dialog which shows a moving progress bar.
26 Taken from the Mahogany project.*/
28 class WXDLLEXPORT wxProgressDialog
: public wxFrame
30 DECLARE_DYNAMIC_CLASS(wxProgressDialog
)
32 /** Creates and displays dialog, disables event handling for other
33 frames or parent frame to avoid recursion problems.
34 @param title title for window
35 @param message message to display in window
36 @param maximum value for status bar, if <= 0, no bar is shown
37 @param parent window or NULL
38 @param style is the bit mask of wxPD_XXX constants from wx/defs.h
40 wxProgressDialog(const wxString
&title
, wxString
const &message
,
42 wxWindow
*parent
= NULL
,
43 int style
= wxPD_APP_MODAL
| wxPD_AUTO_HIDE
);
45 Re-enables event handling for other windows.
49 /** Update the status bar to the new value.
50 @param value new value
51 @param newmsg if used, new message to display
52 @returns true if ABORT button has not been pressed
54 bool Update(int value
= -1, const wxString
& newmsg
= _T(""));
56 /** Can be called to continue after the cancel button has been pressed, but
57 the program decided to continue the operation (e.g., user didn't
60 void Resume() { m_state
= Continue
; }
62 /// Callback for optional abort button
63 void OnCancel(wxCommandEvent
& WXUNUSED(event
)) { m_state
= Canceled
; }
65 /// callback to disable "hard" window closing
66 void OnClose(wxCloseEvent
& event
);
70 class wxGauge
*m_gauge
;
71 /// the message displayed
72 class wxStaticText
*m_msg
;
73 /// disable all or parent window only
74 bool m_disableParentOnly
;
76 class wxWindow
*m_parent
;
77 /// continue processing or not (return value for Update())
80 Uncancelable
= -1, // dialog can't be canceled
81 Canceled
, // can be cancelled and, in fact, was
82 Continue
, // can be cancelled but wasn't
83 Finished
// finished, waiting to be removed from screen
85 /// the abort button (or NULL if none)
86 class wxButton
*m_btnAbort
;