1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: MDI (Multiple Document Interface) classes.
4 // This doesn't have to be implemented just like Windows,
5 // it could be a tabbed design as in wxGTK.
10 // Copyright: (c) AUTHOR
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
18 #pragma interface "mdi.h"
23 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
24 WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr
;
26 class WXDLLEXPORT wxMDIClientWindow
;
27 class WXDLLEXPORT wxMDIChildFrame
;
29 class WXDLLEXPORT wxMDIParentFrame
: public wxFrame
31 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
33 friend class WXDLLEXPORT wxMDIChildFrame
;
37 inline wxMDIParentFrame(wxWindow
*parent
,
39 const wxString
& title
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
42 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
, // Scrolling refers to client window
43 const wxString
& name
= wxFrameNameStr
)
45 Create(parent
, id
, title
, pos
, size
, style
, name
);
50 bool Create(wxWindow
*parent
,
52 const wxString
& title
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
55 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
56 const wxString
& name
= wxFrameNameStr
);
58 void OnSize(wxSizeEvent
& event
);
59 void OnActivate(wxActivateEvent
& event
);
61 void SetMenuBar(wxMenuBar
*menu_bar
);
63 // Gets the size available for subwindows after menu size, toolbar size
64 // and status bar size have been subtracted. If you want to manage your own
65 // toolbar(s), don't call SetToolBar.
66 void GetClientSize(int *width
, int *height
) const;
68 // Get the active MDI child window (Windows only)
69 wxMDIChildFrame
*GetActiveChild() const ;
71 // Get the client window
72 inline wxMDIClientWindow
*GetClientWindow() const { return m_clientWindow
; };
74 // Create the client window class (don't Create the window,
75 // just return a new class)
76 virtual wxMDIClientWindow
*OnCreateClient() ;
79 virtual void Cascade();
81 virtual void ArrangeIcons();
82 virtual void ActivateNext();
83 virtual void ActivatePrevious();
90 class WXDLLEXPORT wxMDIChildFrame
: public wxFrame
92 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
96 inline wxMDIChildFrame(wxMDIParentFrame
*parent
,
98 const wxString
& title
,
99 const wxPoint
& pos
= wxDefaultPosition
,
100 const wxSize
& size
= wxDefaultSize
,
101 long style
= wxDEFAULT_FRAME_STYLE
,
102 const wxString
& name
= wxFrameNameStr
)
104 Create(parent
, id
, title
, pos
, size
, style
, name
);
109 bool Create(wxMDIParentFrame
*parent
,
111 const wxString
& title
,
112 const wxPoint
& pos
= wxDefaultPosition
,
113 const wxSize
& size
= wxDefaultSize
,
114 long style
= wxDEFAULT_FRAME_STYLE
,
115 const wxString
& name
= wxFrameNameStr
);
118 void SetMenuBar(wxMenuBar
*menu_bar
);
119 void SetClientSize(int width
, int height
);
120 void GetPosition(int *x
, int *y
) const ;
123 virtual void Maximize();
124 virtual void Restore();
125 virtual void Activate();
128 /* The client window is a child of the parent MDI frame, and itself
129 * contains the child MDI frames.
130 * However, you create the MDI children as children of the MDI parent:
131 * only in the implementation does the client window become the parent
132 * of the children. Phew! So the children are sort of 'adopted'...
135 class WXDLLEXPORT wxMDIClientWindow
: public wxWindow
137 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
140 wxMDIClientWindow() ;
141 inline wxMDIClientWindow(wxMDIParentFrame
*parent
, long style
= 0)
143 CreateClient(parent
, style
);
146 ~wxMDIClientWindow();
148 // Note: this is virtual, to allow overridden behaviour.
149 virtual bool CreateClient(wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
151 // Explicitly call default scroll behaviour
152 void OnScroll(wxScrollEvent
& event
);
156 DECLARE_EVENT_TABLE()