+///////////////////////////////////////////////////////////////////////////////
+// Name: mac/toplevel.cpp
+// Purpose: implements wxTopLevelWindow for MSW
+// Author: Vadim Zeitlin
+// Modified by:
+// Created: 24.09.01
+// RCS-ID: $Id$
+// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
+// License: wxWindows license
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#ifdef __GNUG__
+ #pragma implementation "toplevel.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/toplevel.h"
+ #include "wx/string.h"
+ #include "wx/log.h"
+ #include "wx/intl.h"
+#endif //WX_PRECOMP
+
+// ----------------------------------------------------------------------------
+// globals
+// ----------------------------------------------------------------------------
+
+// list of all frames and modeless dialogs
+wxWindowList wxModelessWindows;
+
+// ============================================================================
+// wxTopLevelWindowMac implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxTopLevelWindowMac creation
+// ----------------------------------------------------------------------------
+
+void wxTopLevelWindowMac::Init()
+{
+ m_iconized =
+ m_maximizeOnShow = FALSE;
+}
+
+bool wxTopLevelWindowMac::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name)
+{
+ // init our fields
+ Init();
+
+ m_windowStyle = style;
+
+ SetName(name);
+
+ m_windowId = id == -1 ? NewControlId() : id;
+
+ wxTopLevelWindows.Append(this);
+
+ if ( parent )
+ parent->AddChild(this);
+
+ return TRUE;
+}
+
+wxTopLevelWindowMac::~wxTopLevelWindowMac()
+{
+ wxTopLevelWindows.DeleteObject(this);
+
+ if ( wxModelessWindows.Find(this) )
+ wxModelessWindows.DeleteObject(this);
+
+ // If this is the last top-level window, exit.
+ if ( wxTheApp && (wxTopLevelWindows.Number() == 0) )
+ {
+ wxTheApp->SetTopWindow(NULL);
+
+ if ( wxTheApp->GetExitOnFrameDelete() )
+ {
+ wxTheApp->ExitMainLoop() ;
+ }
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+// wxTopLevelWindowMac maximize/minimize
+// ----------------------------------------------------------------------------
+
+void wxTopLevelWindowMac::Maximize(bool maximize)
+{
+ // not available on mac
+}
+
+bool wxTopLevelWindowMac::IsMaximized() const
+{
+ return false ;
+}
+
+void wxTopLevelWindowMac::Iconize(bool iconize)
+{
+ // not available on mac
+}
+
+bool wxTopLevelWindowMac::IsIconized() const
+{
+ // mac dialogs cannot be iconized
+ return FALSE;
+}
+
+void wxTopLevelWindowMac::Restore()
+{
+ // not available on mac
+}
+
+// ----------------------------------------------------------------------------
+// wxTopLevelWindowMac misc
+// ----------------------------------------------------------------------------
+
+void wxTopLevelWindowMac::SetIcon(const wxIcon& icon)
+{
+ // this sets m_icon
+ wxTopLevelWindowBase::SetIcon(icon);
+}