]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/mdi.h
DrawCircle() added
[wxWidgets.git] / include / wx / msw / mdi.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: mdi.h
3// Purpose: MDI (Multiple Document Interface) classes
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc 8// Copyright: (c) Julian Smart
a23fd0e1 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_MDI_H_
13#define _WX_MDI_H_
2bda0e17
KB
14
15#ifdef __GNUG__
a23fd0e1 16 #pragma interface "mdi.h"
2bda0e17
KB
17#endif
18
19#include "wx/frame.h"
20
39ca6d79
OK
21WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
22WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
2bda0e17
KB
23
24class WXDLLEXPORT wxMDIClientWindow;
25class WXDLLEXPORT wxMDIChildFrame;
26
a23fd0e1
VZ
27// ---------------------------------------------------------------------------
28// wxMDIParentFrame
29// ---------------------------------------------------------------------------
30
31class WXDLLEXPORT wxMDIParentFrame : public wxFrame
2bda0e17 32{
a23fd0e1
VZ
33 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
34
35public:
36 wxMDIParentFrame();
37 wxMDIParentFrame(wxWindow *parent,
38 wxWindowID id,
39 const wxString& title,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
43 const wxString& name = wxFrameNameStr)
44 {
45 Create(parent, id, title, pos, size, style, name);
46 }
47
48 ~wxMDIParentFrame();
49
50 bool Create(wxWindow *parent,
51 wxWindowID id,
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);
57
58 // accessors
59 // ---------
60
61 void SetMenuBar(wxMenuBar *menu_bar);
62
63 // Get the active MDI child window (Windows only)
64 wxMDIChildFrame *GetActiveChild() const ;
2bda0e17 65
a23fd0e1
VZ
66 // Get the client window
67 wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; }
2bda0e17 68
a23fd0e1
VZ
69 // Create the client window class (don't Create the window,
70 // just return a new class)
71 virtual wxMDIClientWindow *OnCreateClient(void) ;
2bda0e17 72
a23fd0e1 73 WXHMENU GetWindowMenu() const { return m_windowMenu; }
2bda0e17 74
a23fd0e1
VZ
75 // MDI operations
76 // --------------
77 virtual void Cascade();
78 virtual void Tile();
79 virtual void ArrangeIcons();
80 virtual void ActivateNext();
81 virtual void ActivatePrevious();
2bda0e17 82
a23fd0e1
VZ
83 // handlers
84 // --------
2bda0e17 85
a23fd0e1
VZ
86 // Responds to colour changes
87 void OnSysColourChanged(wxSysColourChangedEvent& event);
2bda0e17 88
a23fd0e1
VZ
89 void OnSize(wxSizeEvent& event);
90 void OnActivate(wxActivateEvent& event);
2bda0e17 91
a23fd0e1
VZ
92 virtual bool MSWOnActivate(int state, bool minimized, WXHWND activate);
93 virtual bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
2bda0e17 94
a23fd0e1
VZ
95 // override window proc for MDI-specific message processing
96 virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
2bda0e17 97
a23fd0e1
VZ
98 virtual long MSWDefWindowProc(WXUINT, WXWPARAM, WXLPARAM);
99 virtual bool MSWProcessMessage(WXMSG* msg);
100 virtual bool MSWTranslateMessage(WXMSG* msg);
cc2b7472 101
a23fd0e1 102protected:
2bda0e17
KB
103 wxMDIClientWindow * m_clientWindow;
104 wxMDIChildFrame * m_currentChild;
105 WXHMENU m_windowMenu;
a23fd0e1
VZ
106
107 // TRUE if MDI Frame is intercepting commands, not child
108 bool m_parentFrameActive;
109
110private:
111 friend class WXDLLEXPORT wxMDIChildFrame;
112
113 DECLARE_EVENT_TABLE()
2bda0e17
KB
114};
115
a23fd0e1
VZ
116// ---------------------------------------------------------------------------
117// wxMDIChildFrame
118// ---------------------------------------------------------------------------
2bda0e17 119
a23fd0e1 120class WXDLLEXPORT wxMDIChildFrame : public wxFrame
2bda0e17 121{
a23fd0e1
VZ
122 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
123
124public:
125 wxMDIChildFrame();
126 wxMDIChildFrame(wxMDIParentFrame *parent,
127 wxWindowID id,
128 const wxString& title,
129 const wxPoint& pos = wxDefaultPosition,
130 const wxSize& size = wxDefaultSize,
131 long style = wxDEFAULT_FRAME_STYLE,
132 const wxString& name = wxFrameNameStr)
133 {
134 Create(parent, id, title, pos, size, style, name);
135 }
136
137 ~wxMDIChildFrame();
138
139 bool Create(wxMDIParentFrame *parent,
140 wxWindowID id,
141 const wxString& title,
142 const wxPoint& pos = wxDefaultPosition,
143 const wxSize& size = wxDefaultSize,
144 long style = wxDEFAULT_FRAME_STYLE,
145 const wxString& name = wxFrameNameStr);
146
147 // Set menu bar
148 void SetMenuBar(wxMenuBar *menu_bar);
149
150 // MDI operations
151 virtual void Maximize();
152 virtual void Restore();
153 virtual void Activate();
154
155 // Handlers
156
157 bool MSWOnMDIActivate(long bActivate, WXHWND, WXHWND);
158 bool MSWOnSize(int x, int y, WXUINT);
159 bool MSWOnWindowPosChanging(void *lpPos);
debe6624 160 bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
2bda0e17
KB
161 long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
162 bool MSWProcessMessage(WXMSG *msg);
57a7b7c1 163 bool MSWTranslateMessage(WXMSG *msg);
a23fd0e1 164 void MSWDestroyWindow();
2bda0e17
KB
165
166 // Implementation
167 bool ResetWindowStyle(void *vrect);
cc2b7472
VZ
168
169protected:
a23fd0e1
VZ
170 virtual void DoGetPosition(int *x, int *y) const ;
171 virtual void DoSetClientSize(int width, int height);
2bda0e17
KB
172};
173
a23fd0e1
VZ
174// ---------------------------------------------------------------------------
175// wxMDIClientWindow
176// ---------------------------------------------------------------------------
2bda0e17 177
a23fd0e1
VZ
178class WXDLLEXPORT wxMDIClientWindow : public wxWindow
179{
180 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
2bda0e17 181
a23fd0e1
VZ
182public:
183 wxMDIClientWindow();
184 wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
185 {
186 CreateClient(parent, style);
187 }
2bda0e17 188
a23fd0e1 189 ~wxMDIClientWindow();
2bda0e17 190
a23fd0e1
VZ
191 // Note: this is virtual, to allow overridden behaviour.
192 virtual bool CreateClient(wxMDIParentFrame *parent,
193 long style = wxVSCROLL | wxHSCROLL);
2bda0e17 194
a23fd0e1
VZ
195 // Explicitly call default scroll behaviour
196 void OnScroll(wxScrollEvent& event);
2bda0e17 197
a23fd0e1
VZ
198 // Window procedure
199 virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
2bda0e17 200
a23fd0e1
VZ
201 // Calls an appropriate default window procedure
202 virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
2bda0e17
KB
203
204protected:
a23fd0e1
VZ
205 int m_scrollX, m_scrollY;
206
207private:
208 DECLARE_EVENT_TABLE()
2bda0e17
KB
209};
210
211#endif
bbcdf8bc 212 // _WX_MDI_H_