Implements Reparent for Mac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34680
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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 );
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;
+}