+ int former_x = m_x ;
+ int former_y = m_y ;
+ int former_w = m_width ;
+ int former_h = m_height ;
+
+ int actualWidth = width;
+ int actualHeight = height;
+ int actualX = x;
+ int actualY = y;
+
+ if ((m_minWidth != -1) && (actualWidth < m_minWidth))
+ actualWidth = m_minWidth;
+ if ((m_minHeight != -1) && (actualHeight < m_minHeight))
+ actualHeight = m_minHeight;
+ if ((m_maxWidth != -1) && (actualWidth > m_maxWidth))
+ actualWidth = m_maxWidth;
+ if ((m_maxHeight != -1) && (actualHeight > m_maxHeight))
+ actualHeight = m_maxHeight;
+
+ bool doMove = false ;
+ bool doResize = false ;
+
+ if ( actualX != former_x || actualY != former_y )
+ {
+ doMove = true ;
+ }
+ if ( actualWidth != former_w || actualHeight != former_h )
+ {
+ doResize = true ;
+ }
+
+ if ( doMove || doResize )
+ {
+ if ( m_macWindowData )
+ {
+ }
+ else
+ {
+ // erase former position
+ wxMacDrawingHelper focus( this ) ;
+ if ( focus.Ok() )
+ {
+ Rect clientrect = { 0 , 0 , m_height , m_width } ;
+ // ClipRect( &clientrect ) ;
+ InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
+ }
+ }
+ m_x = actualX ;
+ m_y = actualY ;
+ m_width = actualWidth ;
+ m_height = actualHeight ;
+ if ( m_macWindowData )
+ {
+ if ( doMove )
+ ::MoveWindow(m_macWindowData->m_macWindow, m_x, m_y , false); // don't make frontmost
+
+ if ( doResize )
+ ::SizeWindow(m_macWindowData->m_macWindow, m_width, m_height , true);
+
+ // the OS takes care of invalidating and erasing the new area
+ // we have erased the old one
+
+ if ( IsKindOf( CLASSINFO( wxFrame ) ) )
+ {
+ wxFrame* frame = (wxFrame*) this ;
+ frame->PositionStatusBar();
+ frame->PositionToolBar();
+ }
+ if ( doMove )
+ wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified
+ }
+ else
+ {
+ // erase new position
+
+ {
+ wxMacDrawingHelper focus( this ) ;
+ if ( focus.Ok() )
+ {
+ Rect clientrect = { 0 , 0 , m_height , m_width } ;
+ // ClipRect( &clientrect ) ;
+ InvalWindowRect( GetMacRootWindow() , &clientrect ) ;
+ }
+ }
+
+ if ( doMove )
+ wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified
+ }
+ MacRepositionScrollBars() ;
+ if ( doMove )
+ {
+ wxPoint point(m_x, m_y);
+ wxMoveEvent event(point, m_windowId);
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event) ;
+ }
+ if ( doResize )
+ {
+ MacRepositionScrollBars() ;
+ wxSize size(m_width, m_height);
+ wxSizeEvent event(size, m_windowId);
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+ }
+ }
+