/////////////////////////////////////////////////////////////////////////////
-// Name: mdi.cpp
+// Name: src/mac/classic/mdi.cpp
// Purpose: MDI classes
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "mdi.h"
-#endif
+#include "wx/wxprec.h"
#include "wx/mdi.h"
-#include "wx/menu.h"
-#include "wx/settings.h"
-#include "wx/log.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+ #include "wx/menu.h"
+ #include "wx/settings.h"
+#endif
#include "wx/mac/private.h"
#include "wx/mac/uma.h"
extern wxWindowList wxModelessWindows;
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
EVT_SCROLL(wxMDIClientWindow::OnScroll)
END_EVENT_TABLE()
-#endif
-
static const int IDM_WINDOWTILE = 4001;
static const int IDM_WINDOWTILEHOR = 4001;
static const int IDM_WINDOWCASCADE = 4002;
m_clientWindow = NULL;
m_currentChild = NULL;
m_windowMenu = (wxMenu*) NULL;
- m_parentFrameActive = TRUE;
+ m_parentFrameActive = true;
}
bool wxMDIParentFrame::Create(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxString& name)
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name)
{
m_clientWindow = NULL;
m_currentChild = NULL;
-
+
// this style can be used to prevent a window from having the standard MDI
// "Window" menu
if ( style & wxFRAME_NO_WINDOW_MENU )
else // normal case: we have the window menu, so construct it
{
m_windowMenu = new wxMenu;
-
+
m_windowMenu->Append(IDM_WINDOWCASCADE, wxT("&Cascade"));
m_windowMenu->Append(IDM_WINDOWTILEHOR, wxT("Tile &Horizontally"));
m_windowMenu->Append(IDM_WINDOWTILEVERT, wxT("Tile &Vertically"));
m_windowMenu->Append(IDM_WINDOWICONS, wxT("&Arrange Icons"));
m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next"));
}
-
+
wxFrame::Create( parent , id , title , pos , size , style , name ) ;
- m_parentFrameActive = TRUE;
-
+ m_parentFrameActive = true;
+
OnCreateClient();
-
- return TRUE;
+
+ return true;
}
wxMDIParentFrame::~wxMDIParentFrame()
#endif
#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
-#endif
+#endif
m_clientWindow = NULL ;
-
+
if (m_windowMenu)
{
delete m_windowMenu;
m_windowMenu = (wxMenu*) NULL;
}
-
+
if ( m_clientWindow )
{
delete m_clientWindow;
void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{
// TODO
-
+
// Propagate the event to the non-top-level children
wxFrame::OnSysColourChanged(event);
}
// TODO
}
-void wxMDIParentFrame::Tile()
+void wxMDIParentFrame::Tile(wxOrientation WXUNUSED(orient))
{
// TODO
}
const wxString& name)
{
SetName(name);
-
- if ( id > -1 )
+
+ if ( id != wxID_ANY )
m_windowId = id;
else
m_windowId = (int)NewControlId();
-
+
if (parent) parent->AddChild(this);
-
+
MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
-
+
m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ;
SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ;
-
+
wxModelessWindows.Append(this);
- return FALSE;
+ return false;
}
wxMDIChildFrame::~wxMDIChildFrame()
#endif
#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
-#endif
+#endif
}
void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar)
}
else if((mdiparent->m_currentChild==this) || !s_macDeactivateWindow)
mdiparent->wxFrame::MacActivate(timestamp,activating);
-
+
if(mdiparent->m_currentChild && mdiparent->m_currentChild!=this)
mdiparent->m_currentChild->wxFrame::MacActivate(timestamp,false);
mdiparent->m_currentChild = this;
bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
{
-
+
m_windowId = (int)NewControlId();
-
+
if ( parent )
{
parent->AddChild(this);
}
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
-
+
wxModelessWindows.Append(this);
- return TRUE;
+ return true;
}
// Get size *available for subwindows* i.e. excluding menu bar.
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
{
}
-