Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXTopWindow.h
1 /********************************************************************************
2 * *
3 * T o p - L e v e l W i n d o w W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2022 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXTOPWINDOW_H
22 #define FXTOPWINDOW_H
23 
24 #ifndef FXSHELL_H
25 #include "FXShell.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 enum {
33  DECOR_NONE = 0,
34  DECOR_TITLE = 0x00020000,
35  DECOR_MINIMIZE = 0x00040000,
36  DECOR_MAXIMIZE = 0x00080000,
37  DECOR_CLOSE = 0x00100000,
38  DECOR_BORDER = 0x00200000,
39  DECOR_SHRINKABLE = 0x00400000,
40  DECOR_STRETCHABLE = 0x00800000,
41  DECOR_RESIZE = DECOR_SHRINKABLE|DECOR_STRETCHABLE,
42  DECOR_MENU = 0x01000000,
43  DECOR_ALL = (DECOR_TITLE|DECOR_MINIMIZE|DECOR_MAXIMIZE|DECOR_CLOSE|DECOR_BORDER|DECOR_SHRINKABLE|DECOR_STRETCHABLE|DECOR_MENU)
44  };
45 
46 
48 enum {
49  PLACEMENT_DEFAULT,
50  PLACEMENT_VISIBLE,
51  PLACEMENT_CURSOR,
52  PLACEMENT_OWNER,
53  PLACEMENT_SCREEN,
54  PLACEMENT_MAXIMIZED
55  };
56 
57 
59 enum {
60  STACK_NORMAL,
61  STACK_BOTTOM,
62  STACK_TOP
63  };
64 
65 
66 class FXToolBar;
67 class FXIcon;
68 
69 
97 class FXAPI FXTopWindow : public FXShell {
98  FXDECLARE_ABSTRACT(FXTopWindow)
99 protected:
100  FXString title; // Window title
101  FXIcon *icon; // Window icon (big)
102  FXIcon *miniIcon; // Window icon (small)
103  FXint padtop; // Top margin
104  FXint padbottom; // Bottom margin
105  FXint padleft; // Left margin
106  FXint padright; // Right margin
107  FXint hspacing; // Horizontal child spacing
108  FXint vspacing; // Vertical child spacing
109 protected:
110  FXTopWindow();
111  void settitle();
112  void seticons();
113  void setdecorations();
114  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);
115  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);
116 private:
117  FXTopWindow(const FXTopWindow&);
118  FXTopWindow& operator=(const FXTopWindow&);
119 #ifdef WIN32
120  virtual const void* GetClass() const;
121 #endif
122 public:
123  long onFocusUp(FXObject*,FXSelector,void*);
124  long onFocusDown(FXObject*,FXSelector,void*);
125  long onFocusLeft(FXObject*,FXSelector,void*);
126  long onFocusRight(FXObject*,FXSelector,void*);
127  long onSessionNotify(FXObject*,FXSelector,void*);
128  long onSessionClosed(FXObject*,FXSelector,void*);
129  long onRestore(FXObject*,FXSelector,void*);
130  long onMaximize(FXObject*,FXSelector,void*);
131  long onMinimize(FXObject*,FXSelector,void*);
132  long onCmdRestore(FXObject*,FXSelector,void*);
133  long onCmdMaximize(FXObject*,FXSelector,void*);
134  long onCmdMinimize(FXObject*,FXSelector,void*);
135  long onCmdFullScreen(FXObject*,FXSelector,void*);
136  long onCmdClose(FXObject*,FXSelector,void*);
137  long onCmdSetStringValue(FXObject*,FXSelector,void*);
138  long onCmdGetStringValue(FXObject*,FXSelector,void*);
139  long onCmdSetIconValue(FXObject*,FXSelector,void*);
140  long onCmdGetIconValue(FXObject*,FXSelector,void*);
141 public:
142  enum {
143  ID_RESTORE=FXShell::ID_LAST,
149  ID_LAST
150  };
151 public:
152 
154  virtual void create();
155 
157  virtual void detach();
158 
160  virtual void destroy();
161 
163  virtual void layout();
164 
166  virtual void setFocus();
167 
169  virtual void killFocus();
170 
172  virtual void show();
173 
175  virtual void hide();
176 
178  virtual void show(FXuint placement);
179 
181  void place(FXuint placement);
182 
184  virtual FXint getDefaultWidth();
185 
187  virtual FXint getDefaultHeight();
188 
190  FXbool getWMBorders(FXint& left,FXint& right,FXint& top,FXint& bottom);
191 
193  virtual void raise();
194 
196  virtual void lower();
197 
199  virtual void move(FXint x,FXint y);
200 
202  virtual void resize(FXint w,FXint h);
203 
205  virtual void position(FXint x,FXint y,FXint w,FXint h);
206 
208  virtual void flash(FXbool yes);
209 
211  virtual FXbool restore(FXbool notify=false);
212 
214  virtual FXbool maximize(FXbool notify=false);
215 
217  virtual FXbool minimize(FXbool notify=false);
218 
220  virtual FXbool fullScreen(FXbool notify=false);
221 
223  virtual FXbool stackingOrder(FXuint order);
224 
232  virtual FXbool close(FXbool notify=false);
233 
235  FXbool isMaximized() const;
236 
238  FXbool isMinimized() const;
239 
241  FXbool isFullScreen() const;
242 
244  void setTitle(const FXString& name);
245 
247  FXString getTitle() const { return title; }
248 
250  void setPadTop(FXint pt);
251 
253  FXint getPadTop() const { return padtop; }
254 
256  void setPadBottom(FXint pb);
257 
259  FXint getPadBottom() const { return padbottom; }
260 
262  void setPadLeft(FXint pl);
263 
265  FXint getPadLeft() const { return padleft; }
266 
268  void setPadRight(FXint pr);
269 
271  FXint getPadRight() const { return padright; }
272 
274  FXint getHSpacing() const { return hspacing; }
275 
277  FXint getVSpacing() const { return vspacing; }
278 
280  void setHSpacing(FXint hs);
281 
283  void setVSpacing(FXint vs);
284 
286  void setPackingHints(FXuint ph);
287 
289  FXuint getPackingHints() const;
290 
292  void setDecorations(FXuint decorations);
293 
295  FXuint getDecorations() const;
296 
298  FXIcon* getIcon() const { return icon; }
299 
301  void setIcon(FXIcon* ic);
302 
304  FXIcon* getMiniIcon() const { return miniIcon; }
305 
307  void setMiniIcon(FXIcon *ic);
308 
310  virtual void save(FXStream& store) const;
311 
313  virtual void load(FXStream& store);
314 
316  virtual ~FXTopWindow();
317  };
318 
319 }
320 
321 #endif
FXIcon * getIcon() const
Return window icon.
Definition: FXTopWindow.h:298
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
FXIcon * getMiniIcon() const
Return window mini (title) icon.
Definition: FXTopWindow.h:304
Close the window.
Definition: FXTopWindow.h:148
The Application object is the central point of a FOX user-interface.
Definition: FXApp.h:134
Minimize the window.
Definition: FXTopWindow.h:146
FXString getTitle() const
Return window title.
Definition: FXTopWindow.h:247
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Make the window full screen.
Definition: FXTopWindow.h:147
Maximize the window.
Definition: FXTopWindow.h:145
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
FXint getPadLeft() const
Get left interior padding.
Definition: FXTopWindow.h:265
The Shell widget is used as the base class for top level windows, i.e.
Definition: FXShell.h:35
Abstract base class for all top-level windows.
Definition: FXTopWindow.h:97
FXint getPadRight() const
Get right interior padding.
Definition: FXTopWindow.h:271
Restore the window.
Definition: FXTopWindow.h:144
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXint getHSpacing() const
Return horizontal spacing between children.
Definition: FXTopWindow.h:274
FXint getVSpacing() const
Return vertical spacing between children.
Definition: FXTopWindow.h:277
FXint getPadTop() const
Get top interior padding.
Definition: FXTopWindow.h:253
FXint getPadBottom() const
Get bottom interior padding.
Definition: FXTopWindow.h:259
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp