]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: progdlg.h | |
3 | // Purpose: interface of wxProgressDialog | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxProgressDialog | |
11 | @wxheader{progdlg.h} | |
12 | ||
13 | This class represents a dialog that shows a short message and a | |
14 | progress bar. Optionally, it can display ABORT and SKIP buttons, | |
15 | the elapsed, remaining and estimated time for the end of the progress. | |
16 | ||
17 | @beginStyleTable | |
18 | @style{wxPD_APP_MODAL}: | |
19 | Make the progress dialog modal. If this flag is not given, it is | |
20 | only "locally" modal - that is the input to the parent window is | |
21 | disabled, but not to the other ones. | |
22 | @style{wxPD_AUTO_HIDE}: | |
23 | Causes the progress dialog to disappear from screen as soon as the | |
24 | maximum value of the progress meter has been reached. | |
25 | @style{wxPD_SMOOTH}: | |
26 | Causes smooth progress of the gauge control. | |
27 | @style{wxPD_CAN_ABORT}: | |
28 | This flag tells the dialog that it should have a "Cancel" button | |
29 | which the user may press. If this happens, the next call to | |
30 | Update() will return @false. | |
31 | @style{wxPD_CAN_SKIP}: | |
32 | This flag tells the dialog that it should have a "Skip" button | |
33 | which the user may press. If this happens, the next call to | |
34 | Update() will return @true in its skip parameter. | |
35 | @style{wxPD_ELAPSED_TIME}: | |
36 | This flag tells the dialog that it should show elapsed time (since | |
37 | creating the dialog). | |
38 | @style{wxPD_ESTIMATED_TIME}: | |
39 | This flag tells the dialog that it should show estimated time. | |
40 | @style{wxPD_REMAINING_TIME}: | |
41 | This flag tells the dialog that it should show remaining time. | |
42 | @endStyleTable | |
43 | ||
44 | @library{wxbase} | |
45 | @category{cmndlg} | |
46 | */ | |
47 | class wxProgressDialog : public wxDialog | |
48 | { | |
49 | public: | |
50 | /** | |
51 | Constructor. Creates the dialog, displays it and disables user input | |
52 | for other windows, or, if wxPD_APP_MODAL flag is not given, for its parent | |
53 | window only. | |
54 | ||
55 | @param title | |
56 | Dialog title to show in titlebar. | |
57 | @param message | |
58 | Message displayed above the progress bar. | |
59 | @param maximum | |
60 | Maximum value for the progress bar. | |
61 | @param parent | |
62 | Parent window. | |
63 | @param style | |
64 | The dialog style. See wxProgressDialog. | |
65 | */ | |
66 | wxProgressDialog(const wxString& title, const wxString& message, | |
67 | int maximum = 100, | |
68 | wxWindow* parent = NULL, | |
69 | int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL); | |
70 | ||
71 | /** | |
72 | Destructor. Deletes the dialog and enables all top level windows. | |
73 | */ | |
74 | ~wxProgressDialog(); | |
75 | ||
76 | /** | |
77 | Just like Update() but makes | |
78 | the gauge control run in indeterminate mode (see wxGauge documentation), | |
79 | sets the remaining and the estimated time labels (if present) to @c Unknown and | |
80 | moves | |
81 | the progress bar a bit to indicate that some progress was done. | |
82 | */ | |
83 | virtual bool Pulse(const wxString& newmsg = "", | |
84 | bool* skip = NULL); | |
85 | ||
86 | /** | |
87 | Can be used to continue with the dialog, after the user had chosen | |
88 | ABORT. | |
89 | */ | |
90 | void Resume(); | |
91 | ||
92 | /** | |
93 | Updates the dialog, setting the progress bar to the new value and, if | |
94 | given changes the message above it. Returns @true unless the Cancel button | |
95 | has been pressed. | |
96 | If @false is returned, the application can either immediately destroy the | |
97 | dialog | |
98 | or ask the user for the confirmation and if the abort is not confirmed the | |
99 | dialog may be resumed with Resume() function. | |
100 | ||
101 | @param value | |
102 | The new value of the progress meter. It should be less than or | |
103 | equal to the maximum value given to the constructor and the dialog is | |
104 | closed if | |
105 | it is equal to the maximum. | |
106 | @param newmsg | |
107 | The new messages for the progress dialog text, if it is | |
108 | empty (which is the default) the message is not changed. | |
109 | @param skip | |
110 | If "Skip" button was pressed since last | |
111 | Update call, this is set to @true. | |
112 | */ | |
113 | virtual bool Update(int value, const wxString& newmsg = "", | |
114 | bool* skip = NULL); | |
115 | }; | |
116 |