00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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;
00049 FXuint total;
00050 FXint barsize;
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