1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/progdlg.h
3 // Purpose: wxProgressDialog
4 // Author: Rickard Westerlund
7 // Copyright: (c) 2010 wxWidgets team
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PROGDLG_H_
12 #define _WX_PROGDLG_H_
14 class wxProgressDialogTaskRunner
;
15 class wxProgressDialogSharedData
;
17 class WXDLLIMPEXP_CORE wxProgressDialog
: public wxGenericProgressDialog
20 wxProgressDialog(const wxString
& title
, const wxString
& message
,
22 wxWindow
*parent
= NULL
,
23 int style
= wxPD_APP_MODAL
| wxPD_AUTO_HIDE
);
25 virtual ~wxProgressDialog();
27 virtual bool Update(int value
, const wxString
& newmsg
= wxEmptyString
, bool *skip
= NULL
);
28 virtual bool Pulse(const wxString
& newmsg
= wxEmptyString
, bool *skip
= NULL
);
33 wxString
GetMessage() const;
35 void SetRange(int maximum
);
37 // Return whether "Cancel" or "Skip" button was pressed, always return
38 // false if the corresponding button is not shown.
39 bool WasSkipped() const;
40 bool WasCancelled() const;
42 virtual void SetTitle(const wxString
& title
);
43 virtual wxString
GetTitle() const;
45 virtual bool Show( bool show
= true );
47 // Must provide overload to avoid hiding it (and warnings about it)
48 virtual void Update() { wxGenericProgressDialog::Update(); }
51 // Returns true if the task dialog is available. If not, all the methods of
52 // this class simply fall back to wxGenericProgressDialog versions.
53 bool HasNativeProgressDialog() const;
55 // Performs common routines to Update() and Pulse(). Requires the
56 // shared object to have been entered.
57 bool DoNativeBeforeUpdate(bool *skip
);
59 // Updates the various timing informations for both determinate
60 // and indeterminate modes. Requires the shared object to have
62 void UpdateExpandedInformation(int value
);
64 wxProgressDialogTaskRunner
*m_taskDialogRunner
;
66 wxProgressDialogSharedData
*m_sharedData
;
68 // Store the message and title we currently use to be able to return it
69 // from Get{Message,Title}()
73 wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxProgressDialog
);
76 #endif // _WX_PROGDLG_H_