X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..3f4a2351e4c677c88c18ea812b609477adee7380:/src/mac/classic/mdi.cpp?ds=sidebyside diff --git a/src/mac/classic/mdi.cpp b/src/mac/classic/mdi.cpp index aa29860098..5a7d9416a4 100644 --- a/src/mac/classic/mdi.cpp +++ b/src/mac/classic/mdi.cpp @@ -1,29 +1,29 @@ ///////////////////////////////////////////////////////////////////////////// -// 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: wxWidgets 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) @@ -37,8 +37,6 @@ BEGIN_EVENT_TABLE(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; @@ -61,20 +59,20 @@ wxMDIParentFrame::wxMDIParentFrame() 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 ) @@ -85,7 +83,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, 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")); @@ -93,13 +91,13 @@ bool wxMDIParentFrame::Create(wxWindow *parent, 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() @@ -111,15 +109,15 @@ 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; @@ -202,7 +200,7 @@ wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { // TODO - + // Propagate the event to the non-top-level children wxFrame::OnSysColourChanged(event); } @@ -213,7 +211,7 @@ void wxMDIParentFrame::Cascade() // TODO } -void wxMDIParentFrame::Tile() +void wxMDIParentFrame::Tile(wxOrientation WXUNUSED(orient)) { // TODO } @@ -252,21 +250,21 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, 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() @@ -282,7 +280,7 @@ wxMDIChildFrame::~wxMDIChildFrame() #endif #if wxUSE_STATUSBAR m_frameStatusBar = NULL; -#endif +#endif } void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) @@ -306,7 +304,7 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating) } 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; @@ -369,17 +367,17 @@ wxMDIClientWindow::~wxMDIClientWindow() 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. @@ -392,4 +390,3 @@ void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const void wxMDIClientWindow::OnScroll(wxScrollEvent& event) { } -