Commit 9214f584 authored by Marco Serantoni's avatar Marco Serantoni

MacOSX: Complete support for wxOverlay (http://trac.wxwidgets.org/ticket/12894)

parent 34e4ec5c
...@@ -22,20 +22,8 @@ void EDA_DRAW_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointe ...@@ -22,20 +22,8 @@ void EDA_DRAW_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointe
{ {
AdjustScrollBars( aCenterPoint ); AdjustScrollBars( aCenterPoint );
#if !defined(__WXMAC__)
/* DrawPanel->Refresh() is not used here because the redraw is delayed and the mouse
* events (from MoveCursorToCrossHair ot others) during this delay create problems: the
* mouse cursor position is false in calculations. TODO: see exactly how the mouse
* creates problems when moving during refresh use Refresh() and update() do not change
* problems
*/
INSTALL_DC( dc, DrawPanel );
DrawPanel->SetClipBox( dc );
DrawPanel->ReDraw( &dc, true );
#else
DrawPanel->Refresh(); DrawPanel->Refresh();
DrawPanel->Update(); DrawPanel->Update();
#endif
/* Move the mouse cursor to the on grid graphic cursor position */ /* Move the mouse cursor to the on grid graphic cursor position */
if( aWarpPointer ) if( aWarpPointer )
......
...@@ -221,8 +221,18 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -221,8 +221,18 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
#else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
#endif
} }
#ifdef USE_WX_OVERLAY
else
DrawPanel->m_overlay.Reset();
#endif
} }
if( aHotKey ) if( aHotKey )
...@@ -294,8 +304,18 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -294,8 +304,18 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
#else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
#endif
} }
#ifdef USE_WX_OVERLAY
else
DrawPanel->m_overlay.Reset();
#endif
} }
if( aHotKey ) if( aHotKey )
......
...@@ -688,6 +688,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo ...@@ -688,6 +688,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
if( showTrackClearanceMode != DO_NOT_SHOW_CLEARANCE ) if( showTrackClearanceMode != DO_NOT_SHOW_CLEARANCE )
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS; DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS;
#ifndef USE_WX_OVERLAY
/* Erase old track */ /* Erase old track */
if( aErase ) if( aErase )
{ {
...@@ -705,7 +706,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo ...@@ -705,7 +706,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
color ); color );
} }
} }
#endif
// MacOSX seems to need this. // MacOSX seems to need this.
if( g_CurrentTrackList.GetCount() == 0 ) if( g_CurrentTrackList.GetCount() == 0 )
return; return;
......
...@@ -387,8 +387,18 @@ void WinEDA_ModuleEditFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition ...@@ -387,8 +387,18 @@ void WinEDA_ModuleEditFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
#else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
#endif
} }
#ifdef USE_WX_OVERLAY
else
DrawPanel->m_overlay.Reset();
#endif
} }
if( aHotKey ) if( aHotKey )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment