Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXProgressDialog.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * P r o g r e s s D i a l o g B o x *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2001,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXProgressDialog.h,v 1.14 2006/01/22 17:58:07 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXPROGRESSDIALOG_H
25 #define FXPROGRESSDIALOG_H
26 
27 #ifndef FXDIALOGBOX_H
28 #include "FXDialogBox.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 enum {
35  PROGRESSDIALOG_NOCANCEL = 0, /// Default is no cancel button
36  PROGRESSDIALOG_CANCEL = 0x01000000, /// Enable the cancel button
38  };
39 
40 
42 class FXProgressBar;
43 class FXButton;
44 class FXLabel;
45 
46 /**
47 * A Progress Dialog is a simple dialog which is used to
48 * keep a user informed of the progress of a lengthy operation
49 * in a program and that the program is in fact still working.
50 */
53 protected:
54  FXProgressBar *progress; // Progress bar
55  FXLabel *message; // Message
56  FXHorizontalSeparator *separator; // Separator
57  FXButton *cancel; // Cancel button
58  FXbool cancelled; // User hit cancel
59 protected:
61 private:
63  FXProgressDialog &operator=(const FXProgressDialog&);
64 public:
65  long onCmdSetValue(FXObject*,FXSelector,void*);
66  long onCmdSetIntValue(FXObject*,FXSelector,void*);
67  long onCmdGetIntValue(FXObject*,FXSelector,void*);
68  long onCmdSetStringValue(FXObject*,FXSelector,void*);
69  long onCmdGetStringValue(FXObject*,FXSelector,void*);
70  long onCmdCancel(FXObject*,FXSelector,void*);
71 public:
72 
73  /// Construct input dialog box with given caption, icon, and prompt text
74  FXProgressDialog(FXWindow* owner,const FXString& caption,const FXString& label,FXuint opts=PROGRESSDIALOG_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
75 
76  /// Change the progress message
77  void setMessage(const FXString& msg);
78 
79  /// Get progress message
80  FXString getMessage() const;
81 
82  /// Change style of the progress bar widget
83  void setBarStyle(FXuint style);
84 
85  /// Get style of the progress bar widget
86  FXuint getBarStyle() const;
87 
88  /// Change the amount of progress
89  void setProgress(FXuint value);
90 
91  /// Get current progress
92  FXuint getProgress() const;
93 
94  /// Set total amount of progress
95  void setTotal(FXuint value);
96 
97  /// Return total amount of progrss
98  FXuint getTotal() const;
99 
100  /// Increment progress by given amount
101  void increment(FXuint value);
102 
103  /// Has operation been cancelled?
104  FXbool isCancelled() const { return cancelled; }
105 
106  /// Change cancelled flag
107  void setCancelled(FXbool flg){ cancelled=flg; }
108 
109  /// Destroy
110  virtual ~FXProgressDialog();
111  };
112 
113 }
114 
115 #endif
Definition: FXProgressDialog.h:37
DialogBox window.
Definition: FXDialogBox.h:40
A label widget can be used to place a text and/or icon for explanation purposes.
Definition: FXLabel.h:79
Base class for all windows.
Definition: FXWindow.h:115
unsigned int FXuint
Definition: fxdefs.h:396
Enable the cancel button.
Definition: FXProgressDialog.h:36
FXuint FXSelector
Association key.
Definition: FXObject.h:53
Window title.
Definition: FXTopWindow.h:41
A button provides a push button, with optional icon and/or text label.
Definition: FXButton.h:85
Border.
Definition: FXTopWindow.h:45
#define FXAPI
Definition: fxdefs.h:122
FXuchar FXbool
Definition: fxdefs.h:393
Horizontal separator widget.
Definition: FXSeparator.h:86
int FXint
Definition: fxdefs.h:397
A Progress Dialog is a simple dialog which is used to keep a user informed of the progress of a lengt...
Definition: FXProgressDialog.h:51
Progress bar widget.
Definition: FXProgressBar.h:53
Default is no cancel button.
Definition: FXProgressDialog.h:35
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp