]>
Commit | Line | Data |
---|---|---|
8704bf74 JS |
1 | /* |
2 | Copyright (C) 1996 Scott W. Sadler | |
3 | All rights reserved. | |
4 | */ | |
5 | ||
6 | /* | |
7 | XsMDICanvas.h | |
8 | ||
9 | History | |
10 | 03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com) | |
11 | Created | |
12 | */ | |
13 | ||
14 | #ifndef XSMDICANVAS_H | |
15 | #define XSMDICANVAS_H | |
16 | ||
17 | // Includes | |
18 | ||
19 | #include "XsComponent.h" | |
20 | ||
21 | // Forward declarations | |
22 | ||
23 | class XsMDIWindow; | |
24 | ||
25 | // XsMDICanvas class | |
26 | ||
27 | class XsMDICanvas : public XsComponent { | |
28 | ||
29 | public: | |
30 | ||
31 | // Constructor/Destructor | |
32 | ||
33 | XsMDICanvas (const char *name, Widget parent); | |
34 | virtual ~XsMDICanvas ( ); | |
35 | ||
36 | // MDI Window manipulation | |
37 | ||
38 | virtual void add (XsMDIWindow *win); // Add an MDI window | |
39 | virtual void remove (XsMDIWindow *win); // Remove an MDI window | |
40 | void removeAll ( ); // Remove all MDI windows | |
41 | ||
42 | // Added JACS 19/10/98 | |
43 | inline Widget GetDrawingArea() const { return _drawArea; } | |
44 | ||
45 | // Utilities | |
46 | ||
47 | int numWindows ( ) const; // Number of MDI windows | |
48 | ||
49 | // Component methods | |
50 | ||
51 | virtual void show ( ); | |
52 | ||
53 | // Class name | |
54 | ||
55 | virtual const char *className ( ) const; | |
56 | ||
57 | protected: | |
58 | ||
59 | // Component life-cycle | |
60 | ||
61 | virtual void _componentDestroyed ( ); | |
62 | ||
63 | // Geometry management | |
64 | ||
65 | virtual void _placeWindow (XsMDIWindow *win); | |
66 | ||
67 | // Canvas resize handler | |
68 | ||
69 | virtual void _resize (XtPointer); | |
70 | ||
71 | // Implementation | |
72 | ||
73 | Widget _clipWin; | |
74 | Widget _drawArea; | |
75 | ||
76 | XsMDIWindow **_list; | |
77 | int _num; | |
78 | int _max; | |
79 | int _place; | |
80 | ||
81 | private: | |
82 | ||
83 | // Callbacks | |
84 | ||
85 | static void _clipResizeCallback (Widget, XtPointer, XtPointer); | |
86 | static void _canvasResizeCallback (Widget, XtPointer, XtPointer); | |
87 | ||
88 | // Resources | |
89 | ||
90 | static String _resources[]; | |
91 | }; | |
92 | ||
93 | // Inline member functions | |
94 | ||
95 | inline XsMDICanvas::numWindows ( ) const | |
96 | { | |
97 | return (_num); | |
98 | } | |
99 | ||
100 | #endif |