toplevel fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-09-30 17:34:51 +00:00
parent 752b40b1da
commit a15eb0a5c8
8 changed files with 365 additions and 219 deletions

143
src/mac/carbon/toplevel.cpp Normal file
View File

@@ -0,0 +1,143 @@
///////////////////////////////////////////////////////////////////////////////
// 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);
}