X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..ec5006bdc630dd6b3d4cad1a3b572ab4c695a029:/src/mac/classic/mdi.cpp diff --git a/src/mac/classic/mdi.cpp b/src/mac/classic/mdi.cpp index dae283d79f..5a7d9416a4 100644 --- a/src/mac/classic/mdi.cpp +++ b/src/mac/classic/mdi.cpp @@ -1,18 +1,23 @@ ///////////////////////////////////////////////////////////////////////////// -// 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 ///////////////////////////////////////////////////////////////////////////// +#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" @@ -54,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 ) @@ -78,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")); @@ -86,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() @@ -104,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; @@ -195,7 +200,7 @@ wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { // TODO - + // Propagate the event to the non-top-level children wxFrame::OnSysColourChanged(event); } @@ -245,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() @@ -275,7 +280,7 @@ wxMDIChildFrame::~wxMDIChildFrame() #endif #if wxUSE_STATUSBAR m_frameStatusBar = NULL; -#endif +#endif } void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) @@ -299,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; @@ -362,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. @@ -385,4 +390,3 @@ void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const void wxMDIClientWindow::OnScroll(wxScrollEvent& event) { } -