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
00034
00035
enum { DEFAULT_SPACING = 4 };
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
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 drawFocusRectangle(
FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00075
void drawFrame(
FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00076 private:
00077 FXPacker(const FXPacker&);
00078 FXPacker &operator=(const FXPacker&);
00079 public:
00080
long onPaint(
FXObject*,FXSelector,
void*);
00081
long onFocusUp(FXObject*,FXSelector,
void*);
00082
long onFocusDown(FXObject*,FXSelector,
void*);
00083
long onFocusLeft(FXObject*,FXSelector,
void*);
00084
long onFocusRight(FXObject*,FXSelector,
void*);
00085 public:
00086
00087
00088 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);
00089
00090
00091 virtual FXint getDefaultWidth();
00092
00093
00094 virtual FXint getDefaultHeight();
00095
00096
00097 virtual
void layout();
00098
00099
00100
void setFrameStyle(FXuint style);
00101
00102
00103 FXuint getFrameStyle() const;
00104
00105
00106
void setPackingHints(FXuint ph);
00107
00108
00109 FXuint getPackingHints() const;
00110
00111
00112 FXint getBorderWidth()
const {
return border; }
00113
00114
00115
void setPadTop(FXint pt);
00116
00117
00118 FXint getPadTop()
const {
return padtop; }
00119
00120
00121
void setPadBottom(FXint pb);
00122
00123
00124 FXint getPadBottom()
const {
return padbottom; }
00125
00126
00127
void setPadLeft(FXint pl);
00128
00129
00130 FXint getPadLeft()
const {
return padleft; }
00131
00132
00133
void setPadRight(FXint pr);
00134
00135
00136 FXint getPadRight()
const {
return padright; }
00137
00138
00139
void setHiliteColor(FXColor clr);
00140
00141
00142 FXColor getHiliteColor()
const {
return hiliteColor; }
00143
00144
00145
void setShadowColor(FXColor clr);
00146
00147
00148 FXColor getShadowColor()
const {
return shadowColor; }
00149
00150
00151
void setBorderColor(FXColor clr);
00152
00153
00154 FXColor getBorderColor()
const {
return borderColor; }
00155
00156
00157
void setBaseColor(FXColor clr);
00158
00159
00160 FXColor getBaseColor()
const {
return baseColor; }
00161
00162
00163
void setHSpacing(FXint hs);
00164
00165
00166 FXint getHSpacing()
const {
return hspacing; }
00167
00168
00169
void setVSpacing(FXint vs);
00170
00171
00172 FXint getVSpacing()
const {
return vspacing; }
00173
00174
00175
virtual void save(FXStream& store)
const;
00176
00177
00178
virtual void load(FXStream& store);
00179 };
00180
00181 }
00182
00183
#endif