// Purpose: implementation of wxNonOwnedWindow
// Author: Stefan Csomor
// Created: 2008-03-24
-// RCS-ID: $Id: nonownedwnd.cpp 50329 2007-11-29 17:00:58Z VS $
+// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor 2008
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxNonOwnedWindow* wxNonOwnedWindow::GetFromWXWindow( WXWindow win )
{
wxNonOwnedWindowImpl* impl = wxNonOwnedWindowImpl::FindFromWXWindow(win);
-
+
return ( impl != NULL ? impl->GetWXPeer() : NULL ) ;
}
wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::FindFromWXWindow (WXWindow window)
{
MacWindowMap::iterator node = wxWinMacWindowList.find(window);
-
+
return (node == wxWinMacWindowList.end()) ? NULL : node->second;
}
// adding NULL WindowRef is (first) surely a result of an error and
// nothing else :-)
wxCHECK_RET( window != (WXWindow) NULL, wxT("attempt to add a NULL WindowRef to window list") );
-
+
wxWinMacWindowList[window] = impl;
}
{
if ( parent )
parent->AddChild(this);
-
+
SubclassWin(nativeWindow);
-
+
return true;
}
if ( GetParent() )
GetParent()->RemoveChild(this);
-
- wxNonOwnedWindowImpl::RemoveAssociations(m_nowpeer) ;
- m_isNativeWindowWrapper = false;
+
+ wxNonOwnedWindowImpl::RemoveAssociations(m_nowpeer) ;
wxDELETE(m_nowpeer);
wxDELETE(m_peer);
+ m_isNativeWindowWrapper = false;
}
bool wxNonOwnedWindow::Destroy()
{
WillBeDestroyed();
-
+
return wxWindow::Destroy();
}
{
if (flags == GetWindowStyleFlag())
return;
-
+
wxWindow::SetWindowStyleFlag(flags);
-
+
if (m_nowpeer)
m_nowpeer->SetWindowStyleFlag(flags);
}
int left, top, w, h;
m_nowpeer->GetContentArea(left, top, w, h);
-
+
if (width)
*width = w ;
if (height)
wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
m_shape = region;
-
+
// The empty region signifies that the shape
// should be removed from the window.
if ( region.IsEmpty() )