+ const EventTypeSpec parentWindowEvents[] =
+ {
+ { kEventClassWindow, kEventWindowBoundsChanged },
+ { kEventClassWindow, kEventWindowBoundsChanging },
+ };
+
+ if ( overlayWindowEventHandlerUPP == NULL )
+ overlayWindowEventHandlerUPP = NewEventHandlerUPP( OverlayWindowEventHandlerProc );
+ if ( overlayParentWindowEventHandlerUPP == NULL )
+
+ overlayParentWindowEventHandlerUPP = NewEventHandlerUPP( OverlayParentWindowEventHandlerProc );
+
+ m_overlayParentWindow =(WindowRef) m_window->MacGetTopLevelWindowRef();
+
+ Rect bounds ;
+ MacGetBounds(&bounds);
+ err = CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, &m_overlayWindow );
+ if ( err == noErr )
+ {
+ SetWindowGroup( m_overlayWindow, GetWindowGroup(m_overlayParentWindow) ); // Put them in the same group so that their window layers are consistent
+ err = InstallWindowEventHandler( m_overlayWindow, overlayWindowEventHandlerUPP, GetEventTypeCount(windowEvents), windowEvents, this, &m_overlayHandler );
+ if ( err == noErr )
+ err = InstallWindowEventHandler( m_overlayParentWindow, overlayParentWindowEventHandlerUPP, GetEventTypeCount(parentWindowEvents), parentWindowEvents, this, &m_overlayParentHandler );
+ }
+ return err;
+}
+
+void wxOverlayImpl::Init( wxWindowDC* dc, int x , int y , int width , int height )
+{
+ wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
+
+ m_window = dc->GetWindow();
+ m_x = x ;
+ m_y = y ;
+ m_width = width ;
+ m_height = height ;
+
+ OSStatus err = CreateOverlayWindow();