+ case kEventWindowBoundsChanging :
+ err = GetEventParameter( event, kEventParamAttributes, typeUInt32,
+ NULL, sizeof( UInt32 ), NULL, &attributes );
+ if ( err == noErr )
+ {
+ Rect newContentRect ;
+
+ GetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, NULL,
+ sizeof( newContentRect ), NULL, &newContentRect );
+
+ wxRect contentRect(newContentRect.left , newContentRect.top ,
+ newContentRect.right - newContentRect.left ,
+ newContentRect.bottom - newContentRect.top) ;
+
+ bool handled = false ;
+ if ((attributes & kWindowBoundsChangeSizeChanged) != 0)
+ {
+ wxSizeEvent event(contentRect , toplevelWindow->GetId());
+ event.SetEventObject(toplevelWindow);
+ handled = toplevelWindow->GetEventHandler()->ProcessEvent(event);
+ contentRect = event.GetRect() ;
+ }
+ else if ( attributes & kWindowBoundsChangeOriginChanged != 0)
+ {
+ wxMoveEvent event(contentRect , toplevelWindow->GetId());
+ event.SetEventObject(toplevelWindow);
+ handled = toplevelWindow->GetEventHandler()->ProcessEvent(event);
+ contentRect = event.GetRect() ;
+ }
+ if ( handled )
+ {
+ SetRect( &newContentRect , contentRect.GetLeft() , contentRect.GetTop() , contentRect.GetRight() , contentRect.GetBottom() ) ;
+ SetEventParameter( event, kEventParamCurrentBounds, typeQDRectangle, sizeof( newContentRect ), &newContentRect );
+ }
+ result = noErr ;
+ }
+ break ;