00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXTOPWINDOW_H
00022 #define FXTOPWINDOW_H
00023
00024 #ifndef FXSHELL_H
00025 #include "FXShell.h"
00026 #endif
00027
00028
00029 namespace FX {
00030
00031
00032
00033 enum {
00034 DECOR_NONE = 0,
00035 DECOR_TITLE = 0x00020000,
00036 DECOR_MINIMIZE = 0x00040000,
00037 DECOR_MAXIMIZE = 0x00080000,
00038 DECOR_CLOSE = 0x00100000,
00039 DECOR_BORDER = 0x00200000,
00040 DECOR_SHRINKABLE = 0x00400000,
00041 DECOR_STRETCHABLE = 0x00800000,
00042 DECOR_RESIZE = DECOR_SHRINKABLE|DECOR_STRETCHABLE,
00043 DECOR_MENU = 0x01000000,
00044 DECOR_ALL = (DECOR_TITLE|DECOR_MINIMIZE|DECOR_MAXIMIZE|DECOR_CLOSE|DECOR_BORDER|DECOR_SHRINKABLE|DECOR_STRETCHABLE|DECOR_MENU)
00045 };
00046
00047
00048
00049 enum {
00050 PLACEMENT_DEFAULT,
00051 PLACEMENT_VISIBLE,
00052 PLACEMENT_CURSOR,
00053 PLACEMENT_OWNER,
00054 PLACEMENT_SCREEN,
00055 PLACEMENT_MAXIMIZED
00056 };
00057
00058
00059
00060 enum {
00061 STACK_NORMAL,
00062 STACK_BOTTOM,
00063 STACK_TOP
00064 };
00065
00066
00067 class FXToolBar;
00068 class FXIcon;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 class FXAPI FXTopWindow : public FXShell {
00099 FXDECLARE_ABSTRACT(FXTopWindow)
00100 protected:
00101 FXString title;
00102 FXIcon *icon;
00103 FXIcon *miniIcon;
00104 FXint padtop;
00105 FXint padbottom;
00106 FXint padleft;
00107 FXint padright;
00108 FXint hspacing;
00109 FXint vspacing;
00110 protected:
00111 FXTopWindow();
00112 void settitle();
00113 void seticons();
00114 void setdecorations();
00115 FXTopWindow(FXApp* ap,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs);
00116 FXTopWindow(FXWindow* ow,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs);
00117 private:
00118 FXTopWindow(const FXTopWindow&);
00119 FXTopWindow& operator=(const FXTopWindow&);
00120 #ifdef WIN32
00121 virtual const void* GetClass() const;
00122 #endif
00123 public:
00124 long onFocusUp(FXObject*,FXSelector,void*);
00125 long onFocusDown(FXObject*,FXSelector,void*);
00126 long onFocusLeft(FXObject*,FXSelector,void*);
00127 long onFocusRight(FXObject*,FXSelector,void*);
00128 long onSessionNotify(FXObject*,FXSelector,void*);
00129 long onSessionClosed(FXObject*,FXSelector,void*);
00130 long onRestore(FXObject*,FXSelector,void*);
00131 long onMaximize(FXObject*,FXSelector,void*);
00132 long onMinimize(FXObject*,FXSelector,void*);
00133 long onCmdRestore(FXObject*,FXSelector,void*);
00134 long onCmdMaximize(FXObject*,FXSelector,void*);
00135 long onCmdMinimize(FXObject*,FXSelector,void*);
00136 long onCmdFullScreen(FXObject*,FXSelector,void*);
00137 long onCmdClose(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 public:
00143 enum {
00144 ID_RESTORE=FXShell::ID_LAST,
00145 ID_MAXIMIZE,
00146 ID_MINIMIZE,
00147 ID_FULLSCREEN,
00148 ID_CLOSE,
00149 ID_QUERY_DOCK,
00150 ID_LAST
00151 };
00152 public:
00153
00154
00155 virtual void create();
00156
00157
00158 virtual void detach();
00159
00160
00161 virtual void destroy();
00162
00163
00164 virtual void layout();
00165
00166
00167 virtual void setFocus();
00168
00169
00170 virtual void killFocus();
00171
00172
00173 virtual void show();
00174
00175
00176 virtual void hide();
00177
00178
00179 virtual void show(FXuint placement);
00180
00181
00182 void place(FXuint placement);
00183
00184
00185 virtual FXint getDefaultWidth();
00186
00187
00188 virtual FXint getDefaultHeight();
00189
00190
00191 FXbool getWMBorders(FXint& left,FXint& right,FXint& top,FXint& bottom);
00192
00193
00194 virtual void raise();
00195
00196
00197 virtual void lower();
00198
00199
00200 virtual void move(FXint x,FXint y);
00201
00202
00203 virtual void resize(FXint w,FXint h);
00204
00205
00206 virtual void position(FXint x,FXint y,FXint w,FXint h);
00207
00208
00209 virtual void flash(FXbool yes);
00210
00211
00212 virtual FXbool restore(FXbool notify=false);
00213
00214
00215 virtual FXbool maximize(FXbool notify=false);
00216
00217
00218 virtual FXbool minimize(FXbool notify=false);
00219
00220
00221 virtual FXbool fullScreen(FXbool notify=false);
00222
00223
00224 virtual FXbool stackingOrder(FXuint order);
00225
00226
00227
00228
00229
00230
00231
00232
00233 virtual FXbool close(FXbool notify=false);
00234
00235
00236 FXbool isMaximized() const;
00237
00238
00239 FXbool isMinimized() const;
00240
00241
00242 FXbool isFullScreen() const;
00243
00244
00245 void setTitle(const FXString& name);
00246
00247
00248 FXString getTitle() const { return title; }
00249
00250
00251 void setPadTop(FXint pt);
00252
00253
00254 FXint getPadTop() const { return padtop; }
00255
00256
00257 void setPadBottom(FXint pb);
00258
00259
00260 FXint getPadBottom() const { return padbottom; }
00261
00262
00263 void setPadLeft(FXint pl);
00264
00265
00266 FXint getPadLeft() const { return padleft; }
00267
00268
00269 void setPadRight(FXint pr);
00270
00271
00272 FXint getPadRight() const { return padright; }
00273
00274
00275 FXint getHSpacing() const { return hspacing; }
00276
00277
00278 FXint getVSpacing() const { return vspacing; }
00279
00280
00281 void setHSpacing(FXint hs);
00282
00283
00284 void setVSpacing(FXint vs);
00285
00286
00287 void setPackingHints(FXuint ph);
00288
00289
00290 FXuint getPackingHints() const;
00291
00292
00293 void setDecorations(FXuint decorations);
00294
00295
00296 FXuint getDecorations() const;
00297
00298
00299 FXIcon* getIcon() const { return icon; }
00300
00301
00302 void setIcon(FXIcon* ic);
00303
00304
00305 FXIcon* getMiniIcon() const { return miniIcon; }
00306
00307
00308 void setMiniIcon(FXIcon *ic);
00309
00310
00311 virtual void save(FXStream& store) const;
00312
00313
00314 virtual void load(FXStream& store);
00315
00316
00317 virtual ~FXTopWindow();
00318 };
00319
00320 }
00321
00322 #endif