From 50779e0648e99a6dbe16b9adaa43f00a711007a8 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 16 Jun 2005 18:03:43 +0000 Subject: [PATCH] Applied patch [ 1215991 ] Mac xrc enables unknown class Implements Reparent for Mac git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/window.h | 1 + src/mac/carbon/window.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/wx/mac/carbon/window.h b/include/wx/mac/carbon/window.h index e8ed1c6e1b..225604e445 100644 --- a/include/wx/mac/carbon/window.h +++ b/include/wx/mac/carbon/window.h @@ -109,6 +109,7 @@ public: virtual int GetScrollRange( int orient ) const; virtual void ScrollWindow( int dx, int dy, const wxRect* rect = (wxRect *) NULL ); + virtual bool Reparent( wxWindowBase *newParent ); #if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ); diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index bbd59ffe8c..64a8737ec2 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -3241,4 +3241,18 @@ wxInt32 wxWindowMac::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENT return eventNotHandledErr ; } +bool wxWindowMac::Reparent(wxWindowBase *newParentBase) +{ + wxWindowMac *newParent = (wxWindowMac *)newParentBase; + + if ( !wxWindowBase::Reparent(newParent) ) + return FALSE; + + //copied from MacPostControlCreate + ControlRef container = (ControlRef) GetParent()->GetHandle() ; + wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ; + ::EmbedControl( m_peer->GetControlRef() , container ) ; + + return TRUE; +} -- 2.45.2