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