FXProgressBar.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      P r o g r e s s B a r   W i d g e t                      *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,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: FXProgressBar.h,v 1.22 2006/01/22 17:58:07 fox Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FXPROGRESSBAR_H
00025 #define FXPROGRESSBAR_H
00026 
00027 #ifndef FXFRAME_H
00028 #include "FXFrame.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00035 enum {
00036   PROGRESSBAR_HORIZONTAL = 0,             
00037   PROGRESSBAR_VERTICAL   = 0x00008000,    
00038   PROGRESSBAR_PERCENTAGE = 0x00010000,    
00039   PROGRESSBAR_DIAL       = 0x00020000,    
00040   PROGRESSBAR_NORMAL     = FRAME_SUNKEN|FRAME_THICK
00041   };
00042 
00043 
00045 class FXAPI FXProgressBar : public FXFrame {
00046   FXDECLARE(FXProgressBar)
00047 protected:
00048   FXuint   progress;                      // Integer percentage number
00049   FXuint   total;                         // Amount for completion
00050   FXint    barsize;                       // Bar size
00051   FXFont*  font;
00052   FXColor  barBGColor;
00053   FXColor  barColor;
00054   FXColor  textNumColor;
00055   FXColor  textAltColor;
00056 protected:
00057   FXProgressBar(){}
00058   void drawInterior(FXDCWindow& dc);
00059 private:
00060   FXProgressBar(const FXProgressBar&);
00061   FXProgressBar &operator=(const FXProgressBar&);
00062 public:
00063   long onPaint(FXObject*,FXSelector,void*);
00064   long onCmdSetValue(FXObject*,FXSelector,void*);
00065   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00066   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00067 public:
00068 
00070   FXProgressBar(FXComposite* p,FXObject* target=NULL,FXSelector sel=0,FXuint opts=PROGRESSBAR_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00071 
00073   virtual void create();
00074 
00076   virtual void detach();
00077 
00079   virtual FXint getDefaultWidth();
00080 
00082   virtual FXint getDefaultHeight();
00083 
00085   void setProgress(FXuint value);
00086 
00088   FXuint getProgress() const { return progress; }
00089 
00091   void setTotal(FXuint value);
00092 
00094   FXuint getTotal() const { return total; }
00095 
00097   void increment(FXuint value);
00098 
00100   void hideNumber();
00101 
00103   void showNumber();
00104 
00106   void setBarSize(FXint size);
00107 
00109   FXint getBarSize() const { return barsize; }
00110 
00112   void setBarBGColor(FXColor clr);
00113 
00115   FXColor getBarBGColor() const { return barBGColor; }
00116 
00118   void setBarColor(FXColor clr);
00119 
00121   FXColor getBarColor() const { return barColor; }
00122 
00124   void setTextColor(FXColor clr);
00125 
00127   FXColor getTextColor() const { return textNumColor; }
00128 
00130   void setTextAltColor(FXColor clr);
00131 
00133   FXColor getTextAltColor() const { return textAltColor; }
00134 
00136   void setFont(FXFont *fnt);
00137 
00139   FXFont* getFont() const { return font; }
00140 
00142   void setBarStyle(FXuint style);
00143 
00145   FXuint getBarStyle() const;
00146 
00148   virtual void save(FXStream& store) const;
00149 
00151   virtual void load(FXStream& store);
00152 
00154   virtual ~FXProgressBar();
00155   };
00156 
00157 }
00158 
00159 #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