Commit c2e5fcae authored by Wayne Stambaugh's avatar Wayne Stambaugh

More encapsulation improvements.

* EDA_DRAW_FRAME completely encapsulated.
* Encapsulate the the low hanging fruit in EDA_DRAW_PANEL.
parent 2df818b8
...@@ -228,11 +228,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo ...@@ -228,11 +228,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
case BLOCK_MIRROR_X: case BLOCK_MIRROR_X:
case BLOCK_MIRROR_Y: /* mirror */ case BLOCK_MIRROR_Y: /* mirror */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
Block->InitData( DrawPanel, startpos ); Block->InitData( m_canvas, startpos );
break; break;
case BLOCK_PASTE: case BLOCK_PASTE:
Block->InitData( DrawPanel, startpos ); Block->InitData( m_canvas, startpos );
Block->m_BlockLastCursorPosition.x = 0; Block->m_BlockLastCursorPosition.x = 0;
Block->m_BlockLastCursorPosition.y = 0; Block->m_BlockLastCursorPosition.y = 0;
InitBlockPasteInfos(); InitBlockPasteInfos();
...@@ -241,11 +241,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo ...@@ -241,11 +241,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
{ {
DisplayError( this, wxT( "No Block to paste" ), 20 ); DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
return true; return true;
} }
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
Block->m_ItemsSelection.ClearItemsList(); Block->m_ItemsSelection.ClearItemsList();
DisplayError( this, DisplayError( this,
...@@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo ...@@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
} }
Block->m_State = STATE_BLOCK_MOVE; Block->m_State = STATE_BLOCK_MOVE;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, startpos, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false );
break; break;
default: default:
......
...@@ -25,9 +25,9 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event ) ...@@ -25,9 +25,9 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD ) if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
{ {
if( GetScreen()->IsBlockActive() ) if( GetScreen()->IsBlockActive() )
DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) ); m_canvas->SetCursor( wxCursor( m_canvas->GetDefaultCursor() ) );
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
} }
} }
...@@ -48,7 +48,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -48,7 +48,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
int ClipboardSizeX, ClipboardSizeY; int ClipboardSizeX, ClipboardSizeY;
bool DrawBlock = false; bool DrawBlock = false;
wxRect DrawArea; wxRect DrawArea;
BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen(); BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
/* scale is the ratio resolution/internal units */ /* scale is the ratio resolution/internal units */
float scale = 82.0 / aFrame->GetInternalUnits(); float scale = 82.0 / aFrame->GetInternalUnits();
...@@ -73,7 +73,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -73,7 +73,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
wxMetafileDC dc; wxMetafileDC dc;
EDA_RECT tmp = aFrame->DrawPanel->m_ClipBox; EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox;
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
const bool plotBlackAndWhite = false; const bool plotBlackAndWhite = false;
GRForceBlackPen( plotBlackAndWhite ); GRForceBlackPen( plotBlackAndWhite );
...@@ -81,10 +81,10 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -81,10 +81,10 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
dc.SetUserScale( scale, scale ); dc.SetUserScale( scale, scale );
ClipboardSizeX = dc.MaxX() + 10; ClipboardSizeX = dc.MaxX() + 10;
ClipboardSizeY = dc.MaxY() + 10; ClipboardSizeY = dc.MaxY() + 10;
aFrame->DrawPanel->m_ClipBox.SetX( 0 ); aFrame->GetCanvas()->m_ClipBox.SetX( 0 );
aFrame->DrawPanel->m_ClipBox.SetY( 0 ); aFrame->GetCanvas()->m_ClipBox.SetY( 0 );
aFrame->DrawPanel->m_ClipBox.SetWidth( 0x7FFFFF0 ); aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 );
aFrame->DrawPanel->m_ClipBox.SetHeight( 0x7FFFFF0 ); aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 );
if( DrawBlock ) if( DrawBlock )
{ {
...@@ -94,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -94,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
const int maskLayer = 0xFFFFFFFF; const int maskLayer = 0xFFFFFFFF;
aFrame->PrintPage( &dc, maskLayer, false ); aFrame->PrintPage( &dc, maskLayer, false );
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
aFrame->DrawPanel->m_ClipBox = tmp; aFrame->GetCanvas()->m_ClipBox = tmp;
wxMetafile* mf = dc.Close(); wxMetafile* mf = dc.Close();
if( mf ) if( mf )
......
...@@ -37,8 +37,8 @@ void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event ) ...@@ -37,8 +37,8 @@ void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
DIALOG_PAGES_SETTINGS frame( this ); DIALOG_PAGES_SETTINGS frame( this );
int diag = frame.ShowModal(); int diag = frame.ShowModal();
if( DrawPanel && diag ) if( m_canvas && diag )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event ) ...@@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
#endif #endif
m_Screen->SetModify(); m_Screen->SetModify();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }
......
...@@ -94,7 +94,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti ...@@ -94,7 +94,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_zoomSelectBox = NULL; m_zoomSelectBox = NULL;
m_HotkeysZoomAndGridList = NULL; m_HotkeysZoomAndGridList = NULL;
DrawPanel = NULL; m_canvas = NULL;
m_messagePanel = NULL; m_messagePanel = NULL;
m_currentScreen = NULL; m_currentScreen = NULL;
m_toolId = ID_NO_TOOL_SELECTED; m_toolId = ID_NO_TOOL_SELECTED;
...@@ -142,7 +142,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti ...@@ -142,7 +142,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_FramePos.x = m_FramePos.y = 0; m_FramePos.x = m_FramePos.y = 0;
m_FrameSize.y -= m_MsgFrameHeight; m_FrameSize.y -= m_MsgFrameHeight;
DrawPanel = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize ); m_canvas = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ), m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ),
wxSize( m_FrameSize.x, m_MsgFrameHeight ) ); wxSize( m_FrameSize.x, m_MsgFrameHeight ) );
...@@ -182,8 +182,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event ) ...@@ -182,8 +182,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
{ {
m_FrameIsActive = event.GetActive(); m_FrameIsActive = event.GetActive();
if( DrawPanel ) if( m_canvas )
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
event.Skip(); // required under wxMAC event.Skip(); // required under wxMAC
} }
...@@ -191,8 +191,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event ) ...@@ -191,8 +191,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event ) void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
{ {
if( DrawPanel ) if( m_canvas )
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
event.Skip(); event.Skip();
} }
...@@ -201,7 +201,7 @@ void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event ) ...@@ -201,7 +201,7 @@ void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent ) void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
{ {
SetGridVisibility( !IsGridVisible() ); SetGridVisibility( !IsGridVisible() );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -222,10 +222,10 @@ void EDA_DRAW_FRAME::OnSelectUnits( wxCommandEvent& aEvent ) ...@@ -222,10 +222,10 @@ void EDA_DRAW_FRAME::OnSelectUnits( wxCommandEvent& aEvent )
void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent ) void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent )
{ {
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
m_cursorShape = !m_cursorShape; m_cursorShape = !m_cursorShape;
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
...@@ -445,9 +445,9 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg ) ...@@ -445,9 +445,9 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
// Keep default cursor in toolbars // Keep default cursor in toolbars
SetCursor( wxNullCursor ); SetCursor( wxNullCursor );
// Change DrawPanel cursor if requested. // Change m_canvas cursor if requested.
if( DrawPanel && aCursor >= 0 ) if( m_canvas && aCursor >= 0 )
DrawPanel->SetCurrentCursor( aCursor ); m_canvas->SetCurrentCursor( aCursor );
DisplayToolMsg( aToolMsg ); DisplayToolMsg( aToolMsg );
...@@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key ) ...@@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
void EDA_DRAW_FRAME::InitBlockPasteInfos() void EDA_DRAW_FRAME::InitBlockPasteInfos()
{ {
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
} }
...@@ -508,7 +508,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition ) ...@@ -508,7 +508,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
BASE_SCREEN* screen = GetScreen(); BASE_SCREEN* screen = GetScreen();
bool noRefresh = true; bool noRefresh = true;
if( screen == NULL || DrawPanel == NULL ) if( screen == NULL || m_canvas == NULL )
return; return;
double scalar = screen->GetScalingFactor(); double scalar = screen->GetScalingFactor();
...@@ -518,7 +518,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition ) ...@@ -518,7 +518,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
// Calculate the portion of the drawing that can be displayed in the // Calculate the portion of the drawing that can be displayed in the
// client area at the current zoom level. // client area at the current zoom level.
clientSize = DrawPanel->GetClientSize(); clientSize = m_canvas->GetClientSize();
// The logical size of the client window. // The logical size of the client window.
logicalClientSize.x = wxRound( (double) clientSize.x / scalar ); logicalClientSize.x = wxRound( (double) clientSize.x / scalar );
...@@ -694,7 +694,7 @@ SetScrollbars(%d, %d, %d, %d, %d, %d)" ), ...@@ -694,7 +694,7 @@ SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y ); screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
DrawPanel->SetScrollbars( screen->m_ScrollPixelsPerUnitX, m_canvas->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
screen->m_ScrollPixelsPerUnitY, screen->m_ScrollPixelsPerUnitY,
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.x,
screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.y,
......
...@@ -204,7 +204,7 @@ static int overbar_position( int size_v, int thickness ) ...@@ -204,7 +204,7 @@ static int overbar_position( int size_v, int thickness )
/** /**
* Function DrawGraphicText * Function DrawGraphicText
* Draw a graphic text (like module texts) * Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas * @param aPanel = the current m_canvas. NULL if draw within a 3D GL Canvas
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas * @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
* @param aPos = text position (according to h_justify, v_justify) * @param aPos = text position (according to h_justify, v_justify)
* @param aColor (enum EDA_Colors) = text color * @param aColor (enum EDA_Colors) = text color
......
...@@ -100,13 +100,13 @@ void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC ) ...@@ -100,13 +100,13 @@ void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
m_Flags = 0; m_Flags = 0;
screen->SetModify(); screen->SetModify();
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
aFrame->DrawPanel->SetMouseCapture( NULL, NULL ); aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
aFrame->DrawPanel->EndMouseCapture(); aFrame->GetCanvas()->EndMouseCapture();
if( aDC ) if( aDC )
{ {
EDA_CROSS_HAIR_MANAGER( aFrame->DrawPanel, aDC ); // Erase schematic cursor EDA_CROSS_HAIR_MANAGER( aFrame->GetCanvas(), aDC ); // Erase schematic cursor
Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
} }
} }
......
This diff is collapsed.
...@@ -22,10 +22,10 @@ void EDA_DRAW_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointe ...@@ -22,10 +22,10 @@ void EDA_DRAW_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointe
// 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 )
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->Refresh(); m_canvas->Refresh();
DrawPanel->Update(); m_canvas->Update();
} }
...@@ -55,7 +55,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect ) ...@@ -55,7 +55,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect )
/* Compute the best zoom */ /* Compute the best zoom */
Rect.Normalize(); Rect.Normalize();
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
// Use ceil to at least show the full rect // Use ceil to at least show the full rect
scalex = (double) Rect.GetSize().x / size.x; scalex = (double) Rect.GetSize().x / size.x;
...@@ -73,7 +73,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect ) ...@@ -73,7 +73,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect )
*/ */
void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event ) void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
{ {
if( DrawPanel == NULL ) if( m_canvas == NULL )
return; return;
int i; int i;
...@@ -105,7 +105,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event ) ...@@ -105,7 +105,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
break; break;
case ID_ZOOM_REDRAW: case ID_ZOOM_REDRAW:
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_POPUP_ZOOM_CENTER: case ID_POPUP_ZOOM_CENTER:
...@@ -121,7 +121,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event ) ...@@ -121,7 +121,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
break; break;
case ID_POPUP_CANCEL: case ID_POPUP_CANCEL:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
default: default:
...@@ -149,7 +149,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -149,7 +149,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
int maxZoomIds; int maxZoomIds;
int zoom; int zoom;
wxString msg; wxString msg;
BASE_SCREEN * screen = DrawPanel->GetScreen(); BASE_SCREEN * screen = m_canvas->GetScreen();
msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER ); msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) ); AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
......
...@@ -128,7 +128,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -128,7 +128,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr.AddPane( m_drawToolBar, m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() ); wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
m_auimgr.AddPane( m_messagePanel, m_auimgr.AddPane( m_messagePanel,
...@@ -313,7 +313,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -313,7 +313,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
if( m_DisplayModText > 2 ) if( m_DisplayModText > 2 )
m_DisplayModText = 0; m_DisplayModText = 0;
DrawPanel->Refresh( ); m_canvas->Refresh( );
break; break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH: case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
...@@ -322,7 +322,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -322,7 +322,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
if( m_DisplayModEdge > 2 ) if( m_DisplayModEdge > 2 )
m_DisplayModEdge = 0; m_DisplayModEdge = 0;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:
...@@ -381,25 +381,25 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi ...@@ -381,25 +381,25 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
case WXK_NUMPAD8: /* cursor moved up */ case WXK_NUMPAD8: /* cursor moved up */
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: /* cursor moved down */ case WXK_NUMPAD2: /* cursor moved down */
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: /* cursor moved left */ case WXK_NUMPAD4: /* cursor moved left */
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: /* cursor moved right */ case WXK_NUMPAD6: /* cursor moved right */
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
} }
...@@ -409,13 +409,13 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi ...@@ -409,13 +409,13 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, 0 ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, 0 );
} }
} }
......
...@@ -68,7 +68,7 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void ) ...@@ -68,7 +68,7 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void )
m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection(); m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue(); m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue(); m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }
......
...@@ -83,7 +83,8 @@ void CVPCB_MAINFRAME::CreateScreenCmp() ...@@ -83,7 +83,8 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod ); m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
m_DisplayFootprintFrame->Zoom_Automatique( false ); m_DisplayFootprintFrame->Zoom_Automatique( false );
m_DisplayFootprintFrame->DrawPanel->Refresh(); m_DisplayFootprintFrame->GetCanvas()->Refresh();
// Display new cursor coordinates and zoom value: // Display new cursor coordinates and zoom value:
m_DisplayFootprintFrame->UpdateStatusBar(); m_DisplayFootprintFrame->UpdateStatusBar();
...@@ -115,15 +116,15 @@ void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -115,15 +116,15 @@ void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( !GetBoard() ) if( !GetBoard() )
return; return;
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
GetBoard()->Draw( DrawPanel, DC, GR_COPY ); GetBoard()->Draw( m_canvas, DC, GR_COPY );
MODULE* Module = GetBoard()->m_Modules; MODULE* Module = GetBoard()->m_Modules;
if ( Module ) if ( Module )
Module->DisplayInfo( this ); Module->DisplayInfo( this );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
} }
......
...@@ -148,7 +148,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic, ...@@ -148,7 +148,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
m_CurrentSheet->UpdateAllScreenReferences(); m_CurrentSheet->UpdateAllScreenReferences();
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
......
This diff is collapsed.
...@@ -92,13 +92,13 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -92,13 +92,13 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
BlockState state = GetScreen()->m_BlockLocate.m_State; BlockState state = GetScreen()->m_BlockLocate.m_State;
CmdBlockType command = GetScreen()->m_BlockLocate.m_Command; CmdBlockType command = GetScreen()->m_BlockLocate.m_Command;
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC ); m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
GetScreen()->m_BlockLocate.m_State = state; GetScreen()->m_BlockLocate.m_State = state;
GetScreen()->m_BlockLocate.m_Command = command; GetScreen()->m_BlockLocate.m_Command = command;
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(), GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(),
GetScreen()->m_BlockLocate.GetBottom() ) ); GetScreen()->m_BlockLocate.GetBottom() ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
} }
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
...@@ -118,21 +118,21 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -118,21 +118,21 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
nextCmd = true; nextCmd = true;
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
nextCmd = true; nextCmd = true;
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
break; break;
...@@ -205,9 +205,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -205,9 +205,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
return nextCmd; return nextCmd;
...@@ -218,7 +218,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -218,7 +218,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
wxPoint pt; wxPoint pt;
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) ); DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
} }
...@@ -244,7 +244,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -244,7 +244,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
if ( m_component ) if ( m_component )
m_component->MoveSelectedItems( pt ); m_component->MoveSelectedItems( pt );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
...@@ -302,8 +302,8 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -302,8 +302,8 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
......
...@@ -129,7 +129,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -129,7 +129,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
{ {
s_ConnexionStartPoint = cursorpos; s_ConnexionStartPoint = cursorpos;
s_OldWiresList = GetScreen()->ExtractWires( true ); s_OldWiresList = GetScreen()->ExtractWires( true );
GetScreen()->SchematicCleanUp( DrawPanel ); GetScreen()->SchematicCleanUp( m_canvas );
switch( type ) switch( type )
{ {
...@@ -160,7 +160,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -160,7 +160,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
} }
GetScreen()->SetCurItem( newsegment ); GetScreen()->SetCurItem( newsegment );
DrawPanel->SetMouseCapture( DrawSegment, AbortCreateNewLine ); m_canvas->SetMouseCapture( DrawSegment, AbortCreateNewLine );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
} }
else // A segment is in progress: terminates the current segment and add a new segment. else // A segment is in progress: terminates the current segment and add a new segment.
...@@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
return; return;
} }
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
/* Creates the new segment, or terminates the command /* Creates the new segment, or terminates the command
* if the end point is on a pin, junction or an other wire or bus */ * if the end point is on a pin, junction or an other wire or bus */
...@@ -193,9 +193,9 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -193,9 +193,9 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
oldsegment->SetNext( GetScreen()->GetDrawItems() ); oldsegment->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( oldsegment ); GetScreen()->SetDrawItems( oldsegment );
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor m_canvas->CrossHairOff( DC ); // Erase schematic cursor
oldsegment->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); oldsegment->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( DC ); // Display schematic cursor m_canvas->CrossHairOn( DC ); // Display schematic cursor
/* Create a new segment, and chain it after the current new segment */ /* Create a new segment, and chain it after the current new segment */
if( nextsegment ) if( nextsegment )
...@@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
oldsegment->SetFlags( SELECTED ); oldsegment->SetFlags( SELECTED );
newsegment->SetFlags( IS_NEW ); newsegment->SetFlags( IS_NEW );
GetScreen()->SetCurItem( newsegment ); GetScreen()->SetCurItem( newsegment );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
/* This is the first segment: Now we know the start segment position. /* This is the first segment: Now we know the start segment position.
* Create a junction if needed. Note: a junction can be needed later, * Create a junction if needed. Note: a junction can be needed later,
...@@ -282,7 +282,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC ) ...@@ -282,7 +282,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
GetScreen()->SetDrawItems( lastsegment ); GetScreen()->SetDrawItems( lastsegment );
} }
DrawPanel->EndMouseCapture( -1, -1, wxEmptyString, false ); m_canvas->EndMouseCapture( -1, -1, wxEmptyString, false );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
wxPoint end_point, alt_end_point; wxPoint end_point, alt_end_point;
...@@ -298,7 +298,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC ) ...@@ -298,7 +298,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
alt_end_point = lastsegment->GetStartPoint(); alt_end_point = lastsegment->GetStartPoint();
} }
GetScreen()->SchematicCleanUp( DrawPanel ); GetScreen()->SchematicCleanUp( m_canvas );
/* clear flags and find last segment entered, for repeat function */ /* clear flags and find last segment entered, for repeat function */
segment = (SCH_LINE*) GetScreen()->GetDrawItems(); segment = (SCH_LINE*) GetScreen()->GetDrawItems();
...@@ -329,10 +329,10 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC ) ...@@ -329,10 +329,10 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
if( GetScreen()->IsJunctionNeeded( s_ConnexionStartPoint ) ) if( GetScreen()->IsJunctionNeeded( s_ConnexionStartPoint ) )
AddJunction( DC, s_ConnexionStartPoint ); AddJunction( DC, s_ConnexionStartPoint );
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
/* Redraw wires and junctions which can be changed by TestDanglingEnds() */ /* Redraw wires and junctions which can be changed by TestDanglingEnds() */
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor m_canvas->CrossHairOff( DC ); // Erase schematic cursor
EDA_ITEM* item = GetScreen()->GetDrawItems(); EDA_ITEM* item = GetScreen()->GetDrawItems();
while( item ) while( item )
...@@ -341,7 +341,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC ) ...@@ -341,7 +341,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
{ {
case SCH_JUNCTION_T: case SCH_JUNCTION_T:
case SCH_LINE_T: case SCH_LINE_T:
DrawPanel->RefreshDrawingRect( item->GetBoundingBox() ); m_canvas->RefreshDrawingRect( item->GetBoundingBox() );
break; break;
default: default:
...@@ -351,7 +351,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC ) ...@@ -351,7 +351,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
item = item->Next(); item = item->Next();
} }
DrawPanel->CrossHairOn( DC ); // Display schematic cursor m_canvas->CrossHairOn( DC ); // Display schematic cursor
SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE ); SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE );
s_OldWiresList = NULL; s_OldWiresList = NULL;
...@@ -436,15 +436,15 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC ) ...@@ -436,15 +436,15 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
} }
polyLine->SetPoint( idx, endpos ); polyLine->SetPoint( idx, endpos );
polyLine->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); polyLine->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
} }
else else
{ {
DrawSegment( DrawPanel, DC, wxDefaultPosition, false ); DrawSegment( m_canvas, DC, wxDefaultPosition, false );
} }
screen->RemoveFromDrawList( screen->GetCurItem() ); screen->RemoveFromDrawList( screen->GetCurItem() );
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
} }
...@@ -456,9 +456,9 @@ SCH_JUNCTION* SCH_EDIT_FRAME::AddJunction( wxDC* aDC, const wxPoint& aPosition, ...@@ -456,9 +456,9 @@ SCH_JUNCTION* SCH_EDIT_FRAME::AddJunction( wxDC* aDC, const wxPoint& aPosition,
m_itemToRepeat = junction; m_itemToRepeat = junction;
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
junction->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); junction->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor m_canvas->CrossHairOn( aDC ); // Display schematic cursor
junction->SetNext( GetScreen()->GetDrawItems() ); junction->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( junction ); GetScreen()->SetDrawItems( junction );
...@@ -478,9 +478,9 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( wxDC* aDC, const wxPoint& aPositio ...@@ -478,9 +478,9 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( wxDC* aDC, const wxPoint& aPositio
NewNoConnect = new SCH_NO_CONNECT( aPosition ); NewNoConnect = new SCH_NO_CONNECT( aPosition );
m_itemToRepeat = NewNoConnect; m_itemToRepeat = NewNoConnect;
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
NewNoConnect->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); NewNoConnect->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor m_canvas->CrossHairOn( aDC ); // Display schematic cursor
NewNoConnect->SetNext( GetScreen()->GetDrawItems() ); NewNoConnect->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( NewNoConnect ); GetScreen()->SetDrawItems( NewNoConnect );
...@@ -528,7 +528,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC ) ...@@ -528,7 +528,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
m_itemToRepeat->SetFlags( IS_NEW ); m_itemToRepeat->SetFlags( IS_NEW );
( (SCH_COMPONENT*) m_itemToRepeat )->SetTimeStamp( GetNewTimeStamp() ); ( (SCH_COMPONENT*) m_itemToRepeat )->SetTimeStamp( GetNewTimeStamp() );
m_itemToRepeat->Move( pos ); m_itemToRepeat->Move( pos );
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
MoveItem( m_itemToRepeat, DC ); MoveItem( m_itemToRepeat, DC );
return; return;
} }
...@@ -543,7 +543,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC ) ...@@ -543,7 +543,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
m_itemToRepeat->SetNext( GetScreen()->GetDrawItems() ); m_itemToRepeat->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( m_itemToRepeat ); GetScreen()->SetDrawItems( m_itemToRepeat );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
SaveCopyInUndoList( m_itemToRepeat, UR_NEW ); SaveCopyInUndoList( m_itemToRepeat, UR_NEW );
m_itemToRepeat->ClearFlags(); m_itemToRepeat->ClearFlags();
} }
......
...@@ -74,10 +74,10 @@ void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int en ...@@ -74,10 +74,10 @@ void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int en
s_LastShape = entry_shape == '/' ? '/' : '\\'; s_LastShape = entry_shape == '/' ? '/' : '\\';
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
BusEntry->SetBusEntryShape( s_LastShape ); BusEntry->SetBusEntryShape( s_LastShape );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
OnModify( ); OnModify( );
} }
...@@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC ...@@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
// If the user aborted the clarification context menu, don't show it again at the // If the user aborted the clarification context menu, don't show it again at the
// off grid position. // off grid position.
if( !item && DrawPanel->m_AbortRequest ) if( !item && m_canvas->m_AbortRequest )
{ {
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
return NULL; return NULL;
} }
...@@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC ...@@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
if( !item ) if( !item )
{ {
DrawPanel->m_AbortRequest = false; // Just in case the user aborted the context menu. m_canvas->m_AbortRequest = false; // Just in case the user aborted the context menu.
return NULL; return NULL;
} }
...@@ -171,9 +171,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF ...@@ -171,9 +171,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
// Set to NULL in case user aborts the clarification context menu. // Set to NULL in case user aborts the clarification context menu.
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->m_AbortRequest = true; // Changed to false if an item is selected m_canvas->m_AbortRequest = true; // Changed to false if an item is selected
PopupMenu( &selectMenu ); PopupMenu( &selectMenu );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
item = GetScreen()->GetCurItem(); item = GetScreen()->GetCurItem();
} }
} }
...@@ -208,25 +208,25 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -208,25 +208,25 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
...@@ -240,23 +240,23 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -240,23 +240,23 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
#else #else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
DrawPanel->m_overlay.Reset(); m_canvas->m_overlay.Reset();
#endif #endif
} }
...@@ -291,25 +291,25 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -291,25 +291,25 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
...@@ -323,23 +323,23 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -323,23 +323,23 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
#else #else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
DrawPanel->m_overlay.Reset(); m_canvas->m_overlay.Reset();
#endif #endif
} }
...@@ -371,25 +371,25 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -371,25 +371,25 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
...@@ -403,13 +403,13 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -403,13 +403,13 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
} }
} }
......
...@@ -118,6 +118,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) ...@@ -118,6 +118,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
message = _( "Clear and annotate all of the components " ); message = _( "Clear and annotate all of the components " );
else else
message = _( "Annotate only the unannotated components " ); message = _( "Annotate only the unannotated components " );
if( GetLevel() ) if( GetLevel() )
message += _( "on the entire schematic?" ); message += _( "on the entire schematic?" );
else else
...@@ -125,13 +126,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) ...@@ -125,13 +126,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
message += _( "\n\nThis operation will change the current annotation and cannot be undone." ); message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(), m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
(ANNOTATE_OPTION_T) GetAnnotateAlgo(), (ANNOTATE_OPTION_T) GetAnnotateAlgo(),
GetResetItems() , true ); GetResetItems() , true );
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
m_btnClear->Enable(); m_btnClear->Enable();
} }
...@@ -150,12 +152,13 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event ) ...@@ -150,12 +152,13 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
message += _( "the current sheet?" ); message += _( "the current sheet?" );
message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." ); message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
m_Parent->DeleteAnnotation( GetLevel() ? false : true ); m_Parent->DeleteAnnotation( GetLevel() ? false : true );
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
m_btnClear->Enable(false); m_btnClear->Enable(false);
} }
......
...@@ -212,7 +212,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, ...@@ -212,7 +212,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units
screen->SetScalingFactor( 1.0 ); screen->SetScalingFactor( 1.0 );
EDA_DRAW_PANEL* panel = frame->DrawPanel; EDA_DRAW_PANEL* panel = frame->GetCanvas();
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like 1.3) // to print floating point numbers like 1.3)
......
...@@ -289,14 +289,17 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings() ...@@ -289,14 +289,17 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
bool warning = false; bool warning = false;
for( int ii = 0; ii < MAX_LAYERS; ii++ ) for( int ii = 0; ii < MAX_LAYERS; ii++ )
{ {
g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ]; g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ];
if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] ) if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] )
warning = true; warning = true;
} }
m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] ); m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] );
if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] ) if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] )
warning = true; warning = true;
...@@ -311,11 +314,9 @@ void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event ) ...@@ -311,11 +314,9 @@ void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event )
// Prompt the user if an item has the same color as the background // Prompt the user if an item has the same color as the background
// because this item cannot be seen: // because this item cannot be seen:
if( warning ) if( warning )
wxMessageBox( wxMessageBox( _("Warning:\nSome items have the same color as the background\nand they will not be seen on screen") );
_("Warning:\nSome items have the same color as the background\nand they will not be seen on screen")
);
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
EndModal( 1 ); EndModal( 1 );
} }
...@@ -330,7 +331,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event ) ...@@ -330,7 +331,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event )
void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event ) void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event )
{ {
UpdateColorsSettings(); UpdateColorsSettings();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }
......
...@@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) ...@@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T, wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T,
wxT( "Invalid component object pointer. Bad Programmer!" ) ); wxT( "Invalid component object pointer. Bad Programmer!" ) );
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this );
...@@ -54,8 +54,8 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) ...@@ -54,8 +54,8 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
// so it comes up wide enough next time. // so it comes up wide enough next time.
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize(); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
dlg->Destroy(); dlg->Destroy();
} }
...@@ -283,7 +283,7 @@ Do you wish to remove this and all remaining undefined fields?" ), ...@@ -283,7 +283,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
m_Parent->OnModify(); m_Parent->OnModify();
m_Parent->GetScreen()->TestDanglingEnds(); m_Parent->GetScreen()->TestDanglingEnds();
m_Parent->DrawPanel->Refresh( true ); m_Parent->GetCanvas()->Refresh( true );
EndModal( 0 ); EndModal( 0 );
} }
...@@ -834,8 +834,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) ...@@ -834,8 +834,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
if( m_Cmp->m_Flags == 0 ) if( m_Cmp->m_Flags == 0 )
m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED ); m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED );
INSTALL_UNBUFFERED_DC( dc, m_Parent->DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() );
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode );
// Initialize field values to default values found in library: // Initialize field values to default values found in library:
LIB_FIELD& refField = entry->GetReferenceField(); LIB_FIELD& refField = entry->GetReferenceField();
...@@ -850,6 +850,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) ...@@ -850,6 +850,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
m_Parent->OnModify(); m_Parent->OnModify();
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
EndModal( 1 ); EndModal( 1 );
} }
...@@ -214,7 +214,7 @@ void DialogLabelEditor::OnOkClick( wxCommandEvent& aEvent ) ...@@ -214,7 +214,7 @@ void DialogLabelEditor::OnOkClick( wxCommandEvent& aEvent )
void DialogLabelEditor::OnCancelClick( wxCommandEvent& aEvent ) void DialogLabelEditor::OnCancelClick( wxCommandEvent& aEvent )
{ {
m_Parent->DrawPanel->MoveCursorToCrossHair(); m_Parent->GetCanvas()->MoveCursorToCrossHair();
EndModal( wxID_CANCEL ); EndModal( wxID_CANCEL );
} }
...@@ -228,7 +228,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent ) ...@@ -228,7 +228,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
if( m_CurrentText->GetFlags() == 0 ) if( m_CurrentText->GetFlags() == 0 )
m_Parent->SaveCopyInUndoList( m_CurrentText, UR_CHANGED ); m_Parent->SaveCopyInUndoList( m_CurrentText, UR_CHANGED );
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() ); m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
text = m_textLabel->GetValue(); text = m_textLabel->GetValue();
...@@ -269,7 +269,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent ) ...@@ -269,7 +269,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
if( m_CurrentText->IsNew() ) if( m_CurrentText->IsNew() )
g_DefaultTextLabelSize = m_CurrentText->m_Size.x; g_DefaultTextLabelSize = m_CurrentText->m_Size.x;
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() ); m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
m_Parent->DrawPanel->MoveCursorToCrossHair(); m_Parent->GetCanvas()->MoveCursorToCrossHair();
EndModal( wxID_OK ); EndModal( wxID_OK );
} }
...@@ -109,7 +109,7 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event ) ...@@ -109,7 +109,7 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
if( m_component == NULL ) if( m_component == NULL )
return; return;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_component ); DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_component );
......
...@@ -113,7 +113,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event ) ...@@ -113,7 +113,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
ScreenList.DeleteAllMarkers( MARK_ERC ); ScreenList.DeleteAllMarkers( MARK_ERC );
m_MarkersList->ClearList(); m_MarkersList->ClearList();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }
...@@ -563,7 +563,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) ...@@ -563,7 +563,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
DisplayERC_MarkersList(); DisplayERC_MarkersList();
// Display new markers: // Display new markers:
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
if( m_writeErcFile ) if( m_writeErcFile )
{ {
......
...@@ -316,7 +316,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) ...@@ -316,7 +316,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
wxRect fitRect; wxRect fitRect;
wxDC* dc = GetDC(); wxDC* dc = GetDC();
SCH_EDIT_FRAME* parent = m_Parent->GetParent(); SCH_EDIT_FRAME* parent = m_Parent->GetParent();
EDA_DRAW_PANEL* panel = parent->DrawPanel; EDA_DRAW_PANEL* panel = parent->GetCanvas();
wxBusyCursor dummy; wxBusyCursor dummy;
......
...@@ -133,9 +133,9 @@ SCH_BITMAP* SCH_EDIT_FRAME::CreateNewImage( wxDC* aDC ) ...@@ -133,9 +133,9 @@ SCH_BITMAP* SCH_EDIT_FRAME::CreateNewImage( wxDC* aDC )
image->SetFlags( IS_NEW | IS_MOVED ); image->SetFlags( IS_NEW | IS_MOVED );
image->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); image->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->SetMouseCapture( moveBitmap, abortMoveBitmap ); m_canvas->SetMouseCapture( moveBitmap, abortMoveBitmap );
GetScreen()->SetCurItem( image ); GetScreen()->SetCurItem( image );
OnModify(); OnModify();
...@@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::MoveImage( SCH_BITMAP* aImageItem, wxDC* aDC ) ...@@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::MoveImage( SCH_BITMAP* aImageItem, wxDC* aDC )
{ {
aImageItem->SetFlags( IS_MOVED ); aImageItem->SetFlags( IS_MOVED );
DrawPanel->SetMouseCapture( moveBitmap, abortMoveBitmap ); m_canvas->SetMouseCapture( moveBitmap, abortMoveBitmap );
GetScreen()->SetCurItem( aImageItem ); GetScreen()->SetCurItem( aImageItem );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
SetUndoItem( aImageItem ); SetUndoItem( aImageItem );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aImageItem->GetPosition() ); GetScreen()->SetCrossHairPosition( aImageItem->GetPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
OnModify(); OnModify();
} }
...@@ -167,7 +167,7 @@ void SCH_EDIT_FRAME::RotateImage( SCH_BITMAP* aItem ) ...@@ -167,7 +167,7 @@ void SCH_EDIT_FRAME::RotateImage( SCH_BITMAP* aItem )
aItem->Rotate( aItem->GetPosition() ); aItem->Rotate( aItem->GetPosition() );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis ) void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis )
...@@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis ) ...@@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis )
aItem->Mirror_Y( aItem->GetPosition().x ); aItem->Mirror_Y( aItem->GetPosition().x );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem ) void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
...@@ -196,5 +196,5 @@ void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem ) ...@@ -196,5 +196,5 @@ void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
dlg.TransfertToImage(aItem->m_Image); dlg.TransfertToImage(aItem->m_Image);
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -74,7 +74,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -74,7 +74,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
// Don't use GetText() here. If the field is the reference designator and it's parent // Don't use GetText() here. If the field is the reference designator and it's parent
// component has multiple parts, we don't want the part suffix added to the field. // component has multiple parts, we don't want the part suffix added to the field.
wxString newtext = aField->m_Text; wxString newtext = aField->m_Text;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxString title; wxString title;
title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) ); title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
...@@ -82,8 +82,8 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -82,8 +82,8 @@ create a new power component with the new value." ), GetChars( entry->GetName()
wxTextEntryDialog dlg( this, wxEmptyString , title, newtext ); wxTextEntryDialog dlg( this, wxEmptyString , title, newtext );
int response = dlg.ShowModal(); int response = dlg.ShowModal();
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
newtext = dlg.GetValue( ); newtext = dlg.GetValue( );
newtext.Trim( true ); newtext.Trim( true );
newtext.Trim( false ); newtext.Trim( false );
...@@ -91,7 +91,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -91,7 +91,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
if ( response != wxID_OK || newtext == aField->GetText() ) if ( response != wxID_OK || newtext == aField->GetText() )
return; // canceled by user return; // canceled by user
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
if( !newtext.IsEmpty() ) if( !newtext.IsEmpty() )
{ {
...@@ -135,7 +135,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -135,7 +135,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
} }
} }
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
component->DisplayInfo( this ); component->DisplayInfo( this );
OnModify(); OnModify();
} }
...@@ -152,14 +152,14 @@ void SCH_EDIT_FRAME::RotateField( SCH_FIELD* aField, wxDC* aDC ) ...@@ -152,14 +152,14 @@ void SCH_EDIT_FRAME::RotateField( SCH_FIELD* aField, wxDC* aDC )
if( aField->GetFlags() == 0 ) if( aField->GetFlags() == 0 )
SaveCopyInUndoList( component, UR_CHANGED ); SaveCopyInUndoList( component, UR_CHANGED );
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
if( aField->m_Orient == TEXT_ORIENT_HORIZ ) if( aField->m_Orient == TEXT_ORIENT_HORIZ )
aField->m_Orient = TEXT_ORIENT_VERT; aField->m_Orient = TEXT_ORIENT_VERT;
else else
aField->m_Orient = TEXT_ORIENT_HORIZ; aField->m_Orient = TEXT_ORIENT_HORIZ;
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
OnModify(); OnModify();
} }
...@@ -60,12 +60,12 @@ void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC ) ...@@ -60,12 +60,12 @@ void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC )
if( aTextItem->GetFlags() == 0 ) if( aTextItem->GetFlags() == 0 )
SaveCopyInUndoList( aTextItem, UR_CHANGED ); SaveCopyInUndoList( aTextItem, UR_CHANGED );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
aTextItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aTextItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
aTextItem->SetOrientation( orient ); aTextItem->SetOrientation( orient );
OnModify(); OnModify();
aTextItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aTextItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
} }
...@@ -106,7 +106,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType ) ...@@ -106,7 +106,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
textItem->m_Size.x = textItem->m_Size.y = g_DefaultTextLabelSize; textItem->m_Size.x = textItem->m_Size.y = g_DefaultTextLabelSize;
textItem->SetFlags( IS_NEW | IS_MOVED ); textItem->SetFlags( IS_NEW | IS_MOVED );
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
EditSchematicText( textItem ); EditSchematicText( textItem );
if( textItem->m_Text.IsEmpty() ) if( textItem->m_Text.IsEmpty() )
...@@ -124,7 +124,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType ) ...@@ -124,7 +124,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
lastGlobalLabelShape = textItem->GetShape(); lastGlobalLabelShape = textItem->GetShape();
} }
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
MoveItem( (SCH_ITEM*) textItem, aDC ); MoveItem( (SCH_ITEM*) textItem, aDC );
return textItem; return textItem;
...@@ -220,17 +220,17 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent ) ...@@ -220,17 +220,17 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
* put in undo list later, at the end of the current command (if not aborted) * put in undo list later, at the end of the current command (if not aborted)
*/ */
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); // Erase schematic cursor m_canvas->CrossHairOff( &dc ); // Erase schematic cursor
text->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); text->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
screen->RemoveFromDrawList( text ); screen->RemoveFromDrawList( text );
screen->AddToDrawList( newtext ); screen->AddToDrawList( newtext );
GetScreen()->SetCurItem( newtext ); GetScreen()->SetCurItem( newtext );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
OnModify(); OnModify();
newtext->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); newtext->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( &dc ); // redraw schematic cursor m_canvas->CrossHairOn( &dc ); // redraw schematic cursor
if( text->IsNew() ) if( text->IsNew() )
{ {
......
...@@ -47,16 +47,16 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -47,16 +47,16 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( GetScreen() == NULL ) if( GetScreen() == NULL )
return; return;
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
GetScreen()->Draw( DrawPanel, DC, GR_DEFAULT_DRAWMODE ); GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, FALSE );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
// Display the sheet filename, and the sheet path, for non root sheets // Display the sheet filename, and the sheet path, for non root sheets
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName ) if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
......
...@@ -170,13 +170,13 @@ bool EDA_APP::OnInit() ...@@ -170,13 +170,13 @@ bool EDA_APP::OnInit()
wxSetWorkingDirectory( filename.GetPath() ); wxSetWorkingDirectory( filename.GetPath() );
if( frame->LoadOneEEProject( filename.GetFullPath(), false ) ) if( frame->LoadOneEEProject( filename.GetFullPath(), false ) )
frame->DrawPanel->Refresh( true ); frame->GetCanvas()->Refresh( true );
} }
else else
{ {
// Read a default config file if no file to load. // Read a default config file if no file to load.
frame->LoadProjectFile( wxEmptyString, true ); frame->LoadProjectFile( wxEmptyString, true );
frame->DrawPanel->Refresh( true ); frame->GetCanvas()->Refresh( true );
} }
return true; return true;
......
...@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowGrid( IsGridVisible() );
dlg.SetShowHiddenPins( m_showAllPins ); dlg.SetShowHiddenPins( m_showAllPins );
dlg.SetEnableAutoPan( DrawPanel->m_AutoPAN_Enable ); dlg.SetEnableAutoPan( m_canvas->m_AutoPAN_Enable );
dlg.SetEnableHVBusOrientation( g_HVLines ); dlg.SetEnableHVBusOrientation( g_HVLines );
dlg.SetShowPageLimits( g_ShowPageLimits ); dlg.SetShowPageLimits( g_ShowPageLimits );
dlg.Layout(); dlg.Layout();
...@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 ); SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 );
SetGridVisibility( dlg.GetShowGrid() ); SetGridVisibility( dlg.GetShowGrid() );
m_showAllPins = dlg.GetShowHiddenPins(); m_showAllPins = dlg.GetShowHiddenPins();
DrawPanel->m_AutoPAN_Enable = dlg.GetEnableAutoPan(); m_canvas->m_AutoPAN_Enable = dlg.GetEnableAutoPan();
g_HVLines = dlg.GetEnableHVBusOrientation(); g_HVLines = dlg.GetEnableHVBusOrientation();
g_ShowPageLimits = dlg.GetShowPageLimits(); g_ShowPageLimits = dlg.GetShowPageLimits();
...@@ -247,7 +247,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -247,7 +247,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
} }
} }
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
......
...@@ -21,7 +21,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event ) ...@@ -21,7 +21,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
if( !curr_item || curr_item->GetFlags() ) if( !curr_item || curr_item->GetFlags() )
return; return;
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( curr_item->Type() ) switch( curr_item->Type() )
{ {
...@@ -35,7 +35,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event ) ...@@ -35,7 +35,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
MoveItem( (SCH_ITEM*) newitem, &dc ); MoveItem( (SCH_ITEM*) newitem, &dc );
// Redraw the original part, because StartMovePart() erased it from screen. // Redraw the original part, because StartMovePart() erased it from screen.
curr_item->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
} }
break; break;
...@@ -49,7 +49,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event ) ...@@ -49,7 +49,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
MoveItem( (SCH_ITEM*) newitem, &dc ); MoveItem( (SCH_ITEM*) newitem, &dc );
/* Redraw the original part in XOR mode */ /* Redraw the original part in XOR mode */
curr_item->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
} }
break; break;
......
...@@ -258,7 +258,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) ...@@ -258,7 +258,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
LoadProjectFile( wxEmptyString, true ); LoadProjectFile( wxEmptyString, true );
Zoom_Automatique( false ); Zoom_Automatique( false );
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->Refresh(); m_canvas->Refresh();
return true; return true;
} }
...@@ -354,7 +354,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) ...@@ -354,7 +354,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
Zoom_Automatique( false ); Zoom_Automatique( false );
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
return diag; return diag;
} }
......
...@@ -208,7 +208,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference, ...@@ -208,7 +208,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
/* There may be need to reframe the drawing */ /* There may be need to reframe the drawing */
if( ! DrawPanel->IsPointOnDisplay( pos ) ) if( ! m_canvas->IsPointOnDisplay( pos ) )
{ {
centerAndRedraw = true; centerAndRedraw = true;
} }
...@@ -221,16 +221,16 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference, ...@@ -221,16 +221,16 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
else else
{ {
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
if( aWarpMouse ) if( aWarpMouse )
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
GetScreen()->SetCrossHairPosition(pos); GetScreen()->SetCrossHairPosition(pos);
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
} }
......
...@@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
static wxString lastCommponentName; static wxString lastCommponentName;
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
if( !libname.IsEmpty() ) if( !libname.IsEmpty() )
{ {
...@@ -122,8 +122,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -122,8 +122,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if ( dlg.ShowModal() == wxID_CANCEL ) if ( dlg.ShowModal() == wxID_CANCEL )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -140,8 +140,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -140,8 +140,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -157,8 +157,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -157,8 +157,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
...@@ -168,8 +168,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -168,8 +168,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( GetNameOfPartToLoad( this, Library, Name ) == 0 ) if( GetNameOfPartToLoad( this, Library, Name ) == 0 )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
...@@ -180,8 +180,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -180,8 +180,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
...@@ -200,14 +200,14 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -200,14 +200,14 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Entry == NULL ) if( Entry == NULL )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( Entry == NULL ) if( Entry == NULL )
{ {
...@@ -230,7 +230,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -230,7 +230,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
// Set the component value that can differ from component name in lib, for aliases // Set the component value that can differ from component name in lib, for aliases
component->GetField( VALUE )->m_Text = Name; component->GetField( VALUE )->m_Text = Name;
component->DisplayInfo( this ); component->DisplayInfo( this );
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
component->SetFlags( IS_NEW ); component->SetFlags( IS_NEW );
MoveItem( (SCH_ITEM*) component, DC ); MoveItem( (SCH_ITEM*) component, DC );
...@@ -252,7 +252,7 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation ) ...@@ -252,7 +252,7 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
SCH_COMPONENT* component = (SCH_COMPONENT*) item; SCH_COMPONENT* component = (SCH_COMPONENT*) item;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( component->GetFlags() == 0 ) if( component->GetFlags() == 0 )
{ {
...@@ -260,27 +260,27 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation ) ...@@ -260,27 +260,27 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
// Erase the previous component in it's current orientation. // Erase the previous component in it's current orientation.
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
if( component->GetFlags() ) if( component->GetFlags() )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
DrawPanel->RefreshDrawingRect( component->GetBoundingBox() ); m_canvas->RefreshDrawingRect( component->GetBoundingBox() );
component->SetOrientation( aOrientation ); component->SetOrientation( aOrientation );
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( component->GetFlags() ) if( component->GetFlags() )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
GetScreen()->TestDanglingEnds( DrawPanel, &dc ); GetScreen()->TestDanglingEnds( m_canvas, &dc );
OnModify(); OnModify();
} }
...@@ -296,9 +296,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent ) ...@@ -296,9 +296,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
wxCHECK_RET( item != NULL && item->Type() == SCH_COMPONENT_T, wxCHECK_RET( item != NULL && item->Type() == SCH_COMPONENT_T,
wxT( "Cannot select unit of invalid schematic item." ) ); wxT( "Cannot select unit of invalid schematic item." ) );
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
SCH_COMPONENT* component = (SCH_COMPONENT*) item; SCH_COMPONENT* component = (SCH_COMPONENT*) item;
...@@ -330,9 +330,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent ) ...@@ -330,9 +330,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
SaveCopyInUndoList( component, UR_CHANGED ); SaveCopyInUndoList( component, UR_CHANGED );
if( flags ) if( flags )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
/* Update the unit number. */ /* Update the unit number. */
component->SetUnitSelection( m_CurrentSheet, unit ); component->SetUnitSelection( m_CurrentSheet, unit );
...@@ -342,11 +342,11 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent ) ...@@ -342,11 +342,11 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( flags ) if( flags )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
OnModify(); OnModify();
} }
...@@ -372,9 +372,9 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC ) ...@@ -372,9 +372,9 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
int flags = DrawComponent->GetFlags(); int flags = DrawComponent->GetFlags();
if( DrawComponent->GetFlags() ) if( DrawComponent->GetFlags() )
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 ); DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 );
...@@ -392,10 +392,10 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC ) ...@@ -392,10 +392,10 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( DrawComponent->IsMoving() ) if( DrawComponent->IsMoving() )
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
OnModify( ); OnModify( );
} }
...@@ -280,26 +280,26 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() ...@@ -280,26 +280,26 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
// update the References // update the References
m_CurrentSheet->UpdateAllScreenReferences(); m_CurrentSheet->UpdateAllScreenReferences();
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
if( screen->m_FirstRedraw ) if( screen->m_FirstRedraw )
{ {
Zoom_Automatique( false ); Zoom_Automatique( false );
screen->m_FirstRedraw = false; screen->m_FirstRedraw = false;
screen->SetCrossHairPosition( screen->GetScrollCenterPosition() ); screen->SetCrossHairPosition( screen->GetScrollCenterPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
} }
else else
{ {
RedrawScreen( screen->GetScrollCenterPosition(), true ); RedrawScreen( screen->GetScrollCenterPosition(), true );
} }
// Now refresh DrawPanel. Should be not necessary, but because screen has changed // Now refresh m_canvas. Should be not necessary, but because screen has changed
// the previous refresh has set all new draw parameters (scroll position ..) // the previous refresh has set all new draw parameters (scroll position ..)
// but most of time there were some inconsitencies about cursor parameters // but most of time there were some inconsitencies about cursor parameters
// ( previous position of cursor ...) and artefacts can happen // ( previous position of cursor ...) and artefacts can happen
// mainly when sheet size has changed // mainly when sheet size has changed
// This second refresh clears artefacts because at this point, // This second refresh clears artefacts because at this point,
// all parameters are now updated // all parameters are now updated
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -89,7 +89,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event ) ...@@ -89,7 +89,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
m_lastLibImportPath = fn.GetPath(); m_lastLibImportPath = fn.GetPath();
DisplayLibInfos(); DisplayLibInfos();
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
delete LibTmp; delete LibTmp;
......
...@@ -118,7 +118,7 @@ void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event ) ...@@ -118,7 +118,7 @@ void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event )
wxString CmpName; wxString CmpName;
LIB_ALIAS* LibEntry = NULL; LIB_ALIAS* LibEntry = NULL;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
if( GetScreen()->IsModify() if( GetScreen()->IsModify()
&& !IsOK( this, _( "Current part not saved.\n\nDiscard current changes?" ) ) ) && !IsOK( this, _( "Current part not saved.\n\nDiscard current changes?" ) ) )
...@@ -235,7 +235,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -235,7 +235,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( GetScreen() == NULL ) if( GetScreen() == NULL )
return; return;
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
if( m_component ) if( m_component )
{ {
...@@ -246,15 +246,15 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -246,15 +246,15 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
wxString fieldText = Field->m_Text; wxString fieldText = Field->m_Text;
wxString fieldfullText = Field->GetFullText( m_unit ); wxString fieldfullText = Field->GetFullText( m_unit );
Field->m_Text = fieldfullText; Field->m_Text = fieldfullText;
m_component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit,
m_convert, GR_DEFAULT_DRAWMODE ); m_convert, GR_DEFAULT_DRAWMODE );
Field->m_Text = fieldText; Field->m_Text = fieldText;
} }
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
DisplayLibInfos(); DisplayLibInfos();
UpdateStatusBar(); UpdateStatusBar();
...@@ -266,7 +266,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -266,7 +266,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
wxFileName fn; wxFileName fn;
wxString msg; wxString msg;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
if( m_library == NULL ) if( m_library == NULL )
{ {
...@@ -456,7 +456,7 @@ void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event ) ...@@ -456,7 +456,7 @@ void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
wxArrayString ListNames; wxArrayString ListNames;
wxString msg; wxString msg;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
m_drawItem = NULL; m_drawItem = NULL;
...@@ -536,7 +536,7 @@ All changes will be lost. Discard changes?" ) ) ) ...@@ -536,7 +536,7 @@ All changes will be lost. Discard changes?" ) ) )
m_aliasName.Empty(); m_aliasName.Empty();
} }
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -550,7 +550,7 @@ void LIB_EDIT_FRAME::CreateNewLibraryPart( wxCommandEvent& event ) ...@@ -550,7 +550,7 @@ void LIB_EDIT_FRAME::CreateNewLibraryPart( wxCommandEvent& event )
lost!\n\nClear the current component from the screen?" ) ) ) lost!\n\nClear the current component from the screen?" ) ) )
return; return;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
m_drawItem = NULL; m_drawItem = NULL;
...@@ -634,7 +634,7 @@ lost!\n\nClear the current component from the screen?" ) ) ) ...@@ -634,7 +634,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
m_mainToolBar->Refresh(); m_mainToolBar->Refresh();
} }
......
...@@ -32,8 +32,8 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -32,8 +32,8 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
{ {
DisplayCmpDoc(); DisplayCmpDoc();
if( DrawPanel->m_AbortRequest ) if( m_canvas->m_AbortRequest )
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
} }
} }
...@@ -97,12 +97,12 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -97,12 +97,12 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
case ID_LIBEDIT_ANCHOR_ITEM_BUTT: case ID_LIBEDIT_ANCHOR_ITEM_BUTT:
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
PlaceAnchor(); PlaceAnchor();
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
default: default:
wxFAIL_MSG( wxString::Format( wxT( "Unhandled command ID %d" ), GetToolId() ) ); wxFAIL_MSG( wxString::Format( wxT( "Unhandled command ID %d" ), GetToolId() ) );
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
} }
} }
...@@ -135,7 +135,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -135,7 +135,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
else else
return; return;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
switch( m_drawItem->Type() ) switch( m_drawItem->Type() )
{ {
...@@ -187,6 +187,6 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -187,6 +187,6 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
break; break;
} }
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
} }
...@@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateItemUsingCursor( aPosition ); item = LocateItemUsingCursor( aPosition );
// If the clarify item selection context menu is aborted, don't show the context menu. // If the clarify item selection context menu is aborted, don't show the context menu.
if( item == NULL && DrawPanel->m_AbortRequest ) if( item == NULL && m_canvas->m_AbortRequest )
{ {
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
return false; return false;
} }
......
...@@ -88,9 +88,9 @@ void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event ) ...@@ -88,9 +88,9 @@ void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg ) void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg )
{ {
wxSize image_size = DrawPanel->GetClientSize(); wxSize image_size = m_canvas->GetClientSize();
wxClientDC dc( DrawPanel ); wxClientDC dc( m_canvas );
wxBitmap bitmap( image_size.x, image_size.y ); wxBitmap bitmap( image_size.x, image_size.y );
wxMemoryDC memdc; wxMemoryDC memdc;
...@@ -125,7 +125,7 @@ void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode ...@@ -125,7 +125,7 @@ void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode
plot_offset.x = pagesize.x/2; plot_offset.x = pagesize.x/2;
plot_offset.y = pagesize.y/2; plot_offset.y = pagesize.y/2;
m_component->Draw( DrawPanel, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE ); m_component->Draw( m_canvas, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE );
} }
...@@ -62,8 +62,8 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event ) ...@@ -62,8 +62,8 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event )
SetShowDeMorgan( m_component->HasConversion() ); SetShowDeMorgan( m_component->HasConversion() );
DisplayLibInfos(); DisplayLibInfos();
DisplayCmpDoc(); DisplayCmpDoc();
OnModify( ); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -99,5 +99,5 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event ) ...@@ -99,5 +99,5 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
DisplayLibInfos(); DisplayLibInfos();
DisplayCmpDoc(); DisplayCmpDoc();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
This diff is collapsed.
...@@ -144,7 +144,7 @@ this component?" ), ...@@ -144,7 +144,7 @@ this component?" ),
if( !aField->InEditMode() ) if( !aField->InEditMode() )
{ {
SaveCopyInUndoList( parent ); SaveCopyInUndoList( parent );
( (LIB_ITEM*) aField )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, ( (LIB_ITEM*) aField )->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode,
&fieldText, DefaultTransform ); &fieldText, DefaultTransform );
} }
...@@ -152,7 +152,7 @@ this component?" ), ...@@ -152,7 +152,7 @@ this component?" ),
if( !aField->InEditMode() ) if( !aField->InEditMode() )
{ {
fieldText = aField->GetFullText( m_unit ); fieldText = aField->GetFullText( m_unit );
( (LIB_ITEM*) aField )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, ( (LIB_ITEM*) aField )->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode,
&fieldText, DefaultTransform ); &fieldText, DefaultTransform );
} }
......
...@@ -57,7 +57,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -57,7 +57,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) ) if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) )
{ {
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
if( item && item->GetFlags() ) if( item && item->GetFlags() )
...@@ -79,7 +79,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -79,7 +79,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
item->Place( this, aDC ); item->Place( this, aDC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
return; return;
case SCH_LINE_T: // May already be drawing segment. case SCH_LINE_T: // May already be drawing segment.
...@@ -129,16 +129,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -129,16 +129,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
m_itemToRepeat = AddNoConnect( aDC, gridPosition ); m_itemToRepeat = AddNoConnect( aDC, gridPosition );
GetScreen()->SetCurItem( m_itemToRepeat ); GetScreen()->SetCurItem( m_itemToRepeat );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case ID_JUNCTION_BUTT: case ID_JUNCTION_BUTT:
...@@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
m_itemToRepeat = AddJunction( aDC, gridPosition, true ); m_itemToRepeat = AddJunction( aDC, gridPosition, true );
GetScreen()->SetCurItem( m_itemToRepeat ); GetScreen()->SetCurItem( m_itemToRepeat );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case ID_WIRETOBUS_ENTRY_BUTT: case ID_WIRETOBUS_ENTRY_BUTT:
...@@ -165,15 +165,15 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -165,15 +165,15 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ? item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ?
WIRE_TO_BUS : BUS_TO_BUS ); WIRE_TO_BUS : BUS_TO_BUS );
GetScreen()->SetCurItem( item ); GetScreen()->SetCurItem( item );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
break; break;
...@@ -183,29 +183,29 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -183,29 +183,29 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_WIRE_BUTT: case ID_WIRE_BUTT:
BeginSegment( aDC, LAYER_WIRE ); BeginSegment( aDC, LAYER_WIRE );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
break; break;
case ID_BUS_BUTT: case ID_BUS_BUTT:
BeginSegment( aDC, LAYER_BUS ); BeginSegment( aDC, LAYER_BUS );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
break; break;
case ID_LINE_COMMENT_BUTT: case ID_LINE_COMMENT_BUTT:
BeginSegment( aDC, LAYER_NOTES ); BeginSegment( aDC, LAYER_NOTES );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
break; break;
case ID_TEXT_COMMENT_BUTT: case ID_TEXT_COMMENT_BUTT:
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) ); GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
break; break;
...@@ -213,12 +213,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -213,12 +213,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateNewImage( aDC ) ); GetScreen()->SetCurItem( CreateNewImage( aDC ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
break; break;
...@@ -226,14 +226,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -226,14 +226,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) ); GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
...@@ -247,14 +247,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -247,14 +247,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( GetToolId() == ID_HIERLABEL_BUTT ) if( GetToolId() == ID_HIERLABEL_BUTT )
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) ); GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
...@@ -262,14 +262,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -262,14 +262,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateSheet( aDC ) ); GetScreen()->SetCurItem( CreateSheet( aDC ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
...@@ -292,7 +292,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -292,7 +292,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
item->Place( this, aDC ); item->Place( this, aDC );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
...@@ -300,14 +300,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -300,14 +300,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( (item == NULL) || (item->GetFlags() == 0) ) if( (item == NULL) || (item->GetFlags() == 0) )
{ {
GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) ); GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
...@@ -316,19 +316,19 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -316,19 +316,19 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ), GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ),
s_PowerNameList, false ) ); s_PowerNameList, false ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
default: default:
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
wxFAIL_MSG( wxT( "SCH_EDIT_FRAME::OnLeftClick invalid tool ID <" ) + wxFAIL_MSG( wxT( "SCH_EDIT_FRAME::OnLeftClick invalid tool ID <" ) +
wxString::Format( wxT( "%d> selected." ), GetToolId() ) ); wxString::Format( wxT( "%d> selected." ), GetToolId() ) );
} }
...@@ -368,7 +368,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -368,7 +368,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
case SCH_COMPONENT_T: case SCH_COMPONENT_T:
EditComponent( (SCH_COMPONENT*) item ); EditComponent( (SCH_COMPONENT*) item );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case SCH_TEXT_T: case SCH_TEXT_T:
...@@ -384,7 +384,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -384,7 +384,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
case SCH_FIELD_T: case SCH_FIELD_T:
EditComponentFieldText( (SCH_FIELD*) item, aDC ); EditComponentFieldText( (SCH_FIELD*) item, aDC );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case SCH_MARKER_T: case SCH_MARKER_T:
......
...@@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = GetScreen()->IsBlockActive(); bool BlockActive = GetScreen()->IsBlockActive();
// Do not start a block command on context menu. // Do not start a block command on context menu.
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
if( BlockActive ) if( BlockActive )
{ {
...@@ -91,9 +91,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -91,9 +91,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins ); item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins );
// If the clarify item selection context menu is aborted, don't show the context menu. // If the clarify item selection context menu is aborted, don't show the context menu.
if( item == NULL && DrawPanel->m_AbortRequest ) if( item == NULL && m_canvas->m_AbortRequest )
{ {
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
return false; return false;
} }
} }
......
...@@ -142,6 +142,7 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList ) ...@@ -142,6 +142,7 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList )
void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem ) void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
{ {
wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) ); wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) );
if( aItem == NULL ) if( aItem == NULL )
return; return;
...@@ -155,7 +156,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem ) ...@@ -155,7 +156,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
wxT( "Sheet label has invalid parent item." ) ); wxT( "Sheet label has invalid parent item." ) );
SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED ); SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED );
sheet->RemovePin( (SCH_SHEET_PIN*) aItem ); sheet->RemovePin( (SCH_SHEET_PIN*) aItem );
DrawPanel->RefreshDrawingRect( sheet->GetBoundingBox() ); m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
} }
else else
{ {
...@@ -165,7 +166,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem ) ...@@ -165,7 +166,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
aItem->SetBack( NULL ); // Only one struct -> no link aItem->SetBack( NULL ); // Only one struct -> no link
SaveCopyInUndoList( aItem, UR_DELETED ); SaveCopyInUndoList( aItem, UR_DELETED );
DrawPanel->RefreshDrawingRect( aItem->GetBoundingBox() ); m_canvas->RefreshDrawingRect( aItem->GetBoundingBox() );
} }
} }
......
...@@ -116,7 +116,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event ) ...@@ -116,7 +116,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
if( pin->IsNew() ) if( pin->IsNew() )
{ {
pin->SetFlags( IS_CANCELLED ); pin->SetFlags( IS_CANCELLED );
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
} }
return; return;
} }
...@@ -152,7 +152,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event ) ...@@ -152,7 +152,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
OnModify( ); OnModify( );
pin->DisplayInfo( this ); pin->DisplayInfo( this );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
pin->EnableEditMode( false, m_editPinsPerPartOrConvert ); pin->EnableEditMode( false, m_editPinsPerPartOrConvert );
...@@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC ) ...@@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
if( ask_for_pin && SynchronizePins() ) if( ask_for_pin && SynchronizePins() )
{ {
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
status = status =
IsOK( this, _( "This position is already occupied by \ IsOK( this, _( "This position is already occupied by \
another pin. Continue?" ) ); another pin. Continue?" ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
if( !status ) if( !status )
return; return;
...@@ -241,7 +241,7 @@ another pin. Continue?" ) ); ...@@ -241,7 +241,7 @@ another pin. Continue?" ) );
else else
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
DrawPanel->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
OnModify(); OnModify();
CurrentPin->SetPosition( newpos ); CurrentPin->SetPosition( newpos );
...@@ -268,11 +268,11 @@ another pin. Continue?" ) ); ...@@ -268,11 +268,11 @@ another pin. Continue?" ) );
Pin->ClearFlags(); Pin->ClearFlags();
} }
DrawPanel->CrossHairOff( DC ); m_canvas->CrossHairOff( DC );
bool showPinText = true; bool showPinText = true;
CurrentPin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, CurrentPin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE,
&showPinText, DefaultTransform ); &showPinText, DefaultTransform );
DrawPanel->CrossHairOn( DC ); m_canvas->CrossHairOn( DC );
m_drawItem = NULL; m_drawItem = NULL;
} }
...@@ -313,13 +313,13 @@ void LIB_EDIT_FRAME::StartMovePin( wxDC* DC ) ...@@ -313,13 +313,13 @@ void LIB_EDIT_FRAME::StartMovePin( wxDC* DC )
startPos.x = OldPos.x; startPos.x = OldPos.x;
startPos.y = -OldPos.y; startPos.y = -OldPos.y;
DrawPanel->CrossHairOff( DC ); m_canvas->CrossHairOff( DC );
GetScreen()->SetCrossHairPosition( startPos ); GetScreen()->SetCrossHairPosition( startPos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
CurrentPin->DisplayInfo( this ); CurrentPin->DisplayInfo( this );
DrawPanel->SetMouseCapture( DrawMovePin, AbortPinMove ); m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
DrawPanel->CrossHairOn( DC ); m_canvas->CrossHairOn( DC );
} }
...@@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC ) ...@@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit ); pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
pin->SetVisible( LastPinVisible ); pin->SetVisible( LastPinVisible );
PinPreviousPos = pin->GetPosition(); PinPreviousPos = pin->GetPosition();
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN ); cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
if( pin->GetFlags() & IS_CANCELLED ) if( pin->GetFlags() & IS_CANCELLED )
{ {
...@@ -412,10 +412,10 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC ) ...@@ -412,10 +412,10 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
else else
{ {
ClearTempCopyComponent(); ClearTempCopyComponent();
DrawPanel->SetMouseCapture( DrawMovePin, AbortPinMove ); m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
if( DC ) if( DC )
pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText, pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText,
DefaultTransform ); DefaultTransform );
} }
...@@ -503,7 +503,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ) ...@@ -503,7 +503,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
if( selected && !Pin->IsSelected() ) if( selected && !Pin->IsSelected() )
continue; continue;
Pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &showPinText, DefaultTransform ); Pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode, &showPinText, DefaultTransform );
switch( id ) switch( id )
{ {
...@@ -520,7 +520,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ) ...@@ -520,7 +520,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
break; break;
} }
Pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &showPinText, Pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &showPinText,
DefaultTransform ); DefaultTransform );
} }
} }
...@@ -553,7 +553,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin ) ...@@ -553,7 +553,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
Pin->SetFlags( IS_LINKED ); Pin->SetFlags( IS_LINKED );
wxPoint savepos = GetScreen()->GetCrossHairPosition(); wxPoint savepos = GetScreen()->GetCrossHairPosition();
DrawPanel->CrossHairOff( DC ); m_canvas->CrossHairOff( DC );
GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x, -Pin->GetPosition().y ) ); GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x, -Pin->GetPosition().y ) );
// Add this new pin in list, and creates pins for others parts if needed // Add this new pin in list, and creates pins for others parts if needed
...@@ -563,7 +563,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin ) ...@@ -563,7 +563,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
m_lastDrawItem = Pin; m_lastDrawItem = Pin;
GetScreen()->SetCrossHairPosition( savepos ); GetScreen()->SetCrossHairPosition( savepos );
DrawPanel->CrossHairOn( DC ); m_canvas->CrossHairOn( DC );
Pin->DisplayInfo( this ); Pin->DisplayInfo( this );
OnModify( ); OnModify( );
......
...@@ -345,14 +345,14 @@ bool SCH_FIELD::Save( FILE* aFile ) const ...@@ -345,14 +345,14 @@ bool SCH_FIELD::Save( FILE* aFile ) const
void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC ) void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
frame->DrawPanel->SetMouseCapture( NULL, NULL ); frame->GetCanvas()->SetMouseCapture( NULL, NULL );
SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent(); SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent();
// save old cmp in undo list // save old cmp in undo list
frame->SaveUndoItemInUndoList( component ); frame->SaveUndoItemInUndoList( component );
Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
ClearFlags(); ClearFlags();
frame->GetScreen()->SetCurItem( NULL ); frame->GetScreen()->SetCurItem( NULL );
frame->OnModify(); frame->OnModify();
......
...@@ -484,12 +484,12 @@ void SCH_SHEET::Place( SCH_EDIT_FRAME* frame, wxDC* DC ) ...@@ -484,12 +484,12 @@ void SCH_SHEET::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
// fix size and position of the new sheet // fix size and position of the new sheet
// using the last values set by the m_mouseCaptureCallback function // using the last values set by the m_mouseCaptureCallback function
frame->DrawPanel->SetMouseCapture( NULL, NULL ); frame->GetCanvas()->SetMouseCapture( NULL, NULL );
if( !frame->EditSheet( this, DC ) ) if( !frame->EditSheet( this, DC ) )
{ {
frame->GetScreen()->SetCurItem( NULL ); frame->GetScreen()->SetCurItem( NULL );
Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), g_XorMode );
delete this; delete this;
return; return;
} }
......
...@@ -144,11 +144,11 @@ void SCH_SHEET_PIN::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC ) ...@@ -144,11 +144,11 @@ void SCH_SHEET_PIN::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
} }
ClearFlags(); ClearFlags();
sheet->Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); sheet->Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
// Make sure we don't call the abort move function. // Make sure we don't call the abort move function.
aFrame->DrawPanel->SetMouseCapture( NULL, NULL ); aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
aFrame->DrawPanel->EndMouseCapture(); aFrame->GetCanvas()->EndMouseCapture();
} }
......
This diff is collapsed.
...@@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::GetSchematicFromUndoList( wxCommandEvent& event ) ...@@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::GetSchematicFromUndoList( wxCommandEvent& event )
SetSheetNumberAndCount(); SetSheetNumberAndCount();
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -385,5 +385,5 @@ void SCH_EDIT_FRAME::GetSchematicFromRedoList( wxCommandEvent& event ) ...@@ -385,5 +385,5 @@ void SCH_EDIT_FRAME::GetSchematicFromRedoList( wxCommandEvent& event )
SetSheetNumberAndCount(); SetSheetNumberAndCount();
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -224,8 +224,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father, ...@@ -224,8 +224,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( DrawPanel ) if( m_canvas )
DrawPanel->m_Block_Enable = true; m_canvas->m_Block_Enable = true;
ReCreateMenuBar(); ReCreateMenuBar();
ReCreateHToolbar(); ReCreateHToolbar();
...@@ -260,8 +260,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father, ...@@ -260,8 +260,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
m_auimgr.AddPane( m_optionsToolBar, m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() ); wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
if( DrawPanel ) if( m_canvas )
m_auimgr.AddPane( DrawPanel, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); m_auimgr.AddPane( m_canvas, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
if( m_messagePanel ) if( m_messagePanel )
m_auimgr.AddPane( m_messagePanel, wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom(). m_auimgr.AddPane( m_messagePanel, wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().
...@@ -492,7 +492,7 @@ double SCH_EDIT_FRAME::BestZoom() ...@@ -492,7 +492,7 @@ double SCH_EDIT_FRAME::BestZoom()
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x; dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y; dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
// Reserve no margin because best zoom shows the full page // Reserve no margin because best zoom shows the full page
// and margins are already included in function that draws the sheet refernces // and margins are already included in function that draws the sheet refernces
...@@ -653,7 +653,7 @@ void SCH_EDIT_FRAME::OnFindItems( wxCommandEvent& aEvent ) ...@@ -653,7 +653,7 @@ void SCH_EDIT_FRAME::OnFindItems( wxCommandEvent& aEvent )
wxCHECK_RET( m_findReplaceData != NULL, wxCHECK_RET( m_findReplaceData != NULL,
wxT( "Forgot to create find/replace data. Bad Programmer!" ) ); wxT( "Forgot to create find/replace data. Bad Programmer!" ) );
this->DrawPanel->m_IgnoreMouseEvents = true; this->GetCanvas()->m_IgnoreMouseEvents = true;
if( m_dlgFindReplace ) if( m_dlgFindReplace )
{ {
...@@ -704,7 +704,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event ) ...@@ -704,7 +704,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event )
m_dlgFindReplace = NULL; m_dlgFindReplace = NULL;
} }
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
} }
...@@ -722,7 +722,7 @@ void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event ) ...@@ -722,7 +722,7 @@ void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event )
void SCH_EDIT_FRAME::OnLoadStuffFile( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnLoadStuffFile( wxCommandEvent& event )
{ {
ReadInputStuffFile(); ReadInputStuffFile();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -876,7 +876,7 @@ void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event ) ...@@ -876,7 +876,7 @@ void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData ) void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData )
{ {
GetScreen()->Draw( DrawPanel, aDC, GR_DEFAULT_DRAWMODE ); GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness );
} }
...@@ -890,7 +890,7 @@ void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent ) ...@@ -890,7 +890,7 @@ void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
&& (index >= 0 && index < m_collectedItems.GetCount()) ) && (index >= 0 && index < m_collectedItems.GetCount()) )
{ {
SCH_ITEM* item = m_collectedItems[index]; SCH_ITEM* item = m_collectedItems[index];
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
GetScreen()->SetCurItem( item ); GetScreen()->SetCurItem( item );
} }
} }
......
...@@ -163,8 +163,8 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) ...@@ -163,8 +163,8 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
} }
} }
aSheet->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
if( isUndoable ) if( isUndoable )
SaveCopyInUndoList( aSheet, UR_CHANGED ); SaveCopyInUndoList( aSheet, UR_CHANGED );
...@@ -203,9 +203,9 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) ...@@ -203,9 +203,9 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
if( aSheet->GetName().IsEmpty() ) if( aSheet->GetName().IsEmpty() )
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) ); aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
aSheet->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
OnModify(); OnModify();
return true; return true;
...@@ -320,12 +320,12 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC ) ...@@ -320,12 +320,12 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
// also need to update the hierarchy, if we are adding // also need to update the hierarchy, if we are adding
// a sheet to a screen that already has multiple instances (!) // a sheet to a screen that already has multiple instances (!)
GetScreen()->SetCurItem( sheet ); GetScreen()->SetCurItem( sheet );
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() ); GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
return sheet; return sheet;
} }
...@@ -340,16 +340,16 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC ) ...@@ -340,16 +340,16 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
wxString::Format( wxT( "Cannot perform sheet resize on %s object." ), wxString::Format( wxT( "Cannot perform sheet resize on %s object." ),
GetChars( aSheet->GetClass() ) ) ); GetChars( aSheet->GetClass() ) ) );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aSheet->GetResizePosition() ); GetScreen()->SetCrossHairPosition( aSheet->GetResizePosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
SetUndoItem( aSheet ); SetUndoItem( aSheet );
aSheet->SetFlags( IS_RESIZED ); aSheet->SetFlags( IS_RESIZED );
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo
SetUndoItem( aSheet ); SetUndoItem( aSheet );
...@@ -361,15 +361,15 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC ) ...@@ -361,15 +361,15 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC )
if( ( aSheet == NULL ) || ( aSheet->Type() != SCH_SHEET_T ) ) if( ( aSheet == NULL ) || ( aSheet->Type() != SCH_SHEET_T ) )
return; return;
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aSheet->GetPosition() ); GetScreen()->SetCrossHairPosition( aSheet->GetPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( !aSheet->IsNew() ) if( !aSheet->IsNew() )
SetUndoItem( aSheet ); SetUndoItem( aSheet );
aSheet->SetFlags( IS_MOVED ); aSheet->SetFlags( IS_MOVED );
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
} }
...@@ -75,7 +75,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC ) ...@@ -75,7 +75,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
return wxID_CANCEL; return wxID_CANCEL;
if( aDC ) if( aDC )
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aSheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
if( !aSheetPin->IsNew() ) if( !aSheetPin->IsNew() )
{ {
...@@ -89,7 +89,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC ) ...@@ -89,7 +89,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
aSheetPin->SetShape( dlg.GetConnectionType() ); aSheetPin->SetShape( dlg.GetConnectionType() );
if( aDC ) if( aDC )
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); aSheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
return wxID_OK; return wxID_OK;
} }
......
...@@ -94,7 +94,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem ) ...@@ -94,7 +94,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem )
OnModify( ); OnModify( );
DrawItem->DisplayInfo( this ); DrawItem->DisplayInfo( this );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -123,7 +123,7 @@ static void AbortSymbolTraceOn( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -123,7 +123,7 @@ static void AbortSymbolTraceOn( EDA_DRAW_PANEL* Panel, wxDC* DC )
LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
{ {
DrawPanel->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn ); m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
wxPoint drawPos = GetScreen()->GetCrossHairPosition( true ); wxPoint drawPos = GetScreen()->GetCrossHairPosition( true );
// no temp copy -> the current version of component will be used for Undo // no temp copy -> the current version of component will be used for Undo
...@@ -155,10 +155,10 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) ...@@ -155,10 +155,10 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
Text->m_Orient = m_textOrientation; Text->m_Orient = m_textOrientation;
// Enter the graphic text info // Enter the graphic text info
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
EditSymbolText( NULL, Text ); EditSymbolText( NULL, Text );
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( Text->m_Text.IsEmpty() ) if( Text->m_Text.IsEmpty() )
{ {
...@@ -188,16 +188,16 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) ...@@ -188,16 +188,16 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
m_drawItem->SetConvert( m_convert ); m_drawItem->SetConvert( m_convert );
// Draw initial symbol: // Draw initial symbol:
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
else else
{ {
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
return NULL; return NULL;
} }
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
return m_drawItem; return m_drawItem;
} }
...@@ -214,7 +214,7 @@ void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC ) ...@@ -214,7 +214,7 @@ void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC )
if( m_drawItem->ContinueEdit( pos ) ) if( m_drawItem->ContinueEdit( pos ) )
{ {
m_drawItem->Draw( DrawPanel, DC, pos, -1, g_XorMode, NULL, DefaultTransform ); m_drawItem->Draw( m_canvas, DC, pos, -1, g_XorMode, NULL, DefaultTransform );
return; return;
} }
...@@ -262,8 +262,8 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC ) ...@@ -262,8 +262,8 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC )
TempCopyComponent(); TempCopyComponent();
m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) ); m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) );
DrawPanel->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn ); m_canvas->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
} }
...@@ -275,8 +275,8 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC ) ...@@ -275,8 +275,8 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC )
TempCopyComponent(); TempCopyComponent();
m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) ); m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) );
DrawPanel->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn ); m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
} }
...@@ -308,7 +308,7 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC ) ...@@ -308,7 +308,7 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
if( GetToolId() != ID_NO_TOOL_SELECTED ) if( GetToolId() != ID_NO_TOOL_SELECTED )
SetCursor( wxCURSOR_PENCIL ); SetCursor( wxCURSOR_PENCIL );
else else
SetCursor( DrawPanel->GetDefaultCursor() ); SetCursor( m_canvas->GetDefaultCursor() );
if( GetTempCopyComponent() ) // used when editing an existing item if( GetTempCopyComponent() ) // used when editing an existing item
SaveCopyInUndoList( GetTempCopyComponent() ); SaveCopyInUndoList( GetTempCopyComponent() );
...@@ -325,6 +325,6 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC ) ...@@ -325,6 +325,6 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
OnModify(); OnModify();
DrawPanel->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -57,7 +57,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol() ...@@ -57,7 +57,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) ) if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) )
return; return;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath(); wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath();
...@@ -69,8 +69,8 @@ void LIB_EDIT_FRAME::LoadOneSymbol() ...@@ -69,8 +69,8 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
return; return;
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) ); GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
wxFileName fn = dlg.GetPath(); wxFileName fn = dlg.GetPath();
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );
...@@ -126,7 +126,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol() ...@@ -126,7 +126,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
m_component->ClearSelectedItems(); m_component->ClearSelectedItems();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
delete Lib; delete Lib;
} }
...@@ -250,5 +250,5 @@ void LIB_EDIT_FRAME::PlaceAnchor() ...@@ -250,5 +250,5 @@ void LIB_EDIT_FRAME::PlaceAnchor()
/* Redraw the symbol */ /* Redraw the symbol */
RedrawScreen( wxPoint( 0 , 0 ), true ); RedrawScreen( wxPoint( 0 , 0 ), true );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -302,6 +302,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar() ...@@ -302,6 +302,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
KiBitmap( lines90_xpm ), KiBitmap( lines90_xpm ),
_( "HV orientation for wires and bus" ), _( "HV orientation for wires and bus" ),
wxITEM_CHECK ); wxITEM_CHECK );
// set icon paddings // set icon paddings
m_optionsToolBar->SetToolBorderPadding(2); // padding m_optionsToolBar->SetToolBorderPadding(2); // padding
m_optionsToolBar->SetToolSeparation(0); m_optionsToolBar->SetToolSeparation(0);
...@@ -313,7 +314,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar() ...@@ -313,7 +314,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
if( DrawPanel == NULL ) if( m_canvas == NULL )
return; return;
int id = event.GetId(); int id = event.GetId();
...@@ -322,7 +323,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -322,7 +323,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
case ID_TB_OPTIONS_HIDDEN_PINS: case ID_TB_OPTIONS_HIDDEN_PINS:
m_showAllPins = m_optionsToolBar->GetToolToggled( id ); m_showAllPins = m_optionsToolBar->GetToolToggled( id );
DrawPanel->Refresh( ); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_BUS_WIRES_ORIENT: case ID_TB_OPTIONS_BUS_WIRES_ORIENT:
......
...@@ -191,8 +191,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph ...@@ -191,8 +191,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
DisplayLibInfos(); DisplayLibInfos();
if( DrawPanel ) if( m_canvas )
DrawPanel->SetAcceleratorTable( table ); m_canvas->SetAcceleratorTable( table );
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
...@@ -227,7 +227,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph ...@@ -227,7 +227,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
Left().Row( 1 ) ); Left().Row( 1 ) );
// Manage the draw panel // Manage the draw panel
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).Centre() ); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).Centre() );
// Manage the message panel // Manage the message panel
...@@ -354,7 +354,7 @@ double LIB_VIEW_FRAME::BestZoom() ...@@ -354,7 +354,7 @@ double LIB_VIEW_FRAME::BestZoom()
return bestzoom; return bestzoom;
} }
wxSize size = DrawPanel->GetClientSize(); wxSize size = m_canvas->GetClientSize();
EDA_RECT BoundaryBox = component->GetBoundingBox( m_unit, m_convert ); EDA_RECT BoundaryBox = component->GetBoundingBox( m_unit, m_convert );
...@@ -407,7 +407,7 @@ void LIB_VIEW_FRAME::ReCreateListLib() ...@@ -407,7 +407,7 @@ void LIB_VIEW_FRAME::ReCreateListLib()
ReCreateListCmp(); ReCreateListCmp();
ReCreateHToolbar(); ReCreateHToolbar();
DisplayLibInfos(); DisplayLibInfos();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -462,7 +462,7 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event ) ...@@ -462,7 +462,7 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
m_libraryName = name; m_libraryName = name;
ReCreateListCmp(); ReCreateListCmp();
DrawPanel->Refresh(); m_canvas->Refresh();
DisplayLibInfos(); DisplayLibInfos();
ReCreateHToolbar(); ReCreateHToolbar();
} }
...@@ -485,7 +485,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event ) ...@@ -485,7 +485,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
m_convert = 1; m_convert = 1;
Zoom_Automatique( false ); Zoom_Automatique( false );
ReCreateHToolbar(); ReCreateHToolbar();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
} }
......
...@@ -59,14 +59,14 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -59,14 +59,14 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE );
m_convert = 1; m_convert = 1;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT: case ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT:
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true );
m_convert = 2; m_convert = 2;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_LIBVIEW_SELECT_PART_NUMBER: case ID_LIBVIEW_SELECT_PART_NUMBER:
...@@ -74,7 +74,7 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -74,7 +74,7 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( ii < 0 ) if( ii < 0 )
return; return;
m_unit = ii + 1; m_unit = ii + 1;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:
...@@ -135,7 +135,7 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary() ...@@ -135,7 +135,7 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary()
if( m_LibList ) if( m_LibList )
{ {
ReCreateListCmp(); ReCreateListCmp();
DrawPanel->Refresh(); m_canvas->Refresh();
DisplayLibInfos(); DisplayLibInfos();
ReCreateHToolbar(); ReCreateHToolbar();
int id = m_LibList->FindString( m_libraryName.GetData() ); int id = m_LibList->FindString( m_libraryName.GetData() );
...@@ -232,7 +232,7 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag ) ...@@ -232,7 +232,7 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
m_entryName = CmpName; m_entryName = CmpName;
DisplayLibInfos(); DisplayLibInfos();
Zoom_Automatique( false ); Zoom_Automatique( false );
DrawPanel->Refresh( ); m_canvas->Refresh( );
if( m_CmpList ) if( m_CmpList )
{ {
...@@ -269,7 +269,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -269,7 +269,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
component = entry->GetComponent(); component = entry->GetComponent();
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
if( !entry->IsRoot() ) if( !entry->IsRoot() )
{ {
...@@ -283,6 +283,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -283,6 +283,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( m_unit < 1 ) if( m_unit < 1 )
m_unit = 1; m_unit = 1;
if( m_convert < 1 ) if( m_convert < 1 )
m_convert = 1; m_convert = 1;
} }
...@@ -291,10 +292,10 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -291,10 +292,10 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
msg = _( "None" ); msg = _( "None" );
} }
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE );
/* Redraw the cursor */ /* Redraw the cursor */
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
if( !tmp.IsEmpty() ) if( !tmp.IsEmpty() )
component->SetName( tmp ); component->SetName( tmp );
......
...@@ -77,23 +77,23 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key ) ...@@ -77,23 +77,23 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC ) void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
{ {
wxASSERT( DrawPanel->IsMouseCaptured() ); wxASSERT( m_canvas->IsMouseCaptured() );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Move( DC ); Block_Move( DC );
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Duplicate( DC ); Block_Duplicate( DC );
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
...@@ -116,7 +116,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -116,7 +116,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
break; break;
} }
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
GetScreen()->SetModify(); GetScreen()->SetModify();
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
...@@ -131,7 +131,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -131,7 +131,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
bool nextcmd = false; bool nextcmd = false;
bool zoom_command = false; bool zoom_command = false;
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
...@@ -139,14 +139,14 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -139,14 +139,14 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
nextcmd = true; nextcmd = true;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Delete( DC ); Block_Delete( DC );
break; break;
...@@ -172,7 +172,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -172,7 +172,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
if( ! nextcmd ) if( ! nextcmd )
{ {
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
} }
...@@ -257,10 +257,10 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC ) ...@@ -257,10 +257,10 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
wxPoint oldpos; wxPoint oldpos;
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->SetCrossHairPosition( oldpos ); GetScreen()->SetCrossHairPosition( oldpos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
GetScreen()->SetModify(); GetScreen()->SetModify();
GetScreen()->m_BlockLocate.Normalize(); GetScreen()->m_BlockLocate.Normalize();
...@@ -276,7 +276,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC ) ...@@ -276,7 +276,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
gerb_item->MoveAB( delta ); gerb_item->MoveAB( delta );
} }
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
...@@ -286,10 +286,10 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC ) ...@@ -286,10 +286,10 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
wxPoint oldpos; wxPoint oldpos;
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->SetCrossHairPosition( oldpos ); GetScreen()->SetCrossHairPosition( oldpos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
GetScreen()->SetModify(); GetScreen()->SetModify();
GetScreen()->m_BlockLocate.Normalize(); GetScreen()->m_BlockLocate.Normalize();
...@@ -297,9 +297,11 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC ) ...@@ -297,9 +297,11 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
/* Copy items in block */ /* Copy items in block */
BOARD_ITEM* item = GetBoard()->m_Drawings; BOARD_ITEM* item = GetBoard()->m_Drawings;
for( ; item; item = item->Next() ) for( ; item; item = item->Next() )
{ {
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item; GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) ) if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) )
{ {
/* this item must be duplicated */ /* this item must be duplicated */
...@@ -309,5 +311,5 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC ) ...@@ -309,5 +311,5 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
} }
} }
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -176,7 +176,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) ...@@ -176,7 +176,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
} }
myframe->GetBoard()->SetVisibleLayers( visibleLayers ); myframe->GetBoard()->SetVisibleLayers( visibleLayers );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
break; break;
} }
} }
...@@ -188,6 +188,7 @@ void GERBER_LAYER_WIDGET::ReFill() ...@@ -188,6 +188,7 @@ void GERBER_LAYER_WIDGET::ReFill()
BOARD* brd = myframe->GetBoard(); BOARD* brd = myframe->GetBoard();
int layer; int layer;
ClearLayerRows(); ClearLayerRows();
for( layer = 0; layer < LAYER_COUNT; layer++ ) for( layer = 0; layer < LAYER_COUNT; layer++ )
{ {
wxString msg; wxString msg;
...@@ -205,7 +206,7 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor ) ...@@ -205,7 +206,7 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
{ {
myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->GetBoard()->SetLayerColor( aLayer, aColor );
myframe->m_SelLayerBox->ResyncBitmapOnly(); myframe->m_SelLayerBox->ResyncBitmapOnly();
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer ) bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
...@@ -215,8 +216,9 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer ) ...@@ -215,8 +216,9 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
int layer = myframe->getActiveLayer( ); int layer = myframe->getActiveLayer( );
myframe->setActiveLayer( aLayer, false ); myframe->setActiveLayer( aLayer, false );
myframe->syncLayerBox(); myframe->syncLayerBox();
if( layer != myframe->getActiveLayer( ) ) if( layer != myframe->getActiveLayer( ) )
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
return true; return true;
} }
...@@ -234,13 +236,13 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin ...@@ -234,13 +236,13 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin
brd->SetVisibleLayers( visibleLayers ); brd->SetVisibleLayers( visibleLayers );
if( isFinal ) if( isFinal )
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor ) void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
{ {
myframe->GetBoard()->SetVisibleElementColor( aId, aColor ); myframe->GetBoard()->SetVisibleElementColor( aId, aColor );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
...@@ -248,7 +250,7 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) ...@@ -248,7 +250,7 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
BOARD* brd = myframe->GetBoard(); BOARD* brd = myframe->GetBoard();
brd->SetElementVisibility( aId, isEnabled ); brd->SetElementVisibility( aId, isEnabled );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
//-----</LAYER_WIDGET callbacks>------------------------------------------ //-----</LAYER_WIDGET callbacks>------------------------------------------
......
...@@ -24,25 +24,25 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -24,25 +24,25 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
...@@ -55,13 +55,13 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -55,13 +55,13 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = GetScreen()->GetCrossHairPosition(); pos = GetScreen()->GetCrossHairPosition();
GetScreen()->SetCrossHairPosition( oldpos ); GetScreen()->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( pos ); GetScreen()->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
} }
} }
......
...@@ -37,8 +37,9 @@ void GERBVIEW_FRAME::InstallGerberOptionsDialog( wxCommandEvent& event ) ...@@ -37,8 +37,9 @@ void GERBVIEW_FRAME::InstallGerberOptionsDialog( wxCommandEvent& event )
{ {
DIALOG_DISPLAY_OPTIONS dlg( this ); DIALOG_DISPLAY_OPTIONS dlg( this );
int opt = dlg.ShowModal(); int opt = dlg.ShowModal();
if (opt > 0 ) if (opt > 0 )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) : DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) :
......
...@@ -56,11 +56,11 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer, ...@@ -56,11 +56,11 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer,
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
g_DisplayPolygonsModeSketch = 0; g_DisplayPolygonsModeSketch = 0;
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode; m_canvas->m_PrintIsMirrored = aPrintMirrorMode;
GetBoard()->Draw( DrawPanel, aDC, -1, wxPoint( 0, 0 ) ); GetBoard()->Draw( m_canvas, aDC, -1, wxPoint( 0, 0 ) );
DrawPanel->m_PrintIsMirrored = false; m_canvas->m_PrintIsMirrored = false;
// Restore draw options: // Restore draw options:
GetBoard()->SetVisibleLayers( visiblemask ); GetBoard()->SetVisibleLayers( visiblemask );
...@@ -96,22 +96,22 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -96,22 +96,22 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
// Draw according to the current setting. This needs to be GR_COPY or GR_OR. // Draw according to the current setting. This needs to be GR_COPY or GR_OR.
GetBoard()->Draw( DrawPanel, DC, drawMode, wxPoint( 0, 0 ) ); GetBoard()->Draw( m_canvas, DC, drawMode, wxPoint( 0, 0 ) );
// Draw the "background" now, i.e. grid and axis after gerber layers // Draw the "background" now, i.e. grid and axis after gerber layers
// because most of time the actual background is erased by successive drawings of each gerber // because most of time the actual background is erased by successive drawings of each gerber
// layer mainly in COPY mode // layer mainly in COPY mode
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
if( IsElementVisible( DCODES_VISIBLE ) ) if( IsElementVisible( DCODES_VISIBLE ) )
DrawItemsDCodeID( DC, GR_COPY ); DrawItemsDCodeID( DC, GR_COPY );
TraceWorkSheet( DC, screen, 0 ); TraceWorkSheet( DC, screen, 0 );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
// Display the filename and the layer name (found in the gerber files, if any) // Display the filename and the layer name (found in the gerber files, if any)
// relative to the active layer // relative to the active layer
...@@ -406,7 +406,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) ...@@ -406,7 +406,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode )
int color = g_ColorsSettings.GetItemColor( DCODES_VISIBLE ); int color = g_ColorsSettings.GetItemColor( DCODES_VISIBLE );
DrawGraphicText( DrawPanel, aDC, pos, (EDA_Colors) color, Line, DrawGraphicText( m_canvas, aDC, pos, (EDA_Colors) color, Line,
orient, wxSize( width, width ), orient, wxSize( width, width ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
0, false, false ); 0, false, false );
......
...@@ -127,7 +127,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -127,7 +127,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE ) if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
{ {
...@@ -138,26 +138,28 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -138,26 +138,28 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
} }
if( GetToolId() == ID_NO_TOOL_SELECTED ) if( GetToolId() == ID_NO_TOOL_SELECTED )
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
else else
DrawPanel->SetCursor( DrawPanel->GetCurrentCursor() ); m_canvas->SetCursor( m_canvas->GetCurrentCursor() );
break; break;
default: default:
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
break; break;
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( id ) switch( id )
{ {
case ID_GERBVIEW_SET_PAGE_BORDER: case ID_GERBVIEW_SET_PAGE_BORDER:
{ {
DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this ); DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this );
if (dlg.ShowModal() == wxID_OK ) if (dlg.ShowModal() == wxID_OK )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
break; break;
case ID_GERBVIEW_GLOBAL_DELETE: case ID_GERBVIEW_GLOBAL_DELETE:
...@@ -166,11 +168,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -166,11 +168,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_NO_TOOL_SELECTED: case ID_NO_TOOL_SELECTED:
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_POPUP_CLOSE_CURRENT_TOOL: case ID_POPUP_CLOSE_CURRENT_TOOL:
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
...@@ -182,7 +184,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -182,7 +184,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PLACE_BLOCK: case ID_POPUP_PLACE_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE; GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
DrawPanel->m_AutoPAN_Request = FALSE; m_canvas->m_AutoPAN_Request = FALSE;
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
...@@ -211,13 +213,15 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -211,13 +213,15 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event ) void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event )
{ {
GERBER_IMAGE* gerber_image = g_GERBER_List[getActiveLayer()]; GERBER_IMAGE* gerber_image = g_GERBER_List[getActiveLayer()];
if( gerber_image ) if( gerber_image )
{ {
int tool = m_DCodeSelector->GetSelectedDCodeId(); int tool = m_DCodeSelector->GetSelectedDCodeId();
if( tool != gerber_image->m_Selected_Tool ) if( tool != gerber_image->m_Selected_Tool )
{ {
gerber_image->m_Selected_Tool = tool; gerber_image->m_Selected_Tool = tool;
DrawPanel->Refresh(); m_canvas->Refresh();
} }
} }
} }
...@@ -231,8 +235,9 @@ void GERBVIEW_FRAME::OnSelectActiveLayer( wxCommandEvent& event ) ...@@ -231,8 +235,9 @@ void GERBVIEW_FRAME::OnSelectActiveLayer( wxCommandEvent& event )
int layer = getActiveLayer(); int layer = getActiveLayer();
setActiveLayer( event.GetSelection() ); setActiveLayer( event.GetSelection() );
if( layer != getActiveLayer() ) if( layer != getActiveLayer() )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -283,7 +288,7 @@ void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event ) ...@@ -283,7 +288,7 @@ void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
} }
if( GetDisplayMode() != oldMode ) if( GetDisplayMode() != oldMode )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event ) void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event )
......
...@@ -56,18 +56,18 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event ) ...@@ -56,18 +56,18 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
case ID_GERBVIEW_ERASE_ALL: case ID_GERBVIEW_ERASE_ALL:
Clear_Pcb( true ); Clear_Pcb( true );
Zoom_Automatique( false ); Zoom_Automatique( false );
DrawPanel->Refresh(); m_canvas->Refresh();
ClearMsgPanel(); ClearMsgPanel();
break; break;
case ID_GERBVIEW_LOAD_DRILL_FILE: case ID_GERBVIEW_LOAD_DRILL_FILE:
LoadExcellonFiles( wxEmptyString ); LoadExcellonFiles( wxEmptyString );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_GERBVIEW_LOAD_DCODE_FILE: case ID_GERBVIEW_LOAD_DCODE_FILE:
LoadDCodeFile( wxEmptyString ); LoadDCodeFile( wxEmptyString );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:
......
...@@ -75,8 +75,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father, ...@@ -75,8 +75,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_displayMode = 0; m_displayMode = 0;
m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 ); m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 );
if( DrawPanel ) if( m_canvas )
DrawPanel->m_Block_Enable = true; m_canvas->m_Block_Enable = true;
// Give an icon // Give an icon
wxIcon icon; wxIcon icon;
...@@ -98,7 +98,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father, ...@@ -98,7 +98,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
if( screenHeight <= 900 ) if( screenHeight <= 900 )
pointSize = (pointSize * 8) / 10; pointSize = (pointSize * 8) / 10;
m_LayersManager = new GERBER_LAYER_WIDGET( this, DrawPanel, pointSize ); m_LayersManager = new GERBER_LAYER_WIDGET( this, m_canvas, pointSize );
// LoadSettings() *after* creating m_LayersManager, because LoadSettings() // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
// initialize parameters in m_LayersManager // initialize parameters in m_LayersManager
...@@ -143,8 +143,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father, ...@@ -143,8 +143,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_auimgr.AddPane( m_optionsToolBar, m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() ); wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
if( DrawPanel ) if( m_canvas )
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
if( m_messagePanel ) if( m_messagePanel )
...@@ -187,7 +187,7 @@ double GERBVIEW_FRAME::BestZoom() ...@@ -187,7 +187,7 @@ double GERBVIEW_FRAME::BestZoom()
bbox.Merge( gerb_item->GetBoundingBox() ); bbox.Merge( gerb_item->GetBoundingBox() );
} }
wxSize size = DrawPanel->GetClientSize(); wxSize size = m_canvas->GetClientSize();
double x = (double) bbox.GetWidth() / (double) size.x; double x = (double) bbox.GetWidth() / (double) size.x;
double y = (double) bbox.GetHeight() / (double) size.y; double y = (double) bbox.GetHeight() / (double) size.y;
......
...@@ -136,15 +136,16 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ) ...@@ -136,15 +136,16 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
break; break;
case HK_SWITCH_GBR_ITEMS_DISPLAY_MODE: case HK_SWITCH_GBR_ITEMS_DISPLAY_MODE:
DisplayOpt.DisplayPcbTrackFill ^= 1; DisplayOpt.DisplayPcbTrackFill &= 1; DisplayOpt.DisplayPcbTrackFill ^= 1;
DrawPanel->Refresh(); DisplayOpt.DisplayPcbTrackFill &= 1;
m_canvas->Refresh();
break; break;
case HK_SWITCH_LAYER_TO_PREVIOUS: case HK_SWITCH_LAYER_TO_PREVIOUS:
if( getActiveLayer() > 0 ) if( getActiveLayer() > 0 )
{ {
setActiveLayer( getActiveLayer() - 1 ); setActiveLayer( getActiveLayer() - 1 );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
break; break;
...@@ -152,7 +153,7 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ) ...@@ -152,7 +153,7 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
if( getActiveLayer() < 31 ) if( getActiveLayer() < 31 )
{ {
setActiveLayer( getActiveLayer() + 1 ); setActiveLayer( getActiveLayer() + 1 );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
break; break;
} }
......
...@@ -110,7 +110,7 @@ void GERBVIEW_FRAME::Erase_Current_Layer( bool query ) ...@@ -110,7 +110,7 @@ void GERBVIEW_FRAME::Erase_Current_Layer( bool query )
} }
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->Refresh(); m_canvas->Refresh();
m_LayersManager->UpdateLayerIcons(); m_LayersManager->UpdateLayerIcons();
syncLayerBox(); syncLayerBox();
} }
...@@ -20,7 +20,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -20,7 +20,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
// Do not initiate a start block validation on menu. // Do not initiate a start block validation on menu.
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
// Simple location of elements where possible. // Simple location of elements where possible.
if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) ) if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) )
......
...@@ -43,7 +43,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -43,7 +43,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
DisplayOpt.DisplayPadFill = m_DisplayPadFill = true; DisplayOpt.DisplayPadFill = m_DisplayPadFill = true;
} }
DrawPanel->Refresh( true );
m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_LINES_SKETCH: case ID_TB_OPTIONS_SHOW_LINES_SKETCH:
...@@ -57,7 +58,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -57,7 +58,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
m_DisplayPcbTrackFill = true; m_DisplayPcbTrackFill = true;
DisplayOpt.DisplayPcbTrackFill = true; DisplayOpt.DisplayPcbTrackFill = true;
} }
DrawPanel->Refresh( true );
m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH: case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH:
...@@ -65,12 +67,13 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -65,12 +67,13 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
g_DisplayPolygonsModeSketch = 1; g_DisplayPolygonsModeSketch = 1;
else else
g_DisplayPolygonsModeSketch = 0; g_DisplayPolygonsModeSketch = 0;
DrawPanel->Refresh( true );
m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_DCODES: case ID_TB_OPTIONS_SHOW_DCODES:
SetElementVisibility( DCODES_VISIBLE, state ); SetElementVisibility( DCODES_VISIBLE, state );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR: case ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR:
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/** /**
* @file class_drawpanel.h: * @file class_drawpanel.h:
* @brief EDA_DRAW_PANEL class definition. * @brief EDA_DRAW_PANEL class definition.
...@@ -34,14 +59,13 @@ private: ...@@ -34,14 +59,13 @@ private:
int m_defaultCursor; ///< The default mouse cursor shape id. int m_defaultCursor; ///< The default mouse cursor shape id.
bool m_showCrossHair; ///< Indicate if cross hair is to be shown. bool m_showCrossHair; ///< Indicate if cross hair is to be shown.
int m_cursorLevel; ///< Index for cursor redraw in XOR mode. int m_cursorLevel; ///< Index for cursor redraw in XOR mode.
int m_scrollIncrementX; ///< X axis scroll increment in pixels per unit.
int m_scrollIncrementY; ///< Y axis scroll increment in pixels per unit.
wxPoint m_CursorStartPos; ///< Used for testing the cursor movement.
public: public:
EDA_RECT m_ClipBox; // the clipbox used in screen redraw (usually gives the EDA_RECT m_ClipBox; // the clipbox used in screen redraw (usually gives the
// visible area in internal units) // visible area in internal units)
wxPoint m_CursorStartPos; // useful in testing the cursor movement
int m_scrollIncrementX; // X axis scroll increment in pixels per unit.
int m_scrollIncrementY; // Y axis scroll increment in pixels per unit.
bool m_AbortRequest; // Flag to abort long commands bool m_AbortRequest; // Flag to abort long commands
bool m_AbortEnable; // true if abort button or menu to be displayed bool m_AbortEnable; // true if abort button or menu to be displayed
......
...@@ -366,22 +366,22 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME ...@@ -366,22 +366,22 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
///< Id of active button on the vertical toolbar. ///< Id of active button on the vertical toolbar.
int m_toolId; int m_toolId;
public:
EDA_DRAW_PANEL* DrawPanel; // Draw area
protected: protected:
EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList; EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList;
int m_LastGridSizeId; int m_LastGridSizeId;
bool m_DrawGrid; // hide/Show grid bool m_DrawGrid; // hide/Show grid
int m_GridColor; // Grid color int m_GridColor; // Grid color
/// The area to draw on.
EDA_DRAW_PANEL* m_canvas;
/// Internal units count that is equivalent to 1 inch. Set to 1000 (0.001") for /// Internal units count that is equivalent to 1 inch. Set to 1000 (0.001") for
/// schematic drawing and 10000 (0.0001") for PCB drawing. /// schematic drawing and 10000 (0.0001") for PCB drawing.
int m_internalUnits; int m_internalUnits;
/// Tool ID of previously active draw tool bar button. /// Tool ID of previously active draw tool bar button.
int m_lastDrawToolId; int m_lastDrawToolId;
// on the vertical toolbar
/// The shape of the KiCad cursor. The default value (0) is the normal cross /// The shape of the KiCad cursor. The default value (0) is the normal cross
/// hair cursor. Set to non-zero value to draw the full screen cursor. /// hair cursor. Set to non-zero value to draw the full screen cursor.
/// @note This is not the system mouse cursor. /// @note This is not the system mouse cursor.
...@@ -463,6 +463,8 @@ public: ...@@ -463,6 +463,8 @@ public:
int GetInternalUnits() const { return m_internalUnits; } int GetInternalUnits() const { return m_internalUnits; }
EDA_DRAW_PANEL* GetCanvas() { return m_canvas; }
virtual wxString GetScreenDesc(); virtual wxString GetScreenDesc();
/** /**
......
...@@ -51,10 +51,10 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -51,10 +51,10 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
return; return;
OnModify(); OnModify();
DrawPanel->CrossHairOff( DC ); // Erase cursor shape m_canvas->CrossHairOff( DC ); // Erase cursor shape
track->SetState( TRACK_LOCKED, Flag_On ); track->SetState( TRACK_LOCKED, Flag_On );
track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); track->Draw( m_canvas, DC, GR_OR | GR_HIGHLIGHT );
DrawPanel->CrossHairOn( DC ); // Display cursor shape m_canvas->CrossHairOn( DC ); // Display cursor shape
track->DisplayInfo( this ); track->DisplayInfo( this );
} }
...@@ -68,9 +68,9 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -68,9 +68,9 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
if( (track == NULL ) || (track->Type() == PCB_ZONE_T) ) if( (track == NULL ) || (track->Type() == PCB_ZONE_T) )
return; return;
DrawPanel->CrossHairOff( DC ); // Erase cursor shape m_canvas->CrossHairOff( DC ); // Erase cursor shape
Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true ); Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true );
DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT ); DrawTraces( m_canvas, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT );
for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- ) for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
{ {
...@@ -79,7 +79,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -79,7 +79,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
Track = Track->Next(); Track = Track->Next();
} }
DrawPanel->CrossHairOn( DC ); // Display cursor shape m_canvas->CrossHairOn( DC ); // Display cursor shape
OnModify(); OnModify();
} }
...@@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) ...@@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
} }
} }
DrawPanel->CrossHairOff( DC ); // Erase cursor shape m_canvas->CrossHairOff( DC ); // Erase cursor shape
while( Track ) /* Flag change */ while( Track ) /* Flag change */
{ {
...@@ -112,10 +112,10 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) ...@@ -112,10 +112,10 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
OnModify(); OnModify();
Track->SetState( TRACK_LOCKED, Flag_On ); Track->SetState( TRACK_LOCKED, Flag_On );
Track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); Track->Draw( m_canvas, DC, GR_OR | GR_HIGHLIGHT );
Track = Track->Next(); Track = Track->Next();
} }
DrawPanel->CrossHairOn( DC ); // Display cursor shape m_canvas->CrossHairOn( DC ); // Display cursor shape
OnModify(); OnModify();
} }
...@@ -69,7 +69,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) ...@@ -69,7 +69,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
if( m_mainToolBar == NULL ) if( m_mainToolBar == NULL )
return; return;
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( id ) switch( id )
{ {
...@@ -93,15 +93,15 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) ...@@ -93,15 +93,15 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
return; return;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_endMouseCaptureCallback( DrawPanel, &dc ); m_canvas->m_endMouseCaptureCallback( m_canvas, &dc );
} }
break; break;
default: // Abort a current command (if any) default: // Abort a current command (if any)
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
break; break;
} }
...@@ -293,7 +293,7 @@ void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) ...@@ -293,7 +293,7 @@ void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
if( newList.GetCount() ) if( newList.GetCount() )
SaveCopyInUndoList( newList, UR_CHANGED ); SaveCopyInUndoList( newList, UR_CHANGED );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
......
...@@ -117,8 +117,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ) ...@@ -117,8 +117,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
if( GetBoard()->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
return; return;
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
DrawPanel->m_AbortEnable = true; m_canvas->m_AbortEnable = true;
switch( place_mode ) switch( place_mode )
{ {
...@@ -247,7 +247,7 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ) ...@@ -247,7 +247,7 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen
{ {
NbModules++; NbModules++;
Module->Draw( DrawPanel, DC, GR_XOR ); Module->Draw( m_canvas, DC, GR_XOR );
} }
else else
{ {
...@@ -390,8 +390,8 @@ end_of_tst: ...@@ -390,8 +390,8 @@ end_of_tst:
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
Compile_Ratsnest( DC, true ); Compile_Ratsnest( DC, true );
DrawPanel->ReDraw( DC, true ); m_canvas->ReDraw( DC, true );
DrawPanel->m_AbortEnable = false; m_canvas->m_AbortEnable = false;
} }
...@@ -431,7 +431,7 @@ void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC ) ...@@ -431,7 +431,7 @@ void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC )
color = DARKGRAY; color = DARKGRAY;
} }
GRPutPixel( &DrawPanel->m_ClipBox, DC, ox, oy, color ); GRPutPixel( &m_canvas->m_ClipBox, DC, ox, oy, color );
} }
} }
} }
...@@ -680,7 +680,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) ...@@ -680,7 +680,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
} }
} }
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
mincout = -1.0; mincout = -1.0;
SetStatusText( wxT( "Score ??, pos ??" ) ); SetStatusText( wxT( "Score ??, pos ??" ) );
...@@ -690,19 +690,19 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) ...@@ -690,19 +690,19 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
{ {
wxYield(); wxYield();
if( DrawPanel->m_AbortRequest ) if( m_canvas->m_AbortRequest )
{ {
if( IsOK( this, _( "Ok to abort?" ) ) ) if( IsOK( this, _( "Ok to abort?" ) ) )
return ESC; return ESC;
else else
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
} }
cx = aModule->m_Pos.x; cy = aModule->m_Pos.y; cx = aModule->m_Pos.x; cy = aModule->m_Pos.y;
aModule->m_BoundaryBox.SetX( ox + CurrPosition.x ); aModule->m_BoundaryBox.SetX( ox + CurrPosition.x );
aModule->m_BoundaryBox.SetY( oy + CurrPosition.y ); aModule->m_BoundaryBox.SetY( oy + CurrPosition.y );
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
g_Offset_Module.x = cx - CurrPosition.x; g_Offset_Module.x = cx - CurrPosition.x;
CurrPosition.y = bbbox.GetY() - oy; CurrPosition.y = bbbox.GetY() - oy;
...@@ -710,13 +710,13 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) ...@@ -710,13 +710,13 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
/* Placement on grid. */ /* Placement on grid. */
CurrPosition.y -= CurrPosition.y % Board.m_GridRouting; CurrPosition.y -= CurrPosition.y % Board.m_GridRouting;
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
for( ; CurrPosition.y < bbbox.GetBottom() - fy; for( ; CurrPosition.y < bbbox.GetBottom() - fy;
CurrPosition.y += Board.m_GridRouting ) CurrPosition.y += Board.m_GridRouting )
{ {
/* Erase traces. */ /* Erase traces. */
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
if( showRat ) if( showRat )
Compute_Ratsnest_PlaceModule( aDC ); Compute_Ratsnest_PlaceModule( aDC );
...@@ -726,7 +726,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) ...@@ -726,7 +726,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
aModule->m_BoundaryBox.SetY( oy + CurrPosition.y ); aModule->m_BoundaryBox.SetY( oy + CurrPosition.y );
g_Offset_Module.y = cy - CurrPosition.y; g_Offset_Module.y = cy - CurrPosition.y;
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
keepOut = TstModuleOnBoard( GetBoard(), aModule, TstOtherSide ); keepOut = TstModuleOnBoard( GetBoard(), aModule, TstOtherSide );
if( keepOut >= 0 ) /* c a d if the module can be placed. */ if( keepOut >= 0 ) /* c a d if the module can be placed. */
...@@ -757,7 +757,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) ...@@ -757,7 +757,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
} }
} }
DrawModuleOutlines( DrawPanel, aDC, aModule ); /* erasing the last traces */ DrawModuleOutlines( m_canvas, aDC, aModule ); /* erasing the last traces */
if( showRat ) if( showRat )
Compute_Ratsnest_PlaceModule( aDC ); Compute_Ratsnest_PlaceModule( aDC );
...@@ -956,7 +956,7 @@ float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC ) ...@@ -956,7 +956,7 @@ float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC )
if( AutoPlaceShowAll ) if( AutoPlaceShowAll )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, ox, oy, fx, fy, 0, color ); GRLine( &m_canvas->m_ClipBox, DC, ox, oy, fx, fy, 0, color );
} }
/* Cost of the ratsnest. */ /* Cost of the ratsnest. */
......
...@@ -173,7 +173,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode ) ...@@ -173,7 +173,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
/* Construction of the track list for router. */ /* Construction of the track list for router. */
Build_Work( GetBoard() ); Build_Work( GetBoard() );
// DisplayBoard(DrawPanel, DC); // DisplayBoard(m_canvas, DC);
if( Nb_Sides == TWO_SIDES ) if( Nb_Sides == TWO_SIDES )
Solve( DC, TWO_SIDES ); /* double face */ Solve( DC, TWO_SIDES ); /* double face */
......
...@@ -175,7 +175,7 @@ double PCB_BASE_FRAME::BestZoom( void ) ...@@ -175,7 +175,7 @@ double PCB_BASE_FRAME::BestZoom( void )
dx = bbbox.GetWidth(); dx = bbbox.GetWidth();
dy = bbbox.GetHeight(); dy = bbbox.GetHeight();
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
if( size.x ) if( size.x )
ii = (double)(dx + ( size.x / 2) ) / (double) size.x; ii = (double)(dx + ( size.x / 2) ) / (double) size.x;
...@@ -201,10 +201,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos ) ...@@ -201,10 +201,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
wxClientDC dc( DrawPanel ); wxClientDC dc( m_canvas );
/* There may be need to reframe the drawing. */ /* There may be need to reframe the drawing. */
if( !DrawPanel->IsPointOnDisplay( aPos ) ) if( !m_canvas->IsPointOnDisplay( aPos ) )
{ {
screen->SetCrossHairPosition( aPos ); screen->SetCrossHairPosition( aPos );
RedrawScreen( aPos, true ); RedrawScreen( aPos, true );
...@@ -212,10 +212,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos ) ...@@ -212,10 +212,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
else else
{ {
// Put cursor on item position // Put cursor on item position
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
screen->SetCrossHairPosition( aPos ); screen->SetCrossHairPosition( aPos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
} }
...@@ -278,7 +278,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, int layer ) ...@@ -278,7 +278,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, int layer )
GetScreen()->m_Active_Layer = layer; GetScreen()->m_Active_Layer = layer;
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -293,7 +293,7 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent ) ...@@ -293,7 +293,7 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent )
void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
{ {
m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill; m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill;
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -371,7 +371,7 @@ void PCB_BASE_FRAME::ProcessItemSelection( wxCommandEvent& aEvent ) ...@@ -371,7 +371,7 @@ void PCB_BASE_FRAME::ProcessItemSelection( wxCommandEvent& aEvent )
if( id >= ID_POPUP_PCB_ITEM_SELECTION_START && id <= ID_POPUP_PCB_ITEM_SELECTION_END ) if( id >= ID_POPUP_PCB_ITEM_SELECTION_START && id <= ID_POPUP_PCB_ITEM_SELECTION_END )
{ {
BOARD_ITEM* item = (*m_Collector)[itemNdx]; BOARD_ITEM* item = (*m_Collector)[itemNdx];
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
#if 0 && defined (DEBUG) #if 0 && defined (DEBUG)
item->Show( 0, std::cout ); item->Show( 0, std::cout );
...@@ -455,8 +455,8 @@ void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg ) ...@@ -455,8 +455,8 @@ void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
// must do this after the tool has been set, otherwise pad::Draw() does // must do this after the tool has been set, otherwise pad::Draw() does
// not show proper color when DisplayOpt.ContrastModeDisplay is true. // not show proper color when DisplayOpt.ContrastModeDisplay is true.
if( redraw && DrawPanel) if( redraw && m_canvas)
DrawPanel->Refresh(); m_canvas->Refresh();
} }
......
...@@ -121,15 +121,15 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title ...@@ -121,15 +121,15 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title
{ {
wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition(); wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition();
parent->DrawPanel->m_IgnoreMouseEvents = true; parent->GetCanvas()->m_IgnoreMouseEvents = true;
DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title ); DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title );
int cmd = dlg->ShowModal(); int cmd = dlg->ShowModal();
dlg->Destroy(); dlg->Destroy();
parent->GetScreen()->SetCrossHairPosition( oldpos ); parent->GetScreen()->SetCrossHairPosition( oldpos );
parent->DrawPanel->MoveCursorToCrossHair(); parent->GetCanvas()->MoveCursorToCrossHair();
parent->DrawPanel->m_IgnoreMouseEvents = false; parent->GetCanvas()->m_IgnoreMouseEvents = false;
return cmd == wxID_OK; return cmd == wxID_OK;
} }
...@@ -219,7 +219,7 @@ int PCB_EDIT_FRAME::ReturnBlockCommand( int aKey ) ...@@ -219,7 +219,7 @@ int PCB_EDIT_FRAME::ReturnBlockCommand( int aKey )
void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) ); DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
} }
...@@ -234,16 +234,16 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -234,16 +234,16 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_DRAG: /* Drag */ case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Move(); Block_Move();
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Duplicate(); Block_Duplicate();
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
...@@ -259,7 +259,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -259,7 +259,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
OnModify(); OnModify();
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
if( GetScreen()->m_BlockLocate.GetCount() ) if( GetScreen()->m_BlockLocate.GetCount() )
...@@ -278,7 +278,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -278,7 +278,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
// If coming here after cancel block, clean up and exit // If coming here after cancel block, clean up and exit
if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK )
{ {
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
return false; return false;
...@@ -293,11 +293,11 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -293,11 +293,11 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
cancelCmd = true; cancelCmd = true;
// undraw block outline // undraw block outline
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
else else
{ {
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false ); DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
Block_SelectItems(); Block_SelectItems();
// Exit if no items found // Exit if no items found
...@@ -306,7 +306,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -306,7 +306,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
} }
} }
if( !cancelCmd && DrawPanel->IsMouseCaptured() ) if( !cancelCmd && m_canvas->IsMouseCaptured() )
{ {
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
...@@ -320,24 +320,24 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -320,24 +320,24 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
nextcmd = true; nextcmd = true;
DrawPanel->m_mouseCaptureCallback = drawMovingBlock; m_canvas->m_mouseCaptureCallback = drawMovingBlock;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Delete(); Block_Delete();
break; break;
case BLOCK_ROTATE: /* Rotation */ case BLOCK_ROTATE: /* Rotation */
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Rotate(); Block_Rotate();
break; break;
case BLOCK_FLIP: /* Flip */ case BLOCK_FLIP: /* Flip */
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Flip(); Block_Flip();
break; break;
...@@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
// Turn off the redraw block routine now so it is not displayed // Turn off the redraw block routine now so it is not displayed
// with one corner at the new center of the screen // with one corner at the new center of the screen
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
Window_Zoom( GetScreen()->m_BlockLocate ); Window_Zoom( GetScreen()->m_BlockLocate );
break; break;
...@@ -369,7 +369,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -369,7 +369,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if( ! nextcmd ) if( ! nextcmd )
{ {
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
} }
...@@ -647,7 +647,7 @@ void PCB_EDIT_FRAME::Block_Delete() ...@@ -647,7 +647,7 @@ void PCB_EDIT_FRAME::Block_Delete()
SaveCopyInUndoList( *itemsList, UR_DELETED ); SaveCopyInUndoList( *itemsList, UR_DELETED );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
...@@ -707,7 +707,7 @@ void PCB_EDIT_FRAME::Block_Rotate() ...@@ -707,7 +707,7 @@ void PCB_EDIT_FRAME::Block_Rotate()
SaveCopyInUndoList( *itemsList, UR_ROTATED, centre ); SaveCopyInUndoList( *itemsList, UR_ROTATED, centre );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
...@@ -768,7 +768,7 @@ void PCB_EDIT_FRAME::Block_Flip() ...@@ -768,7 +768,7 @@ void PCB_EDIT_FRAME::Block_Flip()
SaveCopyInUndoList( *itemsList, UR_FLIPPED, center ); SaveCopyInUndoList( *itemsList, UR_FLIPPED, center );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
...@@ -822,7 +822,7 @@ void PCB_EDIT_FRAME::Block_Move() ...@@ -822,7 +822,7 @@ void PCB_EDIT_FRAME::Block_Move()
SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector ); SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
...@@ -937,5 +937,5 @@ void PCB_EDIT_FRAME::Block_Duplicate() ...@@ -937,5 +937,5 @@ void PCB_EDIT_FRAME::Block_Duplicate()
SaveCopyInUndoList( newList, UR_NEW ); SaveCopyInUndoList( newList, UR_NEW );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
This diff is collapsed.
...@@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event ) ...@@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event )
GetScreen()->PushCommandToRedoList( List ); GetScreen()->PushCommandToRedoList( List );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
...@@ -690,7 +690,7 @@ void PCB_EDIT_FRAME::GetBoardFromRedoList( wxCommandEvent& event ) ...@@ -690,7 +690,7 @@ void PCB_EDIT_FRAME::GetBoardFromRedoList( wxCommandEvent& event )
GetScreen()->PushCommandToUndoList( List ); GetScreen()->PushCommandToUndoList( List );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
......
This diff is collapsed.
...@@ -451,7 +451,7 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos ) ...@@ -451,7 +451,7 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
if( GetBoard() && GetBoard()->m_PcbFrame ) if( GetBoard() && GetBoard()->m_PcbFrame )
{ {
// Use grid size because it is known // Use grid size because it is known
wxRealPoint grid = GetBoard()->m_PcbFrame->DrawPanel->GetGrid(); wxRealPoint grid = GetBoard()->m_PcbFrame->GetCanvas()->GetGrid();
min_dist = wxRound( MIN( grid.x, grid.y ) ); min_dist = wxRound( MIN( grid.x, grid.y ) );
} }
#endif #endif
...@@ -497,7 +497,7 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos ) ...@@ -497,7 +497,7 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
if( GetBoard() && GetBoard()->m_PcbFrame ) if( GetBoard() && GetBoard()->m_PcbFrame )
{ {
// Use grid size because it is known // Use grid size because it is known
wxRealPoint grid = GetBoard()->m_PcbFrame->DrawPanel->GetGrid(); wxRealPoint grid = GetBoard()->m_PcbFrame->GetCanvas()->GetGrid();
min_dist = wxRound( MIN( grid.x, grid.y ) ); min_dist = wxRound( MIN( grid.x, grid.y ) );
} }
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -245,7 +245,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, ...@@ -245,7 +245,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
screen->SetScalingFactor( 1.0 ); screen->SetScalingFactor( 1.0 );
float dpi = (float)m_Parent->GetInternalUnits(); float dpi = (float)m_Parent->GetInternalUnits();
EDA_DRAW_PANEL* panel = m_Parent->DrawPanel; EDA_DRAW_PANEL* panel = m_Parent->GetCanvas();
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like 1.3) // to print floating point numbers like 1.3)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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