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 FXPACKER_H
00025 #define FXPACKER_H
00026
00027 #ifndef FXCOMPOSITE_H
00028 #include "FXComposite.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00035 #define DEFAULT_SPACING FXWindow::defaultSpacing()
00036
00037
00051 class FXAPI FXPacker : public FXComposite {
00052 FXDECLARE(FXPacker)
00053 protected:
00054 FXColor baseColor;
00055 FXColor hiliteColor;
00056 FXColor shadowColor;
00057 FXColor borderColor;
00058 FXint padtop;
00059 FXint padbottom;
00060 FXint padleft;
00061 FXint padright;
00062 FXint hspacing;
00063 FXint vspacing;
00064 FXint border;
00065 protected:
00066 FXPacker();
00067 void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00068 void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00069 void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00070 void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00071 void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00072 void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00073 void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00074 void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00075 private:
00076 FXPacker(const FXPacker&);
00077 FXPacker &operator=(const FXPacker&);
00078 public:
00079 long onPaint(FXObject*,FXSelector,void*);
00080 long onFocusUp(FXObject*,FXSelector,void*);
00081 long onFocusDown(FXObject*,FXSelector,void*);
00082 long onFocusLeft(FXObject*,FXSelector,void*);
00083 long onFocusRight(FXObject*,FXSelector,void*);
00084 public:
00085
00087 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);
00088
00090 virtual FXint getDefaultWidth();
00091
00093 virtual FXint getDefaultHeight();
00094
00096 virtual void layout();
00097
00099 void setFrameStyle(FXuint style);
00100
00102 FXuint getFrameStyle() const;
00103
00105 void setPackingHints(FXuint ph);
00106
00108 FXuint getPackingHints() const;
00109
00111 FXint getBorderWidth() const { return border; }
00112
00114 void setPadTop(FXint pt);
00115
00117 FXint getPadTop() const { return padtop; }
00118
00120 void setPadBottom(FXint pb);
00121
00123 FXint getPadBottom() const { return padbottom; }
00124
00126 void setPadLeft(FXint pl);
00127
00129 FXint getPadLeft() const { return padleft; }
00130
00132 void setPadRight(FXint pr);
00133
00135 FXint getPadRight() const { return padright; }
00136
00138 void setHiliteColor(FXColor clr);
00139
00141 FXColor getHiliteColor() const { return hiliteColor; }
00142
00144 void setShadowColor(FXColor clr);
00145
00147 FXColor getShadowColor() const { return shadowColor; }
00148
00150 void setBorderColor(FXColor clr);
00151
00153 FXColor getBorderColor() const { return borderColor; }
00154
00156 void setBaseColor(FXColor clr);
00157
00159 FXColor getBaseColor() const { return baseColor; }
00160
00162 void setHSpacing(FXint hs);
00163
00165 FXint getHSpacing() const { return hspacing; }
00166
00168 void setVSpacing(FXint vs);
00169
00171 FXint getVSpacing() const { return vspacing; }
00172
00174 virtual void save(FXStream& store) const;
00175
00177 virtual void load(FXStream& store);
00178 };
00179
00180 }
00181
00182 #endif