]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1215991 ] Mac xrc enables unknown class
authorJulian Smart <julian@anthemion.co.uk>
Thu, 16 Jun 2005 18:03:43 +0000 (18:03 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 16 Jun 2005 18:03:43 +0000 (18:03 +0000)
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
src/mac/carbon/window.cpp

index e8ed1c6e1bff70f348779450291252ac1a4d27a2..225604e44533c1f008fdfa4e8878b0c0e7a9e5ff 100644 (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 );
index bbd59ffe8c589f8b84f31888764e222e1cb737e3..64a8737ec2bf851bab1abb7a15b274bb5983af33 100644 (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;
+}