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