FXProgressDialog.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      P r o g r e s s   D i a l o g   B o x                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2001,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXProgressDialog.h,v 1.14 2006/01/22 17:58:07 fox Exp $                  *
00023 ********************************************************************************/
00024 #ifndef FXPROGRESSDIALOG_H
00025 #define FXPROGRESSDIALOG_H
00026 
00027 #ifndef FXDIALOGBOX_H
00028 #include "FXDialogBox.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 enum {
00035   PROGRESSDIALOG_NOCANCEL = 0,                        
00036   PROGRESSDIALOG_CANCEL   = 0x01000000,               
00037   PROGRESSDIALOG_NORMAL   = (DECOR_TITLE|DECOR_BORDER)
00038   };
00039 
00040 
00041 class FXHorizontalSeparator;
00042 class FXProgressBar;
00043 class FXButton;
00044 class FXLabel;
00045 
00051 class FXAPI FXProgressDialog : public FXDialogBox {
00052   FXDECLARE(FXProgressDialog)
00053 protected:
00054   FXProgressBar         *progress;    // Progress bar
00055   FXLabel               *message;     // Message
00056   FXHorizontalSeparator *separator;   // Separator
00057   FXButton              *cancel;      // Cancel button
00058   FXbool                 cancelled;   // User hit cancel
00059 protected:
00060   FXProgressDialog();
00061 private:
00062   FXProgressDialog(const FXProgressDialog&);
00063   FXProgressDialog &operator=(const FXProgressDialog&);
00064 public:
00065   long onCmdSetValue(FXObject*,FXSelector,void*);
00066   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00067   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00068   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00069   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00070   long onCmdCancel(FXObject*,FXSelector,void*);
00071 public:
00072 
00074   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);
00075 
00077   void setMessage(const FXString& msg);
00078 
00080   FXString getMessage() const;
00081 
00083   void setBarStyle(FXuint style);
00084 
00086   FXuint getBarStyle() const;
00087 
00089   void setProgress(FXuint value);
00090 
00092   FXuint getProgress() const;
00093 
00095   void setTotal(FXuint value);
00096 
00098   FXuint getTotal() const;
00099 
00101   void increment(FXuint value);
00102 
00104   FXbool isCancelled() const { return cancelled; }
00105 
00107   void setCancelled(FXbool flg){ cancelled=flg; }
00108 
00110   virtual ~FXProgressDialog();
00111   };
00112 
00113 }
00114 
00115 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:23 2009 for TnFOX by doxygen v1.4.7