]>
Commit | Line | Data |
---|---|---|
c31d9c7f VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/msw/progdlg.h | |
3 | // Purpose: wxProgressDialog | |
4 | // Author: Rickard Westerlund | |
5 | // Created: 2010-07-22 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2010 wxWidgets team | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_PROGDLG_H_ | |
12 | #define _WX_PROGDLG_H_ | |
13 | ||
14 | class wxProgressDialogTaskRunner; | |
15 | class wxProgressDialogSharedData; | |
16 | ||
17 | class WXDLLIMPEXP_CORE wxProgressDialog : public wxGenericProgressDialog | |
18 | { | |
19 | public: | |
20 | wxProgressDialog(const wxString& title, const wxString& message, | |
21 | int maximum = 100, | |
22 | wxWindow *parent = NULL, | |
23 | int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE); | |
24 | ||
25 | virtual ~wxProgressDialog(); | |
26 | ||
27 | virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL); | |
28 | virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL); | |
29 | ||
30 | void Resume(); | |
31 | ||
32 | int GetValue() const; | |
33 | wxString GetMessage() const; | |
34 | ||
35 | void SetRange(int maximum); | |
36 | ||
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; | |
41 | ||
42 | virtual void SetTitle(const wxString& title); | |
43 | virtual wxString GetTitle() const; | |
44 | ||
45 | virtual bool Show( bool show = true ); | |
46 | ||
47 | // Must provide overload to avoid hiding it (and warnings about it) | |
48 | virtual void Update() { wxGenericProgressDialog::Update(); } | |
49 | ||
01bd848e RD |
50 | virtual WXWidget GetHandle() const; |
51 | ||
c31d9c7f | 52 | private: |
c31d9c7f VZ |
53 | // Performs common routines to Update() and Pulse(). Requires the |
54 | // shared object to have been entered. | |
55 | bool DoNativeBeforeUpdate(bool *skip); | |
56 | ||
57 | // Updates the various timing informations for both determinate | |
58 | // and indeterminate modes. Requires the shared object to have | |
59 | // been entered. | |
60 | void UpdateExpandedInformation(int value); | |
61 | ||
62 | wxProgressDialogTaskRunner *m_taskDialogRunner; | |
63 | ||
64 | wxProgressDialogSharedData *m_sharedData; | |
65 | ||
66 | // Store the message and title we currently use to be able to return it | |
67 | // from Get{Message,Title}() | |
68 | wxString m_message, | |
69 | m_title; | |
70 | ||
71 | wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxProgressDialog); | |
72 | }; | |
73 | ||
74 | #endif // _WX_PROGDLG_H_ |