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