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 FXMDICHILD_H
00025
#define FXMDICHILD_H
00026
00027
#ifndef FXCOMPOSITE_H
00028
#include "FXComposite.h"
00029
#endif
00030
00031
namespace FX {
00032
00033
00034
class FXMDIClient;
00035
class FXMenuButton;
00036
class FXButton;
00037
class FXFont;
00038
00039
00040
00041
enum {
00042
MDI_NORMAL = 0,
00043
MDI_MAXIMIZED = 0x00001000,
00044
MDI_MINIMIZED = 0x00002000,
00045
MDI_TRACKING = 0x00004000
00046 };
00047
00048
00049
00050
00051
00052
00053
00054
class FXAPI FXMDIChild :
public FXComposite {
00055 FXDECLARE(FXMDIChild)
00056 protected:
00057 FXString title;
00058 FXMenuButton *windowbtn;
00059 FXButton *minimizebtn;
00060 FXButton *restorebtn;
00061 FXButton *maximizebtn;
00062
FXButton *deletebtn;
00063
FXFont *font;
00064 FXColor baseColor;
00065 FXColor hiliteColor;
00066 FXColor shadowColor;
00067 FXColor borderColor;
00068 FXColor titleColor;
00069 FXColor titleBackColor;
00070 FXint iconPosX;
00071 FXint iconPosY;
00072 FXint iconWidth;
00073 FXint iconHeight;
00074 FXint normalPosX;
00075 FXint normalPosY;
00076 FXint normalWidth;
00077 FXint normalHeight;
00078 FXint spotx;
00079 FXint spoty;
00080 FXint xoff;
00081 FXint yoff;
00082 FXint newx;
00083 FXint newy;
00084 FXint neww;
00085 FXint newh;
00086 FXuchar mode;
00087 protected:
00088 FXMDIChild();
00089
void drawRubberBox(FXint x,FXint y,FXint w,FXint h);
00090
void animateRectangles(FXint ox,FXint oy,FXint ow,FXint oh,FXint nx,FXint ny,FXint nw,FXint nh);
00091 FXuchar where(FXint x,FXint y);
00092
void changeCursor(FXint x,FXint y);
00093
void revertCursor();
00094 protected:
00095 enum {
00096 DRAG_NONE = 0,
00097 DRAG_TOP = 1,
00098 DRAG_BOTTOM = 2,
00099 DRAG_LEFT = 4,
00100 DRAG_RIGHT = 8,
00101 DRAG_TOPLEFT = (DRAG_TOP|DRAG_LEFT),
00102 DRAG_TOPRIGHT = (DRAG_TOP|DRAG_RIGHT),
00103 DRAG_BOTTOMLEFT = (DRAG_BOTTOM|DRAG_LEFT),
00104 DRAG_BOTTOMRIGHT = (DRAG_BOTTOM|DRAG_RIGHT),
00105 DRAG_INVERTED = 16,
00106 DRAG_TITLE = 32
00107 };
00108
private:
00109 FXMDIChild(
const FXMDIChild&);
00110 FXMDIChild &operator=(
const FXMDIChild&);
00111
public:
00112
long onPaint(
FXObject*,FXSelector,
void*);
00113
long onFocusSelf(
FXObject*,FXSelector,
void*);
00114
long onFocusIn(
FXObject*,FXSelector,
void*);
00115
long onFocusOut(
FXObject*,FXSelector,
void*);
00116
long onRightBtnPress(
FXObject*,FXSelector,
void*);
00117
long onRightBtnRelease(
FXObject*,FXSelector,
void*);
00118
long onLeftBtnPress(
FXObject*,FXSelector,
void*);
00119
long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
00120
long onMiddleBtnPress(
FXObject*,FXSelector,
void*);
00121
long onMiddleBtnRelease(
FXObject*,FXSelector,
void*);
00122
long onMotion(
FXObject*,FXSelector,
void*);
00123
long onSelected(
FXObject*,FXSelector,
void*);
00124
long onDeselected(
FXObject*,FXSelector,
void*);
00125
long onCmdClose(
FXObject*,FXSelector,
void*);
00126
long onUpdClose(
FXObject*,FXSelector,
void*);
00127
long onCmdRestore(
FXObject*,FXSelector,
void*);
00128
long onUpdRestore(
FXObject*,FXSelector,
void*);
00129
long onUpdMaximize(
FXObject*,FXSelector,
void*);
00130
long onUpdMinimize(
FXObject*,FXSelector,
void*);
00131 long onCmdMaximize(
FXObject*,FXSelector,
void*);
00132
long onCmdMinimize(
FXObject*,FXSelector,
void*);
00133
long onUpdWindow(
FXObject*,FXSelector,
void*);
00134
long onUpdMenuRestore(
FXObject*,FXSelector,
void*);
00135
long onUpdMenuMinimize(
FXObject*,FXSelector,
void*);
00136
long onUpdMenuClose(
FXObject*,FXSelector,
void*);
00137 long onUpdMenuWindow(
FXObject*,FXSelector,
void*);
00138
long onCmdSetStringValue(
FXObject*,FXSelector,
void*);
00139
long onCmdGetStringValue(
FXObject*,FXSelector,
void*);
00140
long onCmdSetIconValue(
FXObject*,FXSelector,
void*);
00141
long onCmdGetIconValue(
FXObject*,FXSelector,
void*);
00142
virtual long onDefault(
FXObject*,FXSelector,
void*);
00143 public:
00144
00145
00146 FXMDIChild(
FXMDIClient* p,
const FXString& name,
FXIcon* ic=NULL,
FXPopup* pup=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00147
00148
00149 virtual void create();
00150
00151
00152
virtual void detach();
00153
00154
00155
virtual void layout();
00156
00157
00158
virtual FXint getDefaultWidth();
00159
00160
00161 virtual FXint getDefaultHeight();
00162
00163
00164 virtual void setFocus();
00165
00166
00167
virtual FXbool canFocus() const;
00168
00169
00170 virtual
void move(FXint x,FXint y);
00171
00172
00173 virtual
void resize(FXint w,FXint h);
00174
00175
00176 virtual
void position(FXint x,FXint y,FXint w,FXint h);
00177
00178
00179
void setNormalX(FXint x){ normalPosX=x; }
00180
void setNormalY(FXint y){ normalPosY=y; }
00181
void setNormalWidth(FXint w){ normalWidth=w; }
00182
void setNormalHeight(FXint h){ normalHeight=h; }
00183
00184
00185 FXint getNormalX()
const {
return normalPosX; }
00186 FXint getNormalY()
const {
return normalPosY; }
00187 FXint getNormalWidth()
const {
return normalWidth; }
00188 FXint getNormalHeight()
const {
return normalHeight; }
00189
00190
00191
void setIconX(FXint x){ iconPosX=x; }
00192
void setIconY(FXint y){ iconPosY=y; }
00193
void setIconWidth(FXint w){ iconWidth=w; }
00194
void setIconHeight(FXint h){ iconHeight=h; }
00195
00196
00197 FXint getIconX()
const {
return iconPosX; }
00198 FXint getIconY()
const {
return iconPosY; }
00199 FXint getIconWidth()
const {
return iconWidth; }
00200 FXint getIconHeight()
const {
return iconHeight; }
00201
00202
00203 FXWindow *contentWindow() const;
00204
00205
00206
void setTitle(const FXString& name);
00207
00208
00209 FXString getTitle()
const {
return title; }
00210
00211
00212 FXColor getHiliteColor()
const {
return hiliteColor; }
00213 FXColor getShadowColor()
const {
return shadowColor; }
00214 FXColor getBaseColor()
const {
return baseColor; }
00215 FXColor getBorderColor()
const {
return borderColor; }
00216 FXColor getTitleColor ()
const {
return titleColor; }
00217 FXColor getTitleBackColor()
const {
return titleBackColor; }
00218
00219
00220
void setHiliteColor(FXColor clr);
00221
void setShadowColor(FXColor clr);
00222
void setBaseColor(FXColor clr);
00223
void setBorderColor(FXColor clr);
00224
void setTitleColor(FXColor clr);
00225
void setTitleBackColor(FXColor clr);
00226
00227
00228
virtual FXbool maximize(FXbool notify=FALSE);
00229
00230
00231
virtual FXbool minimize(FXbool notify=FALSE);
00232
00233
00234
virtual FXbool restore(FXbool notify=FALSE);
00235
00236
00237
virtual FXbool close(FXbool notify=FALSE);
00238
00239
00240 FXbool isMaximized() const;
00241
00242
00243 FXbool isMinimized() const;
00244
00245
00246
FXIcon *getIcon() const;
00247
00248
00249
void setIcon(
FXIcon* icon);
00250
00251
00252
FXPopup* getMenu() const;
00253
00254
00255
void setMenu(
FXPopup* menu);
00256
00257
00258
void setTracking(FXbool tracking=TRUE);
00259
00260
00261 FXbool getTracking() const;
00262
00263
00264
void setFont(
FXFont *fnt);
00265
00266
00267
FXFont* getFont()
const {
return font; }
00268
00269
00270
virtual void save(
FXStream& store)
const;
00271
00272
00273
virtual void load(
FXStream& store);
00274
00275
00276
virtual ~FXMDIChild();
00277 };
00278
00279 }
00280
00281
#endif