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