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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXProgressBar.h
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,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXPROGRESSBAR_H
00022 #define FXPROGRESSBAR_H
00023 
00024 #ifndef FXFRAME_H
00025 #include "FXFrame.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum {
00033   PROGRESSBAR_HORIZONTAL = 0,             
00034   PROGRESSBAR_VERTICAL   = 0x00008000,    
00035   PROGRESSBAR_PERCENTAGE = 0x00010000,    
00036   PROGRESSBAR_DIAL       = 0x00020000,    
00037   PROGRESSBAR_NORMAL     = FRAME_SUNKEN|FRAME_THICK
00038   };
00039 
00040 
00042 class FXAPI FXProgressBar : public FXFrame {
00043   FXDECLARE(FXProgressBar)
00044 protected:
00045   FXuint   progress;            // Integer percentage number
00046   FXuint   total;               // Amount for completion
00047   FXint    barsize;             // Bar size
00048   FXFont*  font;                // Text font
00049   FXColor  barBGColor;          // Bar background color
00050   FXColor  barColor;            // Filled bar color
00051   FXColor  textNumColor;        // Text color inside bar background
00052   FXColor  textAltColor;        // Text color inside filled bar
00053 protected:
00054   FXProgressBar(){}
00055   void drawInterior(FXDCWindow& dc);
00056 private:
00057   FXProgressBar(const FXProgressBar&);
00058   FXProgressBar &operator=(const FXProgressBar&);
00059 public:
00060   long onPaint(FXObject*,FXSelector,void*);
00061   long onCmdSetValue(FXObject*,FXSelector,void*);
00062   long onCmdSetIntValue(FXObject*,FXSelector,void*);
00063   long onCmdGetIntValue(FXObject*,FXSelector,void*);
00064   long onCmdSetLongValue(FXObject*,FXSelector,void*);
00065   long onCmdGetLongValue(FXObject*,FXSelector,void*);
00066   long onCmdSetIntRange(FXObject*,FXSelector,void*);
00067   long onCmdGetIntRange(FXObject*,FXSelector,void*);
00068 public:
00069 
00071   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);
00072 
00074   virtual void create();
00075 
00077   virtual void detach();
00078 
00080   virtual FXint getDefaultWidth();
00081 
00083   virtual FXint getDefaultHeight();
00084 
00086   void setProgress(FXuint value);
00087 
00089   FXuint getProgress() const { return progress; }
00090 
00092   void setTotal(FXuint value);
00093 
00095   FXuint getTotal() const { return total; }
00096 
00098   void increment(FXuint value);
00099 
00101   void hideNumber();
00102 
00104   void showNumber();
00105 
00107   void setBarSize(FXint size);
00108 
00110   FXint getBarSize() const { return barsize; }
00111 
00113   void setBarBGColor(FXColor clr);
00114 
00116   FXColor getBarBGColor() const { return barBGColor; }
00117 
00119   void setBarColor(FXColor clr);
00120 
00122   FXColor getBarColor() const { return barColor; }
00123 
00125   void setTextColor(FXColor clr);
00126 
00128   FXColor getTextColor() const { return textNumColor; }
00129 
00131   void setTextAltColor(FXColor clr);
00132 
00134   FXColor getTextAltColor() const { return textAltColor; }
00135 
00137   void setFont(FXFont *fnt);
00138 
00140   FXFont* getFont() const { return font; }
00141 
00143   void setBarStyle(FXuint style);
00144 
00146   FXuint getBarStyle() const;
00147 
00149   virtual void save(FXStream& store) const;
00150 
00152   virtual void load(FXStream& store);
00153 
00155   virtual ~FXProgressBar();
00156   };
00157 
00158 }
00159 
00160 #endif

Copyright © 1997-2011 Jeroen van der Zijp