X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b487746ac401b3874d2fd9cf5aca35fea8203090..ea412ac4eb9f19e3c28dfa32aa9099a81ac7c74c:/src/osx/toplevel_osx.cpp diff --git a/src/osx/toplevel_osx.cpp b/src/osx/toplevel_osx.cpp index 5ad97e65c3..785a0e10c2 100644 --- a/src/osx/toplevel_osx.cpp +++ b/src/osx/toplevel_osx.cpp @@ -95,7 +95,7 @@ bool wxTopLevelWindowMac::Destroy() // NB: this will get called during destruction if we don't do it now, // and may fire a kill focus event on a control being destroyed #if wxOSX_USE_CARBON - if (m_nowpeer->GetWXWindow()) + if (m_nowpeer && m_nowpeer->GetWXWindow()) ClearKeyboardFocus( (WindowRef)m_nowpeer->GetWXWindow() ); #endif return wxTopLevelWindowBase::Destroy(); @@ -114,6 +114,9 @@ void wxTopLevelWindowMac::Maximize(bool maximize) bool wxTopLevelWindowMac::IsMaximized() const { + if ( m_nowpeer == NULL ) + return false; + return m_nowpeer->IsMaximized(); } @@ -125,6 +128,9 @@ void wxTopLevelWindowMac::Iconize(bool iconize) bool wxTopLevelWindowMac::IsIconized() const { + if ( m_nowpeer == NULL ) + return false; + return m_nowpeer->IsIconized(); } @@ -159,7 +165,9 @@ wxString wxTopLevelWindowMac::GetTitle() const void wxTopLevelWindowMac::ShowWithoutActivating() { - if ( !wxTopLevelWindowBase::Show(true) ) + // wxTopLevelWindowBase is derived from wxNonOwnedWindow, so don't + // call it here. + if ( !wxWindow::Show(true) ) return; m_nowpeer->ShowWithoutActivating(); @@ -186,3 +194,13 @@ bool wxTopLevelWindowMac::IsActive() { return m_nowpeer->IsActive(); } + +void wxTopLevelWindowMac::OSXSetModified(bool modified) +{ + m_nowpeer->SetModified(modified); +} + +bool wxTopLevelWindowMac::OSXIsModified() const +{ + return m_nowpeer->IsModified(); +}