#include "wx/settings.h"
#include "wx/math.h"
#include "wx/mac/private.h"
+#include "wx/log.h"
//-----------------------------------------------------------------------------
// constants
SetBackground(MacGetBackgroundBrush(window));
}
else
- m_graphicContext = NULL ;
+ {
+ // as out of order redraw is not supported under CQ, we have to create a qd port for these
+ // situations
+ wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
+ if (!rootwindow)
+ return;
+ WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
+ int x , y ;
+ x = y = 0 ;
+ window->MacWindowToRootWindow( &x , &y ) ;
+ m_macLocalOrigin.x = x ;
+ m_macLocalOrigin.y = y ;
+ CGrafPtr port = UMAGetWindowPort( windowref ) ;
+
+ m_graphicContext = new wxMacCGContext( port ) ;
+ m_graphicContext->SetPen( m_pen ) ;
+ m_graphicContext->SetBrush( m_brush ) ;
+ SetBackground(MacGetBackgroundBrush(window));
+ }
// there is no out-of-order drawing on OSX
#else
wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
}
else
{
- /*
+ // as out of order redraw is not supported under CQ, we have to create a qd port for these
+ // situations
wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
if (!rootwindow)
return;
WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
wxPoint origin = window->GetClientAreaOrigin() ;
- wxSize size = window->GetClientSize() ;
int x , y ;
x = origin.x ;
y = origin.y ;
m_graphicContext->SetPen( m_pen ) ;
m_graphicContext->SetBrush( m_brush ) ;
SetBackground(MacGetBackgroundBrush(window));
- m_ok = TRUE ;
- */
- }
+ }
m_ok = TRUE ;
#else
wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;