00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXPACKER_H
00022 #define FXPACKER_H
00023
00024 #ifndef FXCOMPOSITE_H
00025 #include "FXComposite.h"
00026 #endif
00027
00028 namespace FX {
00029
00030
00032 enum { DEFAULT_SPACING = 4 };
00033
00034
00048 class FXAPI FXPacker : public FXComposite {
00049 FXDECLARE(FXPacker)
00050 protected:
00051 FXColor baseColor;
00052 FXColor hiliteColor;
00053 FXColor shadowColor;
00054 FXColor borderColor;
00055 FXint padtop;
00056 FXint padbottom;
00057 FXint padleft;
00058 FXint padright;
00059 FXint hspacing;
00060 FXint vspacing;
00061 FXint border;
00062 protected:
00063 FXPacker();
00064 void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00065 void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00066 void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00067 void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00068 void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00069 void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00070 void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00071 void drawFocusRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00072 void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00073 private:
00074 FXPacker(const FXPacker&);
00075 FXPacker &operator=(const FXPacker&);
00076 public:
00077 long onPaint(FXObject*,FXSelector,void*);
00078 long onFocusUp(FXObject*,FXSelector,void*);
00079 long onFocusDown(FXObject*,FXSelector,void*);
00080 long onFocusLeft(FXObject*,FXSelector,void*);
00081 long onFocusRight(FXObject*,FXSelector,void*);
00082 public:
00083
00085 FXPacker(FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
00086
00088 virtual FXint getDefaultWidth();
00089
00091 virtual FXint getDefaultHeight();
00092
00094 virtual void layout();
00095
00097 void setFrameStyle(FXuint style);
00098
00100 FXuint getFrameStyle() const;
00101
00103 void setPackingHints(FXuint ph);
00104
00106 FXuint getPackingHints() const;
00107
00109 FXint getBorderWidth() const { return border; }
00110
00112 void setPadTop(FXint pt);
00113
00115 FXint getPadTop() const { return padtop; }
00116
00118 void setPadBottom(FXint pb);
00119
00121 FXint getPadBottom() const { return padbottom; }
00122
00124 void setPadLeft(FXint pl);
00125
00127 FXint getPadLeft() const { return padleft; }
00128
00130 void setPadRight(FXint pr);
00131
00133 FXint getPadRight() const { return padright; }
00134
00136 void setHiliteColor(FXColor clr);
00137
00139 FXColor getHiliteColor() const { return hiliteColor; }
00140
00142 void setShadowColor(FXColor clr);
00143
00145 FXColor getShadowColor() const { return shadowColor; }
00146
00148 void setBorderColor(FXColor clr);
00149
00151 FXColor getBorderColor() const { return borderColor; }
00152
00154 void setBaseColor(FXColor clr);
00155
00157 FXColor getBaseColor() const { return baseColor; }
00158
00160 void setHSpacing(FXint hs);
00161
00163 FXint getHSpacing() const { return hspacing; }
00164
00166 void setVSpacing(FXint vs);
00167
00169 FXint getVSpacing() const { return vspacing; }
00170
00172 virtual void save(FXStream& store) const;
00173
00175 virtual void load(FXStream& store);
00176 };
00177
00178 }
00179
00180 #endif