]> git.saurik.com Git - wxWidgets.git/blame - src/stubs/mdi.cpp
Final scrolling updates
[wxWidgets.git] / src / stubs / mdi.cpp
CommitLineData
93cf77c0
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: mdi.cpp
3// Purpose: MDI classes
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "mdi.h"
14#endif
15
16#include "wx/mdi.h"
34138703
JS
17#include "wx/menu.h"
18#include "wx/settings.h"
93cf77c0
JS
19
20extern wxList wxModelessWindows;
21
93cf77c0
JS
22IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
23IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
24IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
25
26BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
27 EVT_SIZE(wxMDIParentFrame::OnSize)
28 EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
29 EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
30END_EVENT_TABLE()
31
32BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow)
33 EVT_SCROLL(wxMDIClientWindow::OnScroll)
34END_EVENT_TABLE()
35
93cf77c0
JS
36
37// Parent frame
38
39wxMDIParentFrame::wxMDIParentFrame()
40{
41}
42
43bool wxMDIParentFrame::Create(wxWindow *parent,
44 wxWindowID id,
45 const wxString& title,
46 const wxPoint& pos,
47 const wxSize& size,
48 long style,
49 const wxString& name)
50{
51 if (!parent)
52 wxTopLevelWindows.Append(this);
53
54 SetName(name);
55 m_windowStyle = style;
56
57 if (parent) parent->AddChild(this);
58
59 if ( id > -1 )
60 m_windowId = id;
61 else
62 m_windowId = (int)NewControlId();
63
64 // TODO: create MDI parent frame
65
66 wxModelessWindows.Append(this);
67
68 return TRUE;
69}
70
71wxMDIParentFrame::~wxMDIParentFrame()
72{
73}
74
75// Get size *available for subwindows* i.e. excluding menu bar.
76void wxMDIParentFrame::GetClientSize(int *x, int *y) const
77{
78 // TODO
79}
80
81void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
82{
83 // TODO
84 if (!menu_bar)
85 {
86 m_frameMenuBar = NULL;
87 return;
88 }
89
90 if (menu_bar->m_menuBarFrame)
91 return;
92
93 m_frameMenuBar = menu_bar;
94}
95
96void wxMDIParentFrame::OnSize(wxSizeEvent& event)
97{
47d67540 98#if wxUSE_CONSTRAINTS
93cf77c0
JS
99 if (GetAutoLayout())
100 Layout();
101#endif
102 int x = 0;
103 int y = 0;
104 int width, height;
105 GetClientSize(&width, &height);
106
107 if ( GetClientWindow() )
108 GetClientWindow()->SetSize(x, y, width, height);
109}
110
111void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
112{
113 // Do nothing
114}
115
116// Returns the active MDI child window
117wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
118{
119 // TODO
120 return NULL;
121}
122
123// Create the client window class (don't Create the window,
124// just return a new class)
125wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
126{
127 return new wxMDIClientWindow ;
128}
129
130// Responds to colour changes, and passes event on to children.
131void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
132{
133 // TODO
134
135 // Propagate the event to the non-top-level children
136 wxFrame::OnSysColourChanged(event);
137}
138
139// MDI operations
140void wxMDIParentFrame::Cascade()
141{
142 // TODO
143}
144
145void wxMDIParentFrame::Tile()
146{
147 // TODO
148}
149
150void wxMDIParentFrame::ArrangeIcons()
151{
152 // TODO
153}
154
155void wxMDIParentFrame::ActivateNext()
156{
157 // TODO
158}
159
160void wxMDIParentFrame::ActivatePrevious()
161{
162 // TODO
163}
164
165// Child frame
166
167wxMDIChildFrame::wxMDIChildFrame()
168{
169}
170
171bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
172 wxWindowID id,
173 const wxString& title,
174 const wxPoint& pos,
175 const wxSize& size,
176 long style,
177 const wxString& name)
178{
179 SetName(name);
180
181 if ( id > -1 )
182 m_windowId = id;
183 else
184 m_windowId = (int)NewControlId();
185
186 if (parent) parent->AddChild(this);
187
188 // TODO: create child frame
189
190 wxModelessWindows.Append(this);
191 return FALSE;
192}
193
194wxMDIChildFrame::~wxMDIChildFrame()
195{
196}
197
198// Set the client size (i.e. leave the calculation of borders etc.
199// to wxWindows)
200void wxMDIChildFrame::SetClientSize(int width, int height)
201{
202 // TODO
203}
204
205void wxMDIChildFrame::GetPosition(int *x, int *y) const
206{
207 // TODO
208}
209
210void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar)
211{
212 // TODO
213 if (!menu_bar)
214 {
215 m_frameMenuBar = NULL;
216 return;
217 }
218
219 if (menu_bar->m_menuBarFrame)
220 return;
221 m_frameMenuBar = menu_bar;
222}
223
224// MDI operations
225void wxMDIChildFrame::Maximize()
226{
227 // TODO
228}
229
230void wxMDIChildFrame::Restore()
231{
232 // TODO
233}
234
235void wxMDIChildFrame::Activate()
236{
237 // TODO
238}
239
240// Client window
241
242wxMDIClientWindow::wxMDIClientWindow()
243{
244}
245
246wxMDIClientWindow::~wxMDIClientWindow()
247{
248}
249
250bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
251{
252 // TODO create client window
253 m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE);
254
255 return FALSE;
256}
257
258// Explicitly call default scroll behaviour
259void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
260{
261 Default(); // Default processing
262}
263