]> git.saurik.com Git - wxWidgets.git/blame - interface/progdlg.h
add wxShowEvent::IsShown() and wxIconizeEvent::IsIconized() instead of (now deprecate...
[wxWidgets.git] / interface / progdlg.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: progdlg.h
e54c96f1 3// Purpose: interface of wxProgressDialog
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxProgressDialog
11 @wxheader{progdlg.h}
7c913512 12
23324ae1
FM
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.
7c913512 16
23324ae1 17 @beginStyleTable
8c6791e4 18 @style{wxPD_APP_MODAL}
23324ae1
FM
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.
8c6791e4 22 @style{wxPD_AUTO_HIDE}
23324ae1
FM
23 Causes the progress dialog to disappear from screen as soon as the
24 maximum value of the progress meter has been reached.
8c6791e4 25 @style{wxPD_SMOOTH}
23324ae1 26 Causes smooth progress of the gauge control.
8c6791e4 27 @style{wxPD_CAN_ABORT}
23324ae1
FM
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.
8c6791e4 31 @style{wxPD_CAN_SKIP}
23324ae1
FM
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.
8c6791e4 35 @style{wxPD_ELAPSED_TIME}
23324ae1
FM
36 This flag tells the dialog that it should show elapsed time (since
37 creating the dialog).
8c6791e4 38 @style{wxPD_ESTIMATED_TIME}
23324ae1 39 This flag tells the dialog that it should show estimated time.
8c6791e4 40 @style{wxPD_REMAINING_TIME}
23324ae1
FM
41 This flag tells the dialog that it should show remaining time.
42 @endStyleTable
7c913512 43
23324ae1
FM
44 @library{wxbase}
45 @category{cmndlg}
46*/
47class wxProgressDialog : public wxDialog
48{
49public:
50 /**
51 Constructor. Creates the dialog, displays it and disables user input
b1b95a65
FM
52 for other windows, or, if @c wxPD_APP_MODAL flag is not given, for its
53 parent window only.
3c4f71cc 54
7c913512 55 @param title
4cc4bfaf 56 Dialog title to show in titlebar.
7c913512 57 @param message
4cc4bfaf 58 Message displayed above the progress bar.
7c913512 59 @param maximum
4cc4bfaf 60 Maximum value for the progress bar.
7c913512 61 @param parent
4cc4bfaf 62 Parent window.
7c913512 63 @param style
4cc4bfaf 64 The dialog style. See wxProgressDialog.
23324ae1
FM
65 */
66 wxProgressDialog(const wxString& title, const wxString& message,
67 int maximum = 100,
4cc4bfaf 68 wxWindow* parent = NULL,
23324ae1
FM
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 /**
b1b95a65
FM
77 Works like Update() but makes the gauge control run in indeterminate mode
78 (see wxGauge documentation); sets the remaining and the estimated time labels
79 (if present) to "Unknown" or to @a newmsg (if it's non-empty); moves the progress
80 bar a bit to indicate that some progress was done.
23324ae1
FM
81 */
82 virtual bool Pulse(const wxString& newmsg = "",
4cc4bfaf 83 bool* skip = NULL);
23324ae1
FM
84
85 /**
b1b95a65 86 Can be used to continue with the dialog, after the user had clicked the "Abort" button.
23324ae1
FM
87 */
88 void Resume();
89
90 /**
91 Updates the dialog, setting the progress bar to the new value and, if
b1b95a65 92 given changes the message above it. Returns @true unless the "Cancel" button
23324ae1 93 has been pressed.
b1b95a65 94
23324ae1 95 If @false is returned, the application can either immediately destroy the
b1b95a65
FM
96 dialog or ask the user for the confirmation and if the abort is not confirmed
97 the dialog may be resumed with Resume() function.
3c4f71cc 98
7c913512 99 @param value
b1b95a65
FM
100 The new value of the progress meter. It should be less than or equal to
101 the maximum value given to the constructor and the dialog is closed if
4cc4bfaf 102 it is equal to the maximum.
7c913512 103 @param newmsg
4cc4bfaf
FM
104 The new messages for the progress dialog text, if it is
105 empty (which is the default) the message is not changed.
7c913512 106 @param skip
b1b95a65
FM
107 If "Skip" button was pressed since last Update() call,
108 this is set to @true.
23324ae1
FM
109 */
110 virtual bool Update(int value, const wxString& newmsg = "",
4cc4bfaf 111 bool* skip = NULL);
23324ae1 112};
e54c96f1 113