00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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;
00046 FXuint total;
00047 FXint barsize;
00048 FXFont* font;
00049 FXColor barBGColor;
00050 FXColor barColor;
00051 FXColor textNumColor;
00052 FXColor textAltColor;
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