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

FXMDIClient.h
1 /********************************************************************************
2 * *
3 * M u l t i p l e D o c u m e n t C l i e n t W i n d o w *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2024 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 FXMDICLIENT_H
22 #define FXMDICLIENT_H
23 
24 #ifndef FXCOMPOSITE_H
25 #include "FXComposite.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXMDIChild;
32 
33 
53 class FXAPI FXMDIClient : public FXComposite {
54  FXDECLARE(FXMDIClient)
55  friend class FXMDIChild;
56 protected:
57  FXMDIChild *active; // Active child
58  FXImage *backImage; // Optional background image
59  FXint cascadex; // Cascade offset X
60  FXint cascadey; // Cascade offset Y
61 protected:
62  FXMDIClient();
63 private:
64  FXMDIClient(const FXMDIClient&);
65  FXMDIClient &operator=(const FXMDIClient&);
66 public:
67  long onPaint(FXObject*,FXSelector,void*);
68  long onCmdActivateNext(FXObject*,FXSelector,void*);
69  long onCmdActivatePrev(FXObject*,FXSelector,void*);
70  long onCmdTileHorizontal(FXObject*,FXSelector,void*);
71  long onCmdTileVertical(FXObject*,FXSelector,void*);
72  long onCmdCascade(FXObject*,FXSelector,void*);
73  long onUpdActivateNext(FXObject*,FXSelector,void*);
74  long onUpdActivatePrev(FXObject*,FXSelector,void*);
75  long onUpdTileVertical(FXObject*,FXSelector,void*);
76  long onUpdTileHorizontal(FXObject*,FXSelector,void*);
77  long onUpdCascade(FXObject*,FXSelector,void*);
78  long onUpdClose(FXObject*,FXSelector,void*);
79  long onUpdMenuClose(FXObject*,FXSelector,void*);
80  long onUpdRestore(FXObject*,FXSelector,void*);
81  long onUpdMenuRestore(FXObject*,FXSelector,void*);
82  long onUpdMinimize(FXObject*,FXSelector,void*);
83  long onUpdMenuMinimize(FXObject*,FXSelector,void*);
84  long onUpdMaximize(FXObject*,FXSelector,void*);
85  long onUpdMenuWindow(FXObject*,FXSelector,void*);
86  long onCmdWindowSelect(FXObject*,FXSelector,void*);
87  long onUpdWindowSelect(FXObject*,FXSelector,void*);
88  long onCmdOthersWindows(FXObject*,FXSelector,void*);
89  long onUpdOthersWindows(FXObject*,FXSelector,void*);
90  long onUpdAnyWindows(FXObject*,FXSelector,void*);
91  virtual long onDefault(FXObject*,FXSelector,void*);
92 public:
93  enum {
94  ID_MDI_ANY=65400,
95  ID_MDI_1, // Select MDI child 1
96  ID_MDI_2,
97  ID_MDI_3,
98  ID_MDI_4,
99  ID_MDI_5,
100  ID_MDI_6,
101  ID_MDI_7,
102  ID_MDI_8,
103  ID_MDI_9,
104  ID_MDI_10,
105  ID_MDI_OVER_1, // Sensitize MDI menu when 1 or more children
106  ID_MDI_OVER_2,
107  ID_MDI_OVER_3,
108  ID_MDI_OVER_4,
109  ID_MDI_OVER_5,
110  ID_MDI_OVER_6,
111  ID_MDI_OVER_7,
112  ID_MDI_OVER_8,
113  ID_MDI_OVER_9,
114  ID_MDI_OVER_10,
115  ID_LAST
116  };
117 public:
118 
120  FXMDIClient(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
121 
123  virtual void create();
124 
126  virtual FXint getDefaultWidth();
127 
129  virtual FXint getDefaultHeight();
130 
132  virtual void layout();
133 
138  long forallWindows(FXObject* sender,FXSelector sel,void* ptr);
139 
144  long forallDocuments(FXObject* sender,FXSelector sel,void* ptr);
145 
150  long forallDocWindows(FXObject* document,FXObject* sender,FXSelector sel,void* ptr);
151 
153  virtual FXbool setActiveChild(FXMDIChild* child=nullptr,FXbool notify=true);
154 
156  FXMDIChild* getActiveChild() const { return active; }
157 
159  FXObject* getActiveDocument() const;
160 
162  void setBackImage(FXImage* img);
163 
165  FXImage* getBackImage() const { return backImage; }
166 
168  virtual void cascade(FXbool notify=false);
169 
171  virtual void horizontal(FXbool notify=false);
172 
174  virtual void vertical(FXbool notify=false);
175 
177  void setCascadeX(FXint off){ cascadex=off; }
178 
180  void setCascadeY(FXint off){ cascadey=off; }
181 
183  FXint getCascadeX() const { return cascadex; }
184 
186  FXint getCascadeY() const { return cascadey; }
187 
189  virtual void save(FXStream& store) const;
190 
192  virtual void load(FXStream& store);
193 
195  virtual ~FXMDIClient();
196  };
197 
198 }
199 
200 #endif
FXint getCascadeY() const
Get cascade offset Y.
Definition: FXMDIClient.h:186
The MDI child window contains the application work area in a Multiple Document Interface application...
Definition: FXMDIChild.h:78
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Definition: FX4Splitter.h:28
FXImage * getBackImage() const
Return background image.
Definition: FXMDIClient.h:165
void setCascadeX(FXint off)
Change cascade offset X.
Definition: FXMDIClient.h:177
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
An Image is a rectangular array of pixels.
Definition: FXImage.h:67
The MDI client window manages a number of MDI child windows in a multiple-document interface (MDI) ap...
Definition: FXMDIClient.h:53
void setCascadeY(FXint off)
Change cascade offset Y.
Definition: FXMDIClient.h:180
FXint getCascadeX() const
Get cascade offset X.
Definition: FXMDIClient.h:183
FXMDIChild * getActiveChild() const
Get current active child; may be NULL!
Definition: FXMDIClient.h:156

Copyright © 1997-2022 Jeroen van der Zijp