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
This commit is contained in:
Julian Smart 2005-06-16 18:03:43 +00:00
parent b61261dfed
commit 50779e0648
2 changed files with 15 additions and 0 deletions

View File

@ -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 );

View File

@ -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;
}