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 FXTOPWINDOW_H
00025
#define FXTOPWINDOW_H
00026
00027
#ifndef FXSHELL_H
00028
#include "FXShell.h"
00029
#endif
00030
00031
00032
namespace FX {
00033
00034
00035
00036
enum {
00037
DECOR_NONE = 0,
00038
DECOR_TITLE = 0x00020000,
00039
DECOR_MINIMIZE = 0x00040000,
00040
DECOR_MAXIMIZE = 0x00080000,
00041
DECOR_CLOSE = 0x00100000,
00042
DECOR_BORDER = 0x00200000,
00043
DECOR_SHRINKABLE = 0x00400000,
00044
DECOR_STRETCHABLE = 0x00800000,
00045
DECOR_RESIZE =
DECOR_SHRINKABLE|
DECOR_STRETCHABLE,
00046
DECOR_MENU = 0x01000000,
00047 DECOR_ALL = (
DECOR_TITLE|
DECOR_MINIMIZE|
DECOR_MAXIMIZE|
DECOR_CLOSE|
DECOR_BORDER|
DECOR_SHRINKABLE|
DECOR_STRETCHABLE|
DECOR_MENU)
00048 };
00049
00050
00051
00052
enum {
00053
PLACEMENT_DEFAULT,
00054
PLACEMENT_VISIBLE,
00055
PLACEMENT_CURSOR,
00056
PLACEMENT_OWNER,
00057
PLACEMENT_SCREEN,
00058
PLACEMENT_MAXIMIZED
00059 };
00060
00061
00062
class FXToolBar;
00063
class FXIcon;
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
class FXAPI FXTopWindow :
public FXShell {
00089 FXDECLARE_ABSTRACT(FXTopWindow)
00090 protected:
00091 FXString title;
00092 FXIcon *icon;
00093 FXIcon *miniIcon;
00094 FXint padtop;
00095 FXint padbottom;
00096 FXint padleft;
00097 FXint padright;
00098 FXint hspacing;
00099 FXint vspacing;
00100 FXint offx;
00101 FXint offy;
00102 protected:
00103 FXTopWindow(){}
00104
void settitle();
00105
void seticons();
00106
void setdecorations();
00107 FXTopWindow(
FXApp* a,
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);
00108 FXTopWindow(
FXWindow* owner,
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);
00109
private:
00110 FXTopWindow(
const FXTopWindow&);
00111 FXTopWindow& operator=(
const FXTopWindow&);
00112
#ifdef WIN32
00113
virtual const char* GetClass() const;
00114 static
void* makeicon(
FXIcon* icon);
00115 #endif
00116 public:
00117
long onFocusUp(
FXObject*,FXSelector,
void*);
00118
long onFocusDown(FXObject*,FXSelector,
void*);
00119
long onFocusLeft(FXObject*,FXSelector,
void*);
00120
long onFocusRight(FXObject*,FXSelector,
void*);
00121
long onCmdMaximize(FXObject*,FXSelector,
void*);
00122
long onCmdMinimize(FXObject*,FXSelector,
void*);
00123
long onCmdRestore(FXObject*,FXSelector,
void*);
00124
long onCmdClose(FXObject*,FXSelector,
void*);
00125
long onCmdSetStringValue(FXObject*,FXSelector,
void*);
00126
long onCmdGetStringValue(FXObject*,FXSelector,
void*);
00127
long onCmdSetIconValue(FXObject*,FXSelector,
void*);
00128
long onCmdGetIconValue(FXObject*,FXSelector,
void*);
00129 public:
00130 enum {
00131 ID_MAXIMIZE=FXShell::ID_LAST,
00132 ID_MINIMIZE,
00133 ID_RESTORE,
00134 ID_CLOSE,
00135 ID_QUERY_DOCK,
00136 ID_LAST
00137 };
00138
public:
00139
00140
00141
virtual void create();
00142
00143
00144
virtual void detach();
00145
00146
00147
virtual void layout();
00148
00149
00150
virtual void setFocus();
00151
00152
00153
virtual void killFocus();
00154
00155
00156
virtual void show();
00157
00158
00159
virtual void hide();
00160
00161
00162
virtual void show(FXuint placement);
00163
00164
00165
void place(FXuint placement);
00166
00167
00168
virtual FXint getDefaultWidth();
00169
00170
00171
virtual FXint getDefaultHeight();
00172
00173
00174
virtual void move(FXint x,FXint y);
00175
00176
00177
virtual void resize(FXint w,FXint h);
00178
00179
00180
virtual void position(FXint x,FXint y,FXint w,FXint h);
00181
00182
00183
virtual FXbool maximize(FXbool notify=FALSE);
00184
00185
00186
virtual FXbool minimize(FXbool notify=FALSE);
00187
00188
00189
virtual FXbool restore(FXbool notify=FALSE);
00190
00191
00192
virtual FXbool close(FXbool notify=FALSE);
00193
00194
00195 FXbool isMaximized() const;
00196
00197
00198 FXbool isMinimized() const;
00199
00200
00201
void setTitle(const
FXString& name);
00202
00203
00204
FXString getTitle()
const {
return title; }
00205
00206
00207
void setPadTop(FXint pt);
00208
00209
00210 FXint getPadTop()
const {
return padtop; }
00211
00212
00213
void setPadBottom(FXint pb);
00214
00215
00216 FXint getPadBottom()
const {
return padbottom; }
00217
00218
00219
void setPadLeft(FXint pl);
00220
00221
00222 FXint getPadLeft()
const {
return padleft; }
00223
00224
00225
void setPadRight(FXint pr);
00226
00227
00228 FXint getPadRight()
const {
return padright; }
00229
00230
00231 FXint getHSpacing()
const {
return hspacing; }
00232
00233
00234 FXint getVSpacing()
const {
return vspacing; }
00235
00236
00237
void setHSpacing(FXint hs);
00238
00239
00240
void setVSpacing(FXint vs);
00241
00242
00243
void setPackingHints(FXuint ph);
00244
00245
00246 FXuint getPackingHints() const;
00247
00248
00249
void setDecorations(FXuint decorations);
00250
00251
00252 FXuint getDecorations() const;
00253
00254
00255
FXIcon* getIcon()
const {
return icon; }
00256
00257
00258
void setIcon(
FXIcon* ic);
00259
00260
00261
FXIcon* getMiniIcon()
const {
return miniIcon; }
00262
00263
00264
void setMiniIcon(FXIcon *ic);
00265
00266
00267
virtual void save(FXStream& store)
const;
00268
00269
00270
virtual void load(FXStream& store);
00271
00272
00273
virtual ~FXTopWindow();
00274 };
00275
00276 }
00277
00278
#endif