1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: mac/toplevel.cpp
3 // Purpose: implements wxTopLevelWindow for MSW
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // License: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "toplevel.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
33 #include "wx/toplevel.h"
34 #include "wx/string.h"
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 // list of all frames and modeless dialogs
44 wxWindowList wxModelessWindows
;
46 // ============================================================================
47 // wxTopLevelWindowMac implementation
48 // ============================================================================
50 // ----------------------------------------------------------------------------
51 // wxTopLevelWindowMac creation
52 // ----------------------------------------------------------------------------
54 void wxTopLevelWindowMac::Init()
57 m_maximizeOnShow
= FALSE
;
60 bool wxTopLevelWindowMac::Create(wxWindow
*parent
,
62 const wxString
& title
,
71 m_windowStyle
= style
;
75 m_windowId
= id
== -1 ? NewControlId() : id
;
77 wxTopLevelWindows
.Append(this);
80 parent
->AddChild(this);
85 wxTopLevelWindowMac::~wxTopLevelWindowMac()
87 wxTopLevelWindows
.DeleteObject(this);
89 if ( wxModelessWindows
.Find(this) )
90 wxModelessWindows
.DeleteObject(this);
92 // If this is the last top-level window, exit.
93 if ( wxTheApp
&& (wxTopLevelWindows
.Number() == 0) )
95 wxTheApp
->SetTopWindow(NULL
);
97 if ( wxTheApp
->GetExitOnFrameDelete() )
99 wxTheApp
->ExitMainLoop() ;
105 // ----------------------------------------------------------------------------
106 // wxTopLevelWindowMac maximize/minimize
107 // ----------------------------------------------------------------------------
109 void wxTopLevelWindowMac::Maximize(bool maximize
)
111 // not available on mac
114 bool wxTopLevelWindowMac::IsMaximized() const
119 void wxTopLevelWindowMac::Iconize(bool iconize
)
121 // not available on mac
124 bool wxTopLevelWindowMac::IsIconized() const
126 // mac dialogs cannot be iconized
130 void wxTopLevelWindowMac::Restore()
132 // not available on mac
135 // ----------------------------------------------------------------------------
136 // wxTopLevelWindowMac misc
137 // ----------------------------------------------------------------------------
139 void wxTopLevelWindowMac::SetIcon(const wxIcon
& icon
)
142 wxTopLevelWindowBase::SetIcon(icon
);