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"
24 /** Progress dialog which shows a moving progress bar.
25 Taken from the Mahogany project.*/
27 class WXDLLEXPORT wxProgressDialog
: public wxFrame
29 DECLARE_DYNAMIC_CLASS(wxProgressDialog
)
31 /** Creates and displays dialog, disables event handling for other
32 frames or parent frame to avoid recursion problems.
33 @param title title for window
34 @param message message to display in window
35 @param maximum maximum value for status bar, if <= 0, no bar is shown
36 @param parent window or NULL
37 @param disableParentOnly if true, only disable parent window's
39 @param abortButton if true, dialog will show an abort button
41 wxProgressDialog(const wxString
&title
, wxString
const &message
,
43 wxWindow
*parent
= NULL
,
44 bool disableParentOnly
= FALSE
,
45 bool abortButton
= FALSE
);
47 Re-enables event handling for other windows.
51 /** Update the status bar to the new value.
52 @param value new value
53 @param newmsg if used, new message to display
54 @returns true if ABORT button has not been pressed
56 bool Update(int value
= -1, const wxString
& newmsg
= "");
58 /** Can be called to continue after the cancel button has been pressed, but
59 the program decided to continue the operation (e.g., user didn't
62 void Resume() { m_state
= Continue
; }
64 /// Callback for optional abort button
65 void OnCancel(wxEvent
& WXUNUSED(event
)) { m_state
= Canceled
; }
67 /// callback to disable "hard" window closing
68 void OnClose(wxCloseEvent
& event
);
72 class wxGauge
*m_gauge
;
73 /// the message displayed
74 class wxStaticText
*m_msg
;
75 /// disable all or parent window only
76 bool m_disableParentOnly
;
78 class wxWindow
*m_parent
;
79 /// continue processing or not (return value for Update())
82 Uncancelable
= -1, // dialog can't be canceled
83 Canceled
, // can be cancelled and, in fact, was
84 Continue
// can be cancelled but wasn't