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 value for status bar, if <= 0, no bar is shown
36 @param parent window or NULL
37 @param style is the bit mask of wxPD_XXX constants from wx/defs.h
39 wxProgressDialog(const wxString
&title
, wxString
const &message
,
41 wxWindow
*parent
= NULL
,
42 int style
= wxPD_APP_MODAL
| wxPD_AUTO_HIDE
);
44 Re-enables event handling for other windows.
48 /** Update the status bar to the new value.
49 @param value new value
50 @param newmsg if used, new message to display
51 @returns true if ABORT button has not been pressed
53 bool Update(int value
= -1, const wxString
& newmsg
= "");
55 /** Can be called to continue after the cancel button has been pressed, but
56 the program decided to continue the operation (e.g., user didn't
59 void Resume() { m_state
= Continue
; }
61 /// Callback for optional abort button
62 void OnCancel(wxEvent
& WXUNUSED(event
)) { m_state
= Canceled
; }
64 /// callback to disable "hard" window closing
65 void OnClose(wxCloseEvent
& event
);
69 class wxGauge
*m_gauge
;
70 /// the message displayed
71 class wxStaticText
*m_msg
;
72 /// disable all or parent window only
73 bool m_disableParentOnly
;
75 class wxWindow
*m_parent
;
76 /// continue processing or not (return value for Update())
79 Uncancelable
= -1, // dialog can't be canceled
80 Canceled
, // can be cancelled and, in fact, was
81 Continue
, // can be cancelled but wasn't
82 Finished
// finished, waiting to be removed from screen
84 /// the abort button (or NULL if none)
85 class wxButton
*m_btnAbort
;