More encapsulation improvements.

* EDA_DRAW_FRAME completely encapsulated.
* Encapsulate the the low hanging fruit in EDA_DRAW_PANEL.
This commit is contained in:
Wayne Stambaugh 2011-12-22 08:28:11 -05:00
parent 2df818b844
commit c2e5fcaec8
148 changed files with 1528 additions and 1438 deletions

View File

@ -228,11 +228,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
case BLOCK_MIRROR_X: case BLOCK_MIRROR_X:
case BLOCK_MIRROR_Y: /* mirror */ case BLOCK_MIRROR_Y: /* mirror */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
Block->InitData( DrawPanel, startpos ); Block->InitData( m_canvas, startpos );
break; break;
case BLOCK_PASTE: case BLOCK_PASTE:
Block->InitData( DrawPanel, startpos ); Block->InitData( m_canvas, startpos );
Block->m_BlockLastCursorPosition.x = 0; Block->m_BlockLastCursorPosition.x = 0;
Block->m_BlockLastCursorPosition.y = 0; Block->m_BlockLastCursorPosition.y = 0;
InitBlockPasteInfos(); InitBlockPasteInfos();
@ -241,11 +241,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
{ {
DisplayError( this, wxT( "No Block to paste" ), 20 ); DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
return true; return true;
} }
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
Block->m_ItemsSelection.ClearItemsList(); Block->m_ItemsSelection.ClearItemsList();
DisplayError( this, DisplayError( this,
@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
} }
Block->m_State = STATE_BLOCK_MOVE; Block->m_State = STATE_BLOCK_MOVE;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, startpos, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false );
break; break;
default: default:

View File

@ -25,9 +25,9 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD ) if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
{ {
if( GetScreen()->IsBlockActive() ) if( GetScreen()->IsBlockActive() )
DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) ); m_canvas->SetCursor( wxCursor( m_canvas->GetDefaultCursor() ) );
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
} }
} }
@ -48,7 +48,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
int ClipboardSizeX, ClipboardSizeY; int ClipboardSizeX, ClipboardSizeY;
bool DrawBlock = false; bool DrawBlock = false;
wxRect DrawArea; wxRect DrawArea;
BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen(); BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
/* scale is the ratio resolution/internal units */ /* scale is the ratio resolution/internal units */
float scale = 82.0 / aFrame->GetInternalUnits(); float scale = 82.0 / aFrame->GetInternalUnits();
@ -73,7 +73,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
wxMetafileDC dc; wxMetafileDC dc;
EDA_RECT tmp = aFrame->DrawPanel->m_ClipBox; EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox;
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
const bool plotBlackAndWhite = false; const bool plotBlackAndWhite = false;
GRForceBlackPen( plotBlackAndWhite ); GRForceBlackPen( plotBlackAndWhite );
@ -81,10 +81,10 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
dc.SetUserScale( scale, scale ); dc.SetUserScale( scale, scale );
ClipboardSizeX = dc.MaxX() + 10; ClipboardSizeX = dc.MaxX() + 10;
ClipboardSizeY = dc.MaxY() + 10; ClipboardSizeY = dc.MaxY() + 10;
aFrame->DrawPanel->m_ClipBox.SetX( 0 ); aFrame->GetCanvas()->m_ClipBox.SetX( 0 );
aFrame->DrawPanel->m_ClipBox.SetY( 0 ); aFrame->GetCanvas()->m_ClipBox.SetY( 0 );
aFrame->DrawPanel->m_ClipBox.SetWidth( 0x7FFFFF0 ); aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 );
aFrame->DrawPanel->m_ClipBox.SetHeight( 0x7FFFFF0 ); aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 );
if( DrawBlock ) if( DrawBlock )
{ {
@ -94,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
const int maskLayer = 0xFFFFFFFF; const int maskLayer = 0xFFFFFFFF;
aFrame->PrintPage( &dc, maskLayer, false ); aFrame->PrintPage( &dc, maskLayer, false );
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
aFrame->DrawPanel->m_ClipBox = tmp; aFrame->GetCanvas()->m_ClipBox = tmp;
wxMetafile* mf = dc.Close(); wxMetafile* mf = dc.Close();
if( mf ) if( mf )

View File

@ -37,8 +37,8 @@ void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
DIALOG_PAGES_SETTINGS frame( this ); DIALOG_PAGES_SETTINGS frame( this );
int diag = frame.ShowModal(); int diag = frame.ShowModal();
if( DrawPanel && diag ) if( m_canvas && diag )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
#endif #endif
m_Screen->SetModify(); m_Screen->SetModify();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }

View File

@ -94,7 +94,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_zoomSelectBox = NULL; m_zoomSelectBox = NULL;
m_HotkeysZoomAndGridList = NULL; m_HotkeysZoomAndGridList = NULL;
DrawPanel = NULL; m_canvas = NULL;
m_messagePanel = NULL; m_messagePanel = NULL;
m_currentScreen = NULL; m_currentScreen = NULL;
m_toolId = ID_NO_TOOL_SELECTED; m_toolId = ID_NO_TOOL_SELECTED;
@ -142,7 +142,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_FramePos.x = m_FramePos.y = 0; m_FramePos.x = m_FramePos.y = 0;
m_FrameSize.y -= m_MsgFrameHeight; m_FrameSize.y -= m_MsgFrameHeight;
DrawPanel = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize ); m_canvas = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ), m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ),
wxSize( m_FrameSize.x, m_MsgFrameHeight ) ); wxSize( m_FrameSize.x, m_MsgFrameHeight ) );
@ -182,8 +182,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
{ {
m_FrameIsActive = event.GetActive(); m_FrameIsActive = event.GetActive();
if( DrawPanel ) if( m_canvas )
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
event.Skip(); // required under wxMAC event.Skip(); // required under wxMAC
} }
@ -191,8 +191,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event ) void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
{ {
if( DrawPanel ) if( m_canvas )
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
event.Skip(); event.Skip();
} }
@ -201,7 +201,7 @@ void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent ) void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
{ {
SetGridVisibility( !IsGridVisible() ); SetGridVisibility( !IsGridVisible() );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -222,10 +222,10 @@ void EDA_DRAW_FRAME::OnSelectUnits( wxCommandEvent& aEvent )
void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent ) void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent )
{ {
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
m_cursorShape = !m_cursorShape; m_cursorShape = !m_cursorShape;
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
@ -445,9 +445,9 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
// Keep default cursor in toolbars // Keep default cursor in toolbars
SetCursor( wxNullCursor ); SetCursor( wxNullCursor );
// Change DrawPanel cursor if requested. // Change m_canvas cursor if requested.
if( DrawPanel && aCursor >= 0 ) if( m_canvas && aCursor >= 0 )
DrawPanel->SetCurrentCursor( aCursor ); m_canvas->SetCurrentCursor( aCursor );
DisplayToolMsg( aToolMsg ); DisplayToolMsg( aToolMsg );
@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
void EDA_DRAW_FRAME::InitBlockPasteInfos() void EDA_DRAW_FRAME::InitBlockPasteInfos()
{ {
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
} }
@ -508,7 +508,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
BASE_SCREEN* screen = GetScreen(); BASE_SCREEN* screen = GetScreen();
bool noRefresh = true; bool noRefresh = true;
if( screen == NULL || DrawPanel == NULL ) if( screen == NULL || m_canvas == NULL )
return; return;
double scalar = screen->GetScalingFactor(); double scalar = screen->GetScalingFactor();
@ -518,7 +518,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
// Calculate the portion of the drawing that can be displayed in the // Calculate the portion of the drawing that can be displayed in the
// client area at the current zoom level. // client area at the current zoom level.
clientSize = DrawPanel->GetClientSize(); clientSize = m_canvas->GetClientSize();
// The logical size of the client window. // The logical size of the client window.
logicalClientSize.x = wxRound( (double) clientSize.x / scalar ); logicalClientSize.x = wxRound( (double) clientSize.x / scalar );
@ -694,12 +694,12 @@ SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y ); screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
DrawPanel->SetScrollbars( screen->m_ScrollPixelsPerUnitX, m_canvas->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
screen->m_ScrollPixelsPerUnitY, screen->m_ScrollPixelsPerUnitY,
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.x,
screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.x,
screen->m_ScrollbarPos.y, noRefresh ); screen->m_ScrollbarPos.y, noRefresh );
} }

View File

@ -204,7 +204,7 @@ static int overbar_position( int size_v, int thickness )
/** /**
* Function DrawGraphicText * Function DrawGraphicText
* Draw a graphic text (like module texts) * Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas * @param aPanel = the current m_canvas. NULL if draw within a 3D GL Canvas
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas * @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
* @param aPos = text position (according to h_justify, v_justify) * @param aPos = text position (according to h_justify, v_justify)
* @param aColor (enum EDA_Colors) = text color * @param aColor (enum EDA_Colors) = text color

View File

@ -100,13 +100,13 @@ void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
m_Flags = 0; m_Flags = 0;
screen->SetModify(); screen->SetModify();
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
aFrame->DrawPanel->SetMouseCapture( NULL, NULL ); aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
aFrame->DrawPanel->EndMouseCapture(); aFrame->GetCanvas()->EndMouseCapture();
if( aDC ) if( aDC )
{ {
EDA_CROSS_HAIR_MANAGER( aFrame->DrawPanel, aDC ); // Erase schematic cursor EDA_CROSS_HAIR_MANAGER( aFrame->GetCanvas(), aDC ); // Erase schematic cursor
Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
} }
} }

View File

@ -1028,7 +1028,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( !screen->m_IsPrinting & g_ShowPageLimits ) if( !screen->m_IsPrinting & g_ShowPageLimits )
{ {
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
GRRect( &DrawPanel->m_ClipBox, DC, 0, 0, GRRect( &m_canvas->m_ClipBox, DC, 0, 0,
Sheet->m_Size.x * scale, Sheet->m_Size.y * scale, width, Sheet->m_Size.x * scale, Sheet->m_Size.y * scale, width,
g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY ); g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
} }
@ -1041,13 +1041,13 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
yg = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */ yg = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
GRRect( &DrawPanel->m_ClipBox, DC, refx * scale, refy * scale, GRRect( &m_canvas->m_ClipBox, DC, refx * scale, refy * scale,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
#else #else
for( ii = 0; ii < 2; ii++ ) for( ii = 0; ii < 2; ii++ )
{ {
GRRect( &DrawPanel->m_ClipBox, DC, refx * scale, refy * scale, GRRect( &m_canvas->m_ClipBox, DC, refx * scale, refy * scale,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
refx += GRID_REF_W; refy += GRID_REF_W; refx += GRID_REF_W; refy += GRID_REF_W;
@ -1073,7 +1073,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_PODPIS_LU: case WS_PODPIS_LU:
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_VERT, size, msg, TEXT_ORIENT_VERT, size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
width, false, false ); width, false, false );
@ -1082,7 +1082,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_SEGMENT_LU: case WS_SEGMENT_LU:
xg = Sheet->m_LeftMargin - WsItem->m_Endx; xg = Sheet->m_LeftMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - Sheet->m_BottomMargin - WsItem->m_Endy; yg = Sheet->m_Size.y - Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
@ -1099,7 +1099,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_SEGMENT_LT: case WS_SEGMENT_LT:
xg = Sheet->m_LeftMargin + WsItem->m_Endx; xg = Sheet->m_LeftMargin + WsItem->m_Endx;
yg = Sheet->m_BottomMargin + WsItem->m_Endy; yg = Sheet->m_BottomMargin + WsItem->m_Endy;
GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
@ -1117,10 +1117,10 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Line.Printf( wxT( "%d" ), jj ); Line.Printf( wxT( "%d" ), jj );
if( ii < xg - PAS_REF / 2 ) if( ii < xg - PAS_REF / 2 )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, ii * scale, refy * scale, GRLine( &m_canvas->m_ClipBox, DC, ii * scale, refy * scale,
ii * scale, ( refy + GRID_REF_W ) * scale, width, Color ); ii * scale, ( refy + GRID_REF_W ) * scale, width, Color );
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( m_canvas, DC,
wxPoint( ( ii - gxpas / 2 ) * scale, wxPoint( ( ii - gxpas / 2 ) * scale,
( refy + GRID_REF_W / 2 ) * scale ), ( refy + GRID_REF_W / 2 ) * scale ),
Color, Line, TEXT_ORIENT_HORIZ, size_ref, Color, Line, TEXT_ORIENT_HORIZ, size_ref,
@ -1128,10 +1128,10 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
width, false, false ); width, false, false );
if( ii < xg - PAS_REF / 2 ) if( ii < xg - PAS_REF / 2 )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, ii * scale, yg * scale, GRLine( &m_canvas->m_ClipBox, DC, ii * scale, yg * scale,
ii * scale, ( yg - GRID_REF_W ) * scale, width, Color ); ii * scale, ( yg - GRID_REF_W ) * scale, width, Color );
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( m_canvas, DC,
wxPoint( ( ii - gxpas / 2 ) * scale, wxPoint( ( ii - gxpas / 2 ) * scale,
( yg - GRID_REF_W / 2) * scale ), ( yg - GRID_REF_W / 2) * scale ),
Color, Line, TEXT_ORIENT_HORIZ, size_ref, Color, Line, TEXT_ORIENT_HORIZ, size_ref,
@ -1149,10 +1149,10 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Line.Printf( wxT( "%c" ), 'a' + jj - 26 ); Line.Printf( wxT( "%c" ), 'a' + jj - 26 );
if( ii < yg - PAS_REF / 2 ) if( ii < yg - PAS_REF / 2 )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, refx * scale, ii * scale, GRLine( &m_canvas->m_ClipBox, DC, refx * scale, ii * scale,
( refx + GRID_REF_W ) * scale, ii * scale, width, Color ); ( refx + GRID_REF_W ) * scale, ii * scale, width, Color );
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( m_canvas, DC,
wxPoint( ( refx + GRID_REF_W / 2 ) * scale, wxPoint( ( refx + GRID_REF_W / 2 ) * scale,
( ii - gypas / 2 ) * scale ), ( ii - gypas / 2 ) * scale ),
Color, Line, TEXT_ORIENT_HORIZ, size_ref, Color, Line, TEXT_ORIENT_HORIZ, size_ref,
@ -1160,10 +1160,10 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
width, false, false ); width, false, false );
if( ii < yg - PAS_REF / 2 ) if( ii < yg - PAS_REF / 2 )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, xg * scale, ii * scale, GRLine( &m_canvas->m_ClipBox, DC, xg * scale, ii * scale,
( xg - GRID_REF_W ) * scale, ii * scale, width, Color ); ( xg - GRID_REF_W ) * scale, ii * scale, width, Color );
} }
DrawGraphicText( DrawPanel, DC, DrawGraphicText( m_canvas, DC,
wxPoint( ( xg - GRID_REF_W / 2 ) * scale, wxPoint( ( xg - GRID_REF_W / 2 ) * scale,
( ii - gxpas / 2 ) * scale ), ( ii - gxpas / 2 ) * scale ),
Color, Line, TEXT_ORIENT_HORIZ, size_ref, Color, Line, TEXT_ORIENT_HORIZ, size_ref,
@ -1197,7 +1197,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_PODPIS: case WS_PODPIS:
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1211,7 +1211,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
if( screen->m_NumberOfScreen > 1 ) if( screen->m_NumberOfScreen > 1 )
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
DrawGraphicText( DrawPanel, DC, pos, Color, msg, DrawGraphicText( m_canvas, DC, pos, Color, msg,
TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT, TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_CENTER, width, false, false ); GR_TEXT_VJUSTIFY_CENTER, width, false, false );
break; break;
@ -1220,7 +1220,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << screen->m_NumberOfScreen; msg << screen->m_NumberOfScreen;
DrawGraphicText( DrawPanel, DC, pos, Color, msg, DrawGraphicText( m_canvas, DC, pos, Color, msg,
TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT, TEXT_ORIENT_HORIZ, size, GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_CENTER, width, false, false ); GR_TEXT_VJUSTIFY_CENTER, width, false, false );
break; break;
@ -1229,7 +1229,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Company; msg = screen->m_Company;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size1_5, msg, TEXT_ORIENT_HORIZ, size1_5,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, width,
@ -1241,7 +1241,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Title; msg = screen->m_Title;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size1_5, msg, TEXT_ORIENT_HORIZ, size1_5,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, width,
@ -1253,14 +1253,14 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Commentaire1; msg = screen->m_Commentaire1;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size3, msg, TEXT_ORIENT_HORIZ, size3,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, width,
false, false ); false, false );
pos.x = (Sheet->m_LeftMargin + 1260) * scale; pos.x = (Sheet->m_LeftMargin + 1260) * scale;
pos.y = (Sheet->m_TopMargin + 270) * scale; pos.y = (Sheet->m_TopMargin + 270) * scale;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, 1800, size2, msg, 1800, size2,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, width,
@ -1272,7 +1272,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Commentaire2; msg = screen->m_Commentaire2;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1283,7 +1283,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Commentaire3; msg = screen->m_Commentaire3;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1294,7 +1294,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Commentaire4; msg = screen->m_Commentaire4;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1312,7 +1312,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Sheet->m_RightMargin - WsItem->m_Endx; Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - WsItem->m_Endy; Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
@ -1332,14 +1332,14 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = screen->m_Commentaire1; msg = screen->m_Commentaire1;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size3, msg, TEXT_ORIENT_HORIZ, size3,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, width,
false, false ); false, false );
pos.x = (Sheet->m_LeftMargin + 1260) * scale; pos.x = (Sheet->m_LeftMargin + 1260) * scale;
pos.y = (Sheet->m_TopMargin + 270) * scale; pos.y = (Sheet->m_TopMargin + 270) * scale;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, 1800, size2, msg, 1800, size2,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
width, width,
@ -1350,7 +1350,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_PODPIS_D: case WS_PODPIS_D:
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, width,
@ -1361,7 +1361,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1375,7 +1375,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Sheet->m_RightMargin - WsItem->m_Endx; Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - WsItem->m_Endy; Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
@ -1397,7 +1397,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg += screen->m_Date; msg += screen->m_Date;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, true ); width, false, true );
@ -1407,7 +1407,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg += screen->m_Revision; msg += screen->m_Revision;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
GetPenSizeForBold( MIN( size.x, size.y ) ), GetPenSizeForBold( MIN( size.x, size.y ) ),
@ -1419,7 +1419,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg += g_ProductName + wxGetApp().GetAppName(); msg += g_ProductName + wxGetApp().GetAppName();
msg += wxT( " " ) + GetBuildVersion(); msg += wxT( " " ) + GetBuildVersion();
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1429,7 +1429,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg += Sheet->m_Name; msg += Sheet->m_Name;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1440,7 +1440,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber << wxT( "/" ) << screen->m_NumberOfScreen; msg << screen->m_ScreenNumber << wxT( "/" ) << screen->m_NumberOfScreen;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1455,7 +1455,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << fname << wxT( "." ) << fext; msg << fname << wxT( "." ) << fext;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1466,7 +1466,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg += GetScreenDesc(); msg += GetScreenDesc();
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1479,7 +1479,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg += screen->m_Company; msg += screen->m_Company;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
GetPenSizeForBold( MIN( size.x, size.y ) ), GetPenSizeForBold( MIN( size.x, size.y ) ),
@ -1492,7 +1492,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg += screen->m_Title; msg += screen->m_Title;
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
GetPenSizeForBold( MIN( size.x, size.y ) ), GetPenSizeForBold( MIN( size.x, size.y ) ),
@ -1505,7 +1505,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg += screen->m_Commentaire1; msg += screen->m_Commentaire1;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1519,7 +1519,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg += screen->m_Commentaire2; msg += screen->m_Commentaire2;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1533,7 +1533,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg += screen->m_Commentaire3; msg += screen->m_Commentaire3;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1547,7 +1547,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
msg += screen->m_Commentaire4; msg += screen->m_Commentaire4;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
DrawGraphicText( DrawPanel, DC, pos, Color, DrawGraphicText( m_canvas, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size, msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
width, false, false ); width, false, false );
@ -1570,7 +1570,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
GRID_REF_W - Sheet->m_RightMargin - WsItem->m_Endx; GRID_REF_W - Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - yg = Sheet->m_Size.y -
GRID_REF_W - Sheet->m_BottomMargin - WsItem->m_Endy; GRID_REF_W - Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine( &DrawPanel->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }

View File

@ -22,10 +22,10 @@ void EDA_DRAW_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointe
// Move the mouse cursor to the on grid graphic cursor position // Move the mouse cursor to the on grid graphic cursor position
if( aWarpPointer ) if( aWarpPointer )
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->Refresh(); m_canvas->Refresh();
DrawPanel->Update(); m_canvas->Update();
} }
@ -55,7 +55,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect )
/* Compute the best zoom */ /* Compute the best zoom */
Rect.Normalize(); Rect.Normalize();
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
// Use ceil to at least show the full rect // Use ceil to at least show the full rect
scalex = (double) Rect.GetSize().x / size.x; scalex = (double) Rect.GetSize().x / size.x;
@ -73,7 +73,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect )
*/ */
void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event ) void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
{ {
if( DrawPanel == NULL ) if( m_canvas == NULL )
return; return;
int i; int i;
@ -105,7 +105,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
break; break;
case ID_ZOOM_REDRAW: case ID_ZOOM_REDRAW:
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_POPUP_ZOOM_CENTER: case ID_POPUP_ZOOM_CENTER:
@ -121,7 +121,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
break; break;
case ID_POPUP_CANCEL: case ID_POPUP_CANCEL:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
default: default:
@ -149,7 +149,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
int maxZoomIds; int maxZoomIds;
int zoom; int zoom;
wxString msg; wxString msg;
BASE_SCREEN * screen = DrawPanel->GetScreen(); BASE_SCREEN * screen = m_canvas->GetScreen();
msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER ); msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER );
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) ); AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );

View File

@ -128,7 +128,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr.AddPane( m_drawToolBar, m_auimgr.AddPane( m_drawToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() ); wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
m_auimgr.AddPane( m_messagePanel, m_auimgr.AddPane( m_messagePanel,
@ -313,7 +313,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
if( m_DisplayModText > 2 ) if( m_DisplayModText > 2 )
m_DisplayModText = 0; m_DisplayModText = 0;
DrawPanel->Refresh( ); m_canvas->Refresh( );
break; break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH: case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
@ -322,7 +322,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
if( m_DisplayModEdge > 2 ) if( m_DisplayModEdge > 2 )
m_DisplayModEdge = 0; m_DisplayModEdge = 0;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:
@ -381,25 +381,25 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
case WXK_NUMPAD8: /* cursor moved up */ case WXK_NUMPAD8: /* cursor moved up */
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: /* cursor moved down */ case WXK_NUMPAD2: /* cursor moved down */
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: /* cursor moved left */ case WXK_NUMPAD4: /* cursor moved left */
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: /* cursor moved right */ case WXK_NUMPAD6: /* cursor moved right */
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
} }
@ -409,13 +409,13 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, 0 ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, 0 );
} }
} }

View File

@ -68,7 +68,7 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void )
m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection(); m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue(); m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue(); m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }

View File

@ -83,7 +83,8 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod ); m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
m_DisplayFootprintFrame->Zoom_Automatique( false ); m_DisplayFootprintFrame->Zoom_Automatique( false );
m_DisplayFootprintFrame->DrawPanel->Refresh(); m_DisplayFootprintFrame->GetCanvas()->Refresh();
// Display new cursor coordinates and zoom value: // Display new cursor coordinates and zoom value:
m_DisplayFootprintFrame->UpdateStatusBar(); m_DisplayFootprintFrame->UpdateStatusBar();
@ -115,15 +116,15 @@ void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( !GetBoard() ) if( !GetBoard() )
return; return;
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
GetBoard()->Draw( DrawPanel, DC, GR_COPY ); GetBoard()->Draw( m_canvas, DC, GR_COPY );
MODULE* Module = GetBoard()->m_Modules; MODULE* Module = GetBoard()->m_Modules;
if ( Module ) if ( Module )
Module->DisplayInfo( this ); Module->DisplayInfo( this );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
} }

View File

@ -148,7 +148,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
m_CurrentSheet->UpdateAllScreenReferences(); m_CurrentSheet->UpdateAllScreenReferences();
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }

View File

@ -105,7 +105,7 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos()
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
block->m_ItemsSelection.CopyList( m_blockItems.m_ItemsSelection ); block->m_ItemsSelection.CopyList( m_blockItems.m_ItemsSelection );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
} }
@ -113,7 +113,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) ); DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
} }
@ -138,8 +138,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_MIRROR_Y: case BLOCK_MIRROR_Y:
case BLOCK_DRAG: /* Drag */ case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector ); SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector );
MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector ); MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector );
@ -148,8 +148,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector ); DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector );
@ -160,8 +160,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
break; break;
case BLOCK_PASTE: case BLOCK_PASTE:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
PasteListOfItems( DC ); PasteListOfItems( DC );
block->ClearItemsList(); block->ClearItemsList();
@ -182,7 +182,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->ClearDrawingState(); GetScreen()->ClearDrawingState();
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
if( block->GetCount() ) if( block->GetCount() )
{ {
@ -190,8 +190,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
block->ClearItemsList(); block->ClearItemsList();
} }
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -206,19 +206,19 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
BlockState state = block->m_State; BlockState state = block->m_State;
CmdBlockType command = block->m_Command; CmdBlockType command = block->m_Command;
if( DrawPanel->m_endMouseCaptureCallback ) if( m_canvas->m_endMouseCaptureCallback )
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC ); m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
block->m_State = state; block->m_State = state;
block->m_Command = command; block->m_Command = command;
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
GetScreen()->SetCrossHairPosition( block->GetEnd() ); GetScreen()->SetCrossHairPosition( block->GetEnd() );
if( block->m_Command != BLOCK_ABORT ) if( block->m_Command != BLOCK_ABORT )
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
} }
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
switch( block->m_Command ) switch( block->m_Command )
{ {
@ -243,36 +243,36 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
nextcmd = true; nextcmd = true;
GetScreen()->SelectBlockItems(); GetScreen()->SelectBlockItems();
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
block->m_State = STATE_BLOCK_MOVE; block->m_State = STATE_BLOCK_MOVE;
} }
else else
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
} }
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
GetScreen()->UpdatePickList(); GetScreen()->UpdatePickList();
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false ); DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); DeleteItemsInList( m_canvas, block->m_ItemsSelection );
OnModify(); OnModify();
} }
block->ClearItemsList(); block->ClearItemsList();
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case BLOCK_SAVE: /* Save */ case BLOCK_SAVE: /* Save */
GetScreen()->UpdatePickList(); GetScreen()->UpdatePickList();
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false ); DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
@ -304,7 +304,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if( block->m_Command == BLOCK_ABORT ) if( block->m_Command == BLOCK_ABORT )
{ {
GetScreen()->ClearDrawingState(); GetScreen()->ClearDrawingState();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
if( ! nextcmd ) if( ! nextcmd )
@ -313,7 +313,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
block->m_State = STATE_NO_BLOCK; block->m_State = STATE_NO_BLOCK;
block->m_Command = BLOCK_IDLE; block->m_Command = BLOCK_IDLE;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
} }
@ -351,8 +351,8 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
break; break;
case BLOCK_DRAG: /* move to Drag */ case BLOCK_DRAG: /* move to Drag */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
// Clear list of items to move, and rebuild it with items to drag: // Clear list of items to move, and rebuild it with items to drag:
block->ClearItemsList(); block->ClearItemsList();
@ -365,30 +365,30 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
blockCmdFinished = false; blockCmdFinished = false;
GetScreen()->SelectBlockItems(); GetScreen()->SelectBlockItems();
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
block->m_State = STATE_BLOCK_MOVE; block->m_State = STATE_BLOCK_MOVE;
} }
break; break;
case BLOCK_DELETE: /* move to Delete */ case BLOCK_DELETE: /* move to Delete */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); DeleteItemsInList( m_canvas, block->m_ItemsSelection );
OnModify(); OnModify();
} }
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case BLOCK_SAVE: /* Save list in paste buffer*/ case BLOCK_SAVE: /* Save list in paste buffer*/
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
@ -399,15 +399,15 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
break; break;
case BLOCK_ZOOM: /* Window Zoom */ case BLOCK_ZOOM: /* Window Zoom */
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC ); m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
DrawPanel->SetCursor( DrawPanel->GetDefaultCursor() ); m_canvas->SetCursor( m_canvas->GetDefaultCursor() );
Window_Zoom( GetScreen()->m_BlockLocate ); Window_Zoom( GetScreen()->m_BlockLocate );
break; break;
case BLOCK_ROTATE: case BLOCK_ROTATE:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
@ -420,13 +420,13 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
OnModify(); OnModify();
} }
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case BLOCK_MIRROR_X: case BLOCK_MIRROR_X:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
@ -438,13 +438,13 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
Mirror_X_ListOfItems( block->m_ItemsSelection, mirrorPoint ); Mirror_X_ListOfItems( block->m_ItemsSelection, mirrorPoint );
OnModify(); OnModify();
} }
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case BLOCK_MIRROR_Y: case BLOCK_MIRROR_Y:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
@ -457,8 +457,8 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
OnModify(); OnModify();
} }
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:
@ -469,7 +469,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
{ {
block->Clear(); block->Clear();
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
} }
} }
@ -559,7 +559,7 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
} }
SetSchItemParent( Struct, GetScreen() ); SetSchItemParent( Struct, GetScreen() );
Struct->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); Struct->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
Struct->SetNext( GetScreen()->GetDrawItems() ); Struct->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( Struct ); GetScreen()->SetDrawItems( Struct );
} }

View File

@ -92,13 +92,13 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
BlockState state = GetScreen()->m_BlockLocate.m_State; BlockState state = GetScreen()->m_BlockLocate.m_State;
CmdBlockType command = GetScreen()->m_BlockLocate.m_Command; CmdBlockType command = GetScreen()->m_BlockLocate.m_Command;
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC ); m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
GetScreen()->m_BlockLocate.m_State = state; GetScreen()->m_BlockLocate.m_State = state;
GetScreen()->m_BlockLocate.m_Command = command; GetScreen()->m_BlockLocate.m_Command = command;
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(), GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(),
GetScreen()->m_BlockLocate.GetBottom() ) ); GetScreen()->m_BlockLocate.GetBottom() ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
} }
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
@ -118,21 +118,21 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
nextCmd = true; nextCmd = true;
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
nextCmd = true; nextCmd = true;
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
break; break;
@ -205,9 +205,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
return nextCmd; return nextCmd;
@ -218,7 +218,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
wxPoint pt; wxPoint pt;
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) ); DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
} }
@ -244,7 +244,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
if ( m_component ) if ( m_component )
m_component->MoveSelectedItems( pt ); m_component->MoveSelectedItems( pt );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
@ -302,8 +302,8 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }

View File

@ -129,7 +129,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
{ {
s_ConnexionStartPoint = cursorpos; s_ConnexionStartPoint = cursorpos;
s_OldWiresList = GetScreen()->ExtractWires( true ); s_OldWiresList = GetScreen()->ExtractWires( true );
GetScreen()->SchematicCleanUp( DrawPanel ); GetScreen()->SchematicCleanUp( m_canvas );
switch( type ) switch( type )
{ {
@ -160,7 +160,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
} }
GetScreen()->SetCurItem( newsegment ); GetScreen()->SetCurItem( newsegment );
DrawPanel->SetMouseCapture( DrawSegment, AbortCreateNewLine ); m_canvas->SetMouseCapture( DrawSegment, AbortCreateNewLine );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
} }
else // A segment is in progress: terminates the current segment and add a new segment. else // A segment is in progress: terminates the current segment and add a new segment.
@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
return; return;
} }
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
/* Creates the new segment, or terminates the command /* Creates the new segment, or terminates the command
* if the end point is on a pin, junction or an other wire or bus */ * if the end point is on a pin, junction or an other wire or bus */
@ -193,9 +193,9 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
oldsegment->SetNext( GetScreen()->GetDrawItems() ); oldsegment->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( oldsegment ); GetScreen()->SetDrawItems( oldsegment );
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor m_canvas->CrossHairOff( DC ); // Erase schematic cursor
oldsegment->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); oldsegment->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( DC ); // Display schematic cursor m_canvas->CrossHairOn( DC ); // Display schematic cursor
/* Create a new segment, and chain it after the current new segment */ /* Create a new segment, and chain it after the current new segment */
if( nextsegment ) if( nextsegment )
@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
oldsegment->SetFlags( SELECTED ); oldsegment->SetFlags( SELECTED );
newsegment->SetFlags( IS_NEW ); newsegment->SetFlags( IS_NEW );
GetScreen()->SetCurItem( newsegment ); GetScreen()->SetCurItem( newsegment );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
/* This is the first segment: Now we know the start segment position. /* This is the first segment: Now we know the start segment position.
* Create a junction if needed. Note: a junction can be needed later, * Create a junction if needed. Note: a junction can be needed later,
@ -282,7 +282,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
GetScreen()->SetDrawItems( lastsegment ); GetScreen()->SetDrawItems( lastsegment );
} }
DrawPanel->EndMouseCapture( -1, -1, wxEmptyString, false ); m_canvas->EndMouseCapture( -1, -1, wxEmptyString, false );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
wxPoint end_point, alt_end_point; wxPoint end_point, alt_end_point;
@ -298,7 +298,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
alt_end_point = lastsegment->GetStartPoint(); alt_end_point = lastsegment->GetStartPoint();
} }
GetScreen()->SchematicCleanUp( DrawPanel ); GetScreen()->SchematicCleanUp( m_canvas );
/* clear flags and find last segment entered, for repeat function */ /* clear flags and find last segment entered, for repeat function */
segment = (SCH_LINE*) GetScreen()->GetDrawItems(); segment = (SCH_LINE*) GetScreen()->GetDrawItems();
@ -329,10 +329,10 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
if( GetScreen()->IsJunctionNeeded( s_ConnexionStartPoint ) ) if( GetScreen()->IsJunctionNeeded( s_ConnexionStartPoint ) )
AddJunction( DC, s_ConnexionStartPoint ); AddJunction( DC, s_ConnexionStartPoint );
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
/* Redraw wires and junctions which can be changed by TestDanglingEnds() */ /* Redraw wires and junctions which can be changed by TestDanglingEnds() */
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor m_canvas->CrossHairOff( DC ); // Erase schematic cursor
EDA_ITEM* item = GetScreen()->GetDrawItems(); EDA_ITEM* item = GetScreen()->GetDrawItems();
while( item ) while( item )
@ -341,7 +341,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
{ {
case SCH_JUNCTION_T: case SCH_JUNCTION_T:
case SCH_LINE_T: case SCH_LINE_T:
DrawPanel->RefreshDrawingRect( item->GetBoundingBox() ); m_canvas->RefreshDrawingRect( item->GetBoundingBox() );
break; break;
default: default:
@ -351,7 +351,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
item = item->Next(); item = item->Next();
} }
DrawPanel->CrossHairOn( DC ); // Display schematic cursor m_canvas->CrossHairOn( DC ); // Display schematic cursor
SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE ); SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE );
s_OldWiresList = NULL; s_OldWiresList = NULL;
@ -436,15 +436,15 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
} }
polyLine->SetPoint( idx, endpos ); polyLine->SetPoint( idx, endpos );
polyLine->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); polyLine->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
} }
else else
{ {
DrawSegment( DrawPanel, DC, wxDefaultPosition, false ); DrawSegment( m_canvas, DC, wxDefaultPosition, false );
} }
screen->RemoveFromDrawList( screen->GetCurItem() ); screen->RemoveFromDrawList( screen->GetCurItem() );
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
} }
@ -456,9 +456,9 @@ SCH_JUNCTION* SCH_EDIT_FRAME::AddJunction( wxDC* aDC, const wxPoint& aPosition,
m_itemToRepeat = junction; m_itemToRepeat = junction;
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
junction->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); junction->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor m_canvas->CrossHairOn( aDC ); // Display schematic cursor
junction->SetNext( GetScreen()->GetDrawItems() ); junction->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( junction ); GetScreen()->SetDrawItems( junction );
@ -478,9 +478,9 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( wxDC* aDC, const wxPoint& aPositio
NewNoConnect = new SCH_NO_CONNECT( aPosition ); NewNoConnect = new SCH_NO_CONNECT( aPosition );
m_itemToRepeat = NewNoConnect; m_itemToRepeat = NewNoConnect;
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
NewNoConnect->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); NewNoConnect->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor m_canvas->CrossHairOn( aDC ); // Display schematic cursor
NewNoConnect->SetNext( GetScreen()->GetDrawItems() ); NewNoConnect->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( NewNoConnect ); GetScreen()->SetDrawItems( NewNoConnect );
@ -528,7 +528,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
m_itemToRepeat->SetFlags( IS_NEW ); m_itemToRepeat->SetFlags( IS_NEW );
( (SCH_COMPONENT*) m_itemToRepeat )->SetTimeStamp( GetNewTimeStamp() ); ( (SCH_COMPONENT*) m_itemToRepeat )->SetTimeStamp( GetNewTimeStamp() );
m_itemToRepeat->Move( pos ); m_itemToRepeat->Move( pos );
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
MoveItem( m_itemToRepeat, DC ); MoveItem( m_itemToRepeat, DC );
return; return;
} }
@ -543,7 +543,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
m_itemToRepeat->SetNext( GetScreen()->GetDrawItems() ); m_itemToRepeat->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->SetDrawItems( m_itemToRepeat ); GetScreen()->SetDrawItems( m_itemToRepeat );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
SaveCopyInUndoList( m_itemToRepeat, UR_NEW ); SaveCopyInUndoList( m_itemToRepeat, UR_NEW );
m_itemToRepeat->ClearFlags(); m_itemToRepeat->ClearFlags();
} }

View File

@ -74,10 +74,10 @@ void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int en
s_LastShape = entry_shape == '/' ? '/' : '\\'; s_LastShape = entry_shape == '/' ? '/' : '\\';
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
BusEntry->SetBusEntryShape( s_LastShape ); BusEntry->SetBusEntryShape( s_LastShape );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
OnModify( ); OnModify( );
} }

View File

@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
// If the user aborted the clarification context menu, don't show it again at the // If the user aborted the clarification context menu, don't show it again at the
// off grid position. // off grid position.
if( !item && DrawPanel->m_AbortRequest ) if( !item && m_canvas->m_AbortRequest )
{ {
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
return NULL; return NULL;
} }
@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
if( !item ) if( !item )
{ {
DrawPanel->m_AbortRequest = false; // Just in case the user aborted the context menu. m_canvas->m_AbortRequest = false; // Just in case the user aborted the context menu.
return NULL; return NULL;
} }
@ -171,9 +171,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
// Set to NULL in case user aborts the clarification context menu. // Set to NULL in case user aborts the clarification context menu.
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
DrawPanel->m_AbortRequest = true; // Changed to false if an item is selected m_canvas->m_AbortRequest = true; // Changed to false if an item is selected
PopupMenu( &selectMenu ); PopupMenu( &selectMenu );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
item = GetScreen()->GetCurItem(); item = GetScreen()->GetCurItem();
} }
} }
@ -208,25 +208,25 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
@ -240,23 +240,23 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
#else #else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
DrawPanel->m_overlay.Reset(); m_canvas->m_overlay.Reset();
#endif #endif
} }
@ -291,25 +291,25 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
@ -323,23 +323,23 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
#else #else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
DrawPanel->m_overlay.Reset(); m_canvas->m_overlay.Reset();
#endif #endif
} }
@ -371,25 +371,25 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
@ -403,13 +403,13 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
screen->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
} }
} }

View File

@ -118,6 +118,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
message = _( "Clear and annotate all of the components " ); message = _( "Clear and annotate all of the components " );
else else
message = _( "Annotate only the unannotated components " ); message = _( "Annotate only the unannotated components " );
if( GetLevel() ) if( GetLevel() )
message += _( "on the entire schematic?" ); message += _( "on the entire schematic?" );
else else
@ -125,13 +126,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
message += _( "\n\nThis operation will change the current annotation and cannot be undone." ); message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(), m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
(ANNOTATE_OPTION_T) GetAnnotateAlgo(), (ANNOTATE_OPTION_T) GetAnnotateAlgo(),
GetResetItems() , true ); GetResetItems() , true );
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
m_btnClear->Enable(); m_btnClear->Enable();
} }
@ -150,12 +152,13 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
message += _( "the current sheet?" ); message += _( "the current sheet?" );
message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." ); message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
m_Parent->DeleteAnnotation( GetLevel() ? false : true ); m_Parent->DeleteAnnotation( GetLevel() ? false : true );
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
m_btnClear->Enable(false); m_btnClear->Enable(false);
} }

View File

@ -212,7 +212,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units
screen->SetScalingFactor( 1.0 ); screen->SetScalingFactor( 1.0 );
EDA_DRAW_PANEL* panel = frame->DrawPanel; EDA_DRAW_PANEL* panel = frame->GetCanvas();
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like 1.3) // to print floating point numbers like 1.3)

View File

@ -289,14 +289,17 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
bool warning = false; bool warning = false;
for( int ii = 0; ii < MAX_LAYERS; ii++ ) for( int ii = 0; ii < MAX_LAYERS; ii++ )
{ {
g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ]; g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ];
if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] ) if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] )
warning = true; warning = true;
} }
m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] ); m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] );
if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] ) if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] )
warning = true; warning = true;
@ -311,11 +314,9 @@ void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event )
// Prompt the user if an item has the same color as the background // Prompt the user if an item has the same color as the background
// because this item cannot be seen: // because this item cannot be seen:
if( warning ) if( warning )
wxMessageBox( wxMessageBox( _("Warning:\nSome items have the same color as the background\nand they will not be seen on screen") );
_("Warning:\nSome items have the same color as the background\nand they will not be seen on screen")
);
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
EndModal( 1 ); EndModal( 1 );
} }
@ -330,7 +331,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event )
void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event ) void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event )
{ {
UpdateColorsSettings(); UpdateColorsSettings();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }

View File

@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T, wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T,
wxT( "Invalid component object pointer. Bad Programmer!" ) ); wxT( "Invalid component object pointer. Bad Programmer!" ) );
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this );
@ -54,8 +54,8 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
// so it comes up wide enough next time. // so it comes up wide enough next time.
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize(); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
dlg->Destroy(); dlg->Destroy();
} }
@ -283,7 +283,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
m_Parent->OnModify(); m_Parent->OnModify();
m_Parent->GetScreen()->TestDanglingEnds(); m_Parent->GetScreen()->TestDanglingEnds();
m_Parent->DrawPanel->Refresh( true ); m_Parent->GetCanvas()->Refresh( true );
EndModal( 0 ); EndModal( 0 );
} }
@ -834,8 +834,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
if( m_Cmp->m_Flags == 0 ) if( m_Cmp->m_Flags == 0 )
m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED ); m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED );
INSTALL_UNBUFFERED_DC( dc, m_Parent->DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() );
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode );
// Initialize field values to default values found in library: // Initialize field values to default values found in library:
LIB_FIELD& refField = entry->GetReferenceField(); LIB_FIELD& refField = entry->GetReferenceField();
@ -850,6 +850,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
m_Parent->OnModify(); m_Parent->OnModify();
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
EndModal( 1 ); EndModal( 1 );
} }

View File

@ -214,7 +214,7 @@ void DialogLabelEditor::OnOkClick( wxCommandEvent& aEvent )
void DialogLabelEditor::OnCancelClick( wxCommandEvent& aEvent ) void DialogLabelEditor::OnCancelClick( wxCommandEvent& aEvent )
{ {
m_Parent->DrawPanel->MoveCursorToCrossHair(); m_Parent->GetCanvas()->MoveCursorToCrossHair();
EndModal( wxID_CANCEL ); EndModal( wxID_CANCEL );
} }
@ -228,7 +228,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
if( m_CurrentText->GetFlags() == 0 ) if( m_CurrentText->GetFlags() == 0 )
m_Parent->SaveCopyInUndoList( m_CurrentText, UR_CHANGED ); m_Parent->SaveCopyInUndoList( m_CurrentText, UR_CHANGED );
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() ); m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
text = m_textLabel->GetValue(); text = m_textLabel->GetValue();
@ -269,7 +269,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
if( m_CurrentText->IsNew() ) if( m_CurrentText->IsNew() )
g_DefaultTextLabelSize = m_CurrentText->m_Size.x; g_DefaultTextLabelSize = m_CurrentText->m_Size.x;
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() ); m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
m_Parent->DrawPanel->MoveCursorToCrossHair(); m_Parent->GetCanvas()->MoveCursorToCrossHair();
EndModal( wxID_OK ); EndModal( wxID_OK );
} }

View File

@ -109,7 +109,7 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
if( m_component == NULL ) if( m_component == NULL )
return; return;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_component ); DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_component );

View File

@ -113,7 +113,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
ScreenList.DeleteAllMarkers( MARK_ERC ); ScreenList.DeleteAllMarkers( MARK_ERC );
m_MarkersList->ClearList(); m_MarkersList->ClearList();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }
@ -563,7 +563,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
DisplayERC_MarkersList(); DisplayERC_MarkersList();
// Display new markers: // Display new markers:
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
if( m_writeErcFile ) if( m_writeErcFile )
{ {

View File

@ -316,7 +316,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
wxRect fitRect; wxRect fitRect;
wxDC* dc = GetDC(); wxDC* dc = GetDC();
SCH_EDIT_FRAME* parent = m_Parent->GetParent(); SCH_EDIT_FRAME* parent = m_Parent->GetParent();
EDA_DRAW_PANEL* panel = parent->DrawPanel; EDA_DRAW_PANEL* panel = parent->GetCanvas();
wxBusyCursor dummy; wxBusyCursor dummy;

View File

@ -133,9 +133,9 @@ SCH_BITMAP* SCH_EDIT_FRAME::CreateNewImage( wxDC* aDC )
image->SetFlags( IS_NEW | IS_MOVED ); image->SetFlags( IS_NEW | IS_MOVED );
image->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); image->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->SetMouseCapture( moveBitmap, abortMoveBitmap ); m_canvas->SetMouseCapture( moveBitmap, abortMoveBitmap );
GetScreen()->SetCurItem( image ); GetScreen()->SetCurItem( image );
OnModify(); OnModify();
@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::MoveImage( SCH_BITMAP* aImageItem, wxDC* aDC )
{ {
aImageItem->SetFlags( IS_MOVED ); aImageItem->SetFlags( IS_MOVED );
DrawPanel->SetMouseCapture( moveBitmap, abortMoveBitmap ); m_canvas->SetMouseCapture( moveBitmap, abortMoveBitmap );
GetScreen()->SetCurItem( aImageItem ); GetScreen()->SetCurItem( aImageItem );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
SetUndoItem( aImageItem ); SetUndoItem( aImageItem );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aImageItem->GetPosition() ); GetScreen()->SetCrossHairPosition( aImageItem->GetPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
OnModify(); OnModify();
} }
@ -167,7 +167,7 @@ void SCH_EDIT_FRAME::RotateImage( SCH_BITMAP* aItem )
aItem->Rotate( aItem->GetPosition() ); aItem->Rotate( aItem->GetPosition() );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis ) void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis )
@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis )
aItem->Mirror_Y( aItem->GetPosition().x ); aItem->Mirror_Y( aItem->GetPosition().x );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem ) void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
@ -196,5 +196,5 @@ void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
dlg.TransfertToImage(aItem->m_Image); dlg.TransfertToImage(aItem->m_Image);
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -74,7 +74,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
// Don't use GetText() here. If the field is the reference designator and it's parent // Don't use GetText() here. If the field is the reference designator and it's parent
// component has multiple parts, we don't want the part suffix added to the field. // component has multiple parts, we don't want the part suffix added to the field.
wxString newtext = aField->m_Text; wxString newtext = aField->m_Text;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxString title; wxString title;
title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) ); title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
@ -82,8 +82,8 @@ create a new power component with the new value." ), GetChars( entry->GetName()
wxTextEntryDialog dlg( this, wxEmptyString , title, newtext ); wxTextEntryDialog dlg( this, wxEmptyString , title, newtext );
int response = dlg.ShowModal(); int response = dlg.ShowModal();
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
newtext = dlg.GetValue( ); newtext = dlg.GetValue( );
newtext.Trim( true ); newtext.Trim( true );
newtext.Trim( false ); newtext.Trim( false );
@ -91,7 +91,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
if ( response != wxID_OK || newtext == aField->GetText() ) if ( response != wxID_OK || newtext == aField->GetText() )
return; // canceled by user return; // canceled by user
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
if( !newtext.IsEmpty() ) if( !newtext.IsEmpty() )
{ {
@ -135,7 +135,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
} }
} }
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
component->DisplayInfo( this ); component->DisplayInfo( this );
OnModify(); OnModify();
} }
@ -152,14 +152,14 @@ void SCH_EDIT_FRAME::RotateField( SCH_FIELD* aField, wxDC* aDC )
if( aField->GetFlags() == 0 ) if( aField->GetFlags() == 0 )
SaveCopyInUndoList( component, UR_CHANGED ); SaveCopyInUndoList( component, UR_CHANGED );
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
if( aField->m_Orient == TEXT_ORIENT_HORIZ ) if( aField->m_Orient == TEXT_ORIENT_HORIZ )
aField->m_Orient = TEXT_ORIENT_VERT; aField->m_Orient = TEXT_ORIENT_VERT;
else else
aField->m_Orient = TEXT_ORIENT_HORIZ; aField->m_Orient = TEXT_ORIENT_HORIZ;
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
OnModify(); OnModify();
} }

View File

@ -60,12 +60,12 @@ void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC )
if( aTextItem->GetFlags() == 0 ) if( aTextItem->GetFlags() == 0 )
SaveCopyInUndoList( aTextItem, UR_CHANGED ); SaveCopyInUndoList( aTextItem, UR_CHANGED );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
aTextItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aTextItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
aTextItem->SetOrientation( orient ); aTextItem->SetOrientation( orient );
OnModify(); OnModify();
aTextItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aTextItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
} }
@ -106,7 +106,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
textItem->m_Size.x = textItem->m_Size.y = g_DefaultTextLabelSize; textItem->m_Size.x = textItem->m_Size.y = g_DefaultTextLabelSize;
textItem->SetFlags( IS_NEW | IS_MOVED ); textItem->SetFlags( IS_NEW | IS_MOVED );
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
EditSchematicText( textItem ); EditSchematicText( textItem );
if( textItem->m_Text.IsEmpty() ) if( textItem->m_Text.IsEmpty() )
@ -124,7 +124,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
lastGlobalLabelShape = textItem->GetShape(); lastGlobalLabelShape = textItem->GetShape();
} }
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
MoveItem( (SCH_ITEM*) textItem, aDC ); MoveItem( (SCH_ITEM*) textItem, aDC );
return textItem; return textItem;
@ -220,17 +220,17 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
* put in undo list later, at the end of the current command (if not aborted) * put in undo list later, at the end of the current command (if not aborted)
*/ */
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); // Erase schematic cursor m_canvas->CrossHairOff( &dc ); // Erase schematic cursor
text->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); text->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
screen->RemoveFromDrawList( text ); screen->RemoveFromDrawList( text );
screen->AddToDrawList( newtext ); screen->AddToDrawList( newtext );
GetScreen()->SetCurItem( newtext ); GetScreen()->SetCurItem( newtext );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
OnModify(); OnModify();
newtext->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); newtext->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( &dc ); // redraw schematic cursor m_canvas->CrossHairOn( &dc ); // redraw schematic cursor
if( text->IsNew() ) if( text->IsNew() )
{ {

View File

@ -47,16 +47,16 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( GetScreen() == NULL ) if( GetScreen() == NULL )
return; return;
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
GetScreen()->Draw( DrawPanel, DC, GR_DEFAULT_DRAWMODE ); GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, FALSE );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
// Display the sheet filename, and the sheet path, for non root sheets // Display the sheet filename, and the sheet path, for non root sheets
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName ) if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )

View File

@ -170,13 +170,13 @@ bool EDA_APP::OnInit()
wxSetWorkingDirectory( filename.GetPath() ); wxSetWorkingDirectory( filename.GetPath() );
if( frame->LoadOneEEProject( filename.GetFullPath(), false ) ) if( frame->LoadOneEEProject( filename.GetFullPath(), false ) )
frame->DrawPanel->Refresh( true ); frame->GetCanvas()->Refresh( true );
} }
else else
{ {
// Read a default config file if no file to load. // Read a default config file if no file to load.
frame->LoadProjectFile( wxEmptyString, true ); frame->LoadProjectFile( wxEmptyString, true );
frame->DrawPanel->Refresh( true ); frame->GetCanvas()->Refresh( true );
} }
return true; return true;

View File

@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowGrid( IsGridVisible() );
dlg.SetShowHiddenPins( m_showAllPins ); dlg.SetShowHiddenPins( m_showAllPins );
dlg.SetEnableAutoPan( DrawPanel->m_AutoPAN_Enable ); dlg.SetEnableAutoPan( m_canvas->m_AutoPAN_Enable );
dlg.SetEnableHVBusOrientation( g_HVLines ); dlg.SetEnableHVBusOrientation( g_HVLines );
dlg.SetShowPageLimits( g_ShowPageLimits ); dlg.SetShowPageLimits( g_ShowPageLimits );
dlg.Layout(); dlg.Layout();
@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 ); SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 );
SetGridVisibility( dlg.GetShowGrid() ); SetGridVisibility( dlg.GetShowGrid() );
m_showAllPins = dlg.GetShowHiddenPins(); m_showAllPins = dlg.GetShowHiddenPins();
DrawPanel->m_AutoPAN_Enable = dlg.GetEnableAutoPan(); m_canvas->m_AutoPAN_Enable = dlg.GetEnableAutoPan();
g_HVLines = dlg.GetEnableHVBusOrientation(); g_HVLines = dlg.GetEnableHVBusOrientation();
g_ShowPageLimits = dlg.GetShowPageLimits(); g_ShowPageLimits = dlg.GetShowPageLimits();
@ -247,7 +247,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
} }
} }
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }

View File

@ -21,7 +21,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
if( !curr_item || curr_item->GetFlags() ) if( !curr_item || curr_item->GetFlags() )
return; return;
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( curr_item->Type() ) switch( curr_item->Type() )
{ {
@ -35,7 +35,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
MoveItem( (SCH_ITEM*) newitem, &dc ); MoveItem( (SCH_ITEM*) newitem, &dc );
// Redraw the original part, because StartMovePart() erased it from screen. // Redraw the original part, because StartMovePart() erased it from screen.
curr_item->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
} }
break; break;
@ -49,7 +49,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
MoveItem( (SCH_ITEM*) newitem, &dc ); MoveItem( (SCH_ITEM*) newitem, &dc );
/* Redraw the original part in XOR mode */ /* Redraw the original part in XOR mode */
curr_item->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
} }
break; break;

View File

@ -258,7 +258,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
LoadProjectFile( wxEmptyString, true ); LoadProjectFile( wxEmptyString, true );
Zoom_Automatique( false ); Zoom_Automatique( false );
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->Refresh(); m_canvas->Refresh();
return true; return true;
} }
@ -354,7 +354,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
Zoom_Automatique( false ); Zoom_Automatique( false );
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
return diag; return diag;
} }

View File

@ -208,7 +208,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
/* There may be need to reframe the drawing */ /* There may be need to reframe the drawing */
if( ! DrawPanel->IsPointOnDisplay( pos ) ) if( ! m_canvas->IsPointOnDisplay( pos ) )
{ {
centerAndRedraw = true; centerAndRedraw = true;
} }
@ -221,16 +221,16 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
else else
{ {
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
if( aWarpMouse ) if( aWarpMouse )
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
GetScreen()->SetCrossHairPosition(pos); GetScreen()->SetCrossHairPosition(pos);
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
} }

View File

@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
static wxString lastCommponentName; static wxString lastCommponentName;
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
if( !libname.IsEmpty() ) if( !libname.IsEmpty() )
{ {
@ -122,8 +122,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if ( dlg.ShowModal() == wxID_CANCEL ) if ( dlg.ShowModal() == wxID_CANCEL )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
@ -140,8 +140,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
@ -157,8 +157,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
@ -168,8 +168,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( GetNameOfPartToLoad( this, Library, Name ) == 0 ) if( GetNameOfPartToLoad( this, Library, Name ) == 0 )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
@ -180,8 +180,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
@ -200,14 +200,14 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Entry == NULL ) if( Entry == NULL )
{ {
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( Entry == NULL ) if( Entry == NULL )
{ {
@ -230,7 +230,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
// Set the component value that can differ from component name in lib, for aliases // Set the component value that can differ from component name in lib, for aliases
component->GetField( VALUE )->m_Text = Name; component->GetField( VALUE )->m_Text = Name;
component->DisplayInfo( this ); component->DisplayInfo( this );
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
component->SetFlags( IS_NEW ); component->SetFlags( IS_NEW );
MoveItem( (SCH_ITEM*) component, DC ); MoveItem( (SCH_ITEM*) component, DC );
@ -252,7 +252,7 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
SCH_COMPONENT* component = (SCH_COMPONENT*) item; SCH_COMPONENT* component = (SCH_COMPONENT*) item;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( component->GetFlags() == 0 ) if( component->GetFlags() == 0 )
{ {
@ -260,27 +260,27 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
// Erase the previous component in it's current orientation. // Erase the previous component in it's current orientation.
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
if( component->GetFlags() ) if( component->GetFlags() )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
DrawPanel->RefreshDrawingRect( component->GetBoundingBox() ); m_canvas->RefreshDrawingRect( component->GetBoundingBox() );
component->SetOrientation( aOrientation ); component->SetOrientation( aOrientation );
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( component->GetFlags() ) if( component->GetFlags() )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
GetScreen()->TestDanglingEnds( DrawPanel, &dc ); GetScreen()->TestDanglingEnds( m_canvas, &dc );
OnModify(); OnModify();
} }
@ -296,9 +296,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
wxCHECK_RET( item != NULL && item->Type() == SCH_COMPONENT_T, wxCHECK_RET( item != NULL && item->Type() == SCH_COMPONENT_T,
wxT( "Cannot select unit of invalid schematic item." ) ); wxT( "Cannot select unit of invalid schematic item." ) );
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
SCH_COMPONENT* component = (SCH_COMPONENT*) item; SCH_COMPONENT* component = (SCH_COMPONENT*) item;
@ -330,9 +330,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
SaveCopyInUndoList( component, UR_CHANGED ); SaveCopyInUndoList( component, UR_CHANGED );
if( flags ) if( flags )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
/* Update the unit number. */ /* Update the unit number. */
component->SetUnitSelection( m_CurrentSheet, unit ); component->SetUnitSelection( m_CurrentSheet, unit );
@ -342,11 +342,11 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( flags ) if( flags )
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
OnModify(); OnModify();
} }
@ -372,9 +372,9 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
int flags = DrawComponent->GetFlags(); int flags = DrawComponent->GetFlags();
if( DrawComponent->GetFlags() ) if( DrawComponent->GetFlags() )
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 ); DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 );
@ -392,10 +392,10 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( DrawComponent->IsMoving() ) if( DrawComponent->IsMoving() )
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
GetScreen()->TestDanglingEnds( DrawPanel, DC ); GetScreen()->TestDanglingEnds( m_canvas, DC );
OnModify( ); OnModify( );
} }

View File

@ -280,26 +280,26 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
// update the References // update the References
m_CurrentSheet->UpdateAllScreenReferences(); m_CurrentSheet->UpdateAllScreenReferences();
SetSheetNumberAndCount(); SetSheetNumberAndCount();
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
if( screen->m_FirstRedraw ) if( screen->m_FirstRedraw )
{ {
Zoom_Automatique( false ); Zoom_Automatique( false );
screen->m_FirstRedraw = false; screen->m_FirstRedraw = false;
screen->SetCrossHairPosition( screen->GetScrollCenterPosition() ); screen->SetCrossHairPosition( screen->GetScrollCenterPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
} }
else else
{ {
RedrawScreen( screen->GetScrollCenterPosition(), true ); RedrawScreen( screen->GetScrollCenterPosition(), true );
} }
// Now refresh DrawPanel. Should be not necessary, but because screen has changed // Now refresh m_canvas. Should be not necessary, but because screen has changed
// the previous refresh has set all new draw parameters (scroll position ..) // the previous refresh has set all new draw parameters (scroll position ..)
// but most of time there were some inconsitencies about cursor parameters // but most of time there were some inconsitencies about cursor parameters
// ( previous position of cursor ...) and artefacts can happen // ( previous position of cursor ...) and artefacts can happen
// mainly when sheet size has changed // mainly when sheet size has changed
// This second refresh clears artefacts because at this point, // This second refresh clears artefacts because at this point,
// all parameters are now updated // all parameters are now updated
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -89,7 +89,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
m_lastLibImportPath = fn.GetPath(); m_lastLibImportPath = fn.GetPath();
DisplayLibInfos(); DisplayLibInfos();
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
delete LibTmp; delete LibTmp;

View File

@ -118,7 +118,7 @@ void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event )
wxString CmpName; wxString CmpName;
LIB_ALIAS* LibEntry = NULL; LIB_ALIAS* LibEntry = NULL;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
if( GetScreen()->IsModify() if( GetScreen()->IsModify()
&& !IsOK( this, _( "Current part not saved.\n\nDiscard current changes?" ) ) ) && !IsOK( this, _( "Current part not saved.\n\nDiscard current changes?" ) ) )
@ -235,7 +235,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( GetScreen() == NULL ) if( GetScreen() == NULL )
return; return;
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
if( m_component ) if( m_component )
{ {
@ -246,15 +246,15 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
wxString fieldText = Field->m_Text; wxString fieldText = Field->m_Text;
wxString fieldfullText = Field->GetFullText( m_unit ); wxString fieldfullText = Field->GetFullText( m_unit );
Field->m_Text = fieldfullText; Field->m_Text = fieldfullText;
m_component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit,
m_convert, GR_DEFAULT_DRAWMODE ); m_convert, GR_DEFAULT_DRAWMODE );
Field->m_Text = fieldText; Field->m_Text = fieldText;
} }
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
DisplayLibInfos(); DisplayLibInfos();
UpdateStatusBar(); UpdateStatusBar();
@ -266,7 +266,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
wxFileName fn; wxFileName fn;
wxString msg; wxString msg;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
if( m_library == NULL ) if( m_library == NULL )
{ {
@ -456,7 +456,7 @@ void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
wxArrayString ListNames; wxArrayString ListNames;
wxString msg; wxString msg;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
m_drawItem = NULL; m_drawItem = NULL;
@ -536,7 +536,7 @@ All changes will be lost. Discard changes?" ) ) )
m_aliasName.Empty(); 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?" ) ) ) lost!\n\nClear the current component from the screen?" ) ) )
return; return;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
m_drawItem = NULL; m_drawItem = NULL;
@ -634,7 +634,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
m_mainToolBar->Refresh(); m_mainToolBar->Refresh();
} }

View File

@ -32,8 +32,8 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
{ {
DisplayCmpDoc(); DisplayCmpDoc();
if( DrawPanel->m_AbortRequest ) if( m_canvas->m_AbortRequest )
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
} }
} }
@ -97,12 +97,12 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
case ID_LIBEDIT_ANCHOR_ITEM_BUTT: case ID_LIBEDIT_ANCHOR_ITEM_BUTT:
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
PlaceAnchor(); PlaceAnchor();
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
default: default:
wxFAIL_MSG( wxString::Format( wxT( "Unhandled command ID %d" ), GetToolId() ) ); wxFAIL_MSG( wxString::Format( wxT( "Unhandled command ID %d" ), GetToolId() ) );
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
} }
} }
@ -135,7 +135,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
else else
return; return;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
switch( m_drawItem->Type() ) switch( m_drawItem->Type() )
{ {
@ -187,6 +187,6 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
break; break;
} }
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
} }

View File

@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateItemUsingCursor( aPosition ); item = LocateItemUsingCursor( aPosition );
// If the clarify item selection context menu is aborted, don't show the context menu. // If the clarify item selection context menu is aborted, don't show the context menu.
if( item == NULL && DrawPanel->m_AbortRequest ) if( item == NULL && m_canvas->m_AbortRequest )
{ {
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
return false; return false;
} }

View File

@ -88,9 +88,9 @@ void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg ) void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg )
{ {
wxSize image_size = DrawPanel->GetClientSize(); wxSize image_size = m_canvas->GetClientSize();
wxClientDC dc( DrawPanel ); wxClientDC dc( m_canvas );
wxBitmap bitmap( image_size.x, image_size.y ); wxBitmap bitmap( image_size.x, image_size.y );
wxMemoryDC memdc; wxMemoryDC memdc;
@ -125,7 +125,7 @@ void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode
plot_offset.x = pagesize.x/2; plot_offset.x = pagesize.x/2;
plot_offset.y = pagesize.y/2; plot_offset.y = pagesize.y/2;
m_component->Draw( DrawPanel, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE ); m_component->Draw( m_canvas, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE );
} }

View File

@ -62,8 +62,8 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event )
SetShowDeMorgan( m_component->HasConversion() ); SetShowDeMorgan( m_component->HasConversion() );
DisplayLibInfos(); DisplayLibInfos();
DisplayCmpDoc(); DisplayCmpDoc();
OnModify( ); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -99,5 +99,5 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
DisplayLibInfos(); DisplayLibInfos();
DisplayCmpDoc(); DisplayCmpDoc();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -223,8 +223,8 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
if( DrawPanel ) if( m_canvas )
DrawPanel->m_Block_Enable = true; m_canvas->m_Block_Enable = true;
EnsureActiveLibExists(); EnsureActiveLibExists();
ReCreateMenuBar(); ReCreateMenuBar();
@ -256,7 +256,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
m_auimgr.AddPane( m_optionsToolBar, m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() ); wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
m_auimgr.AddPane( m_messagePanel, m_auimgr.AddPane( m_messagePanel,
@ -382,7 +382,7 @@ double LIB_EDIT_FRAME::BestZoom()
GetScreen()->SetScrollCenterPosition( wxPoint( 0, 0 ) ); GetScreen()->SetScrollCenterPosition( wxPoint( 0, 0 ) );
} }
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
// Reserve a 10% margin around component bounding box. // Reserve a 10% margin around component bounding box.
double margin_scale_factor = 0.8; double margin_scale_factor = 0.8;
@ -562,7 +562,7 @@ void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event )
m_aliasName = m_aliasSelectBox->GetStringSelection(); m_aliasName = m_aliasSelectBox->GetStringSelection();
DisplayCmpDoc(); DisplayCmpDoc();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -575,7 +575,7 @@ void LIB_EDIT_FRAME::OnSelectPart( wxCommandEvent& event )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
m_unit = i + 1; m_unit = i + 1;
DrawPanel->Refresh(); m_canvas->Refresh();
DisplayCmpDoc(); DisplayCmpDoc();
} }
@ -599,7 +599,7 @@ void LIB_EDIT_FRAME::OnViewEntryDoc( wxCommandEvent& event )
void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
{ {
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
if( event.GetId() == ID_DE_MORGAN_NORMAL_BUTT ) if( event.GetId() == ID_DE_MORGAN_NORMAL_BUTT )
m_convert = 1; m_convert = 1;
@ -607,7 +607,7 @@ void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
m_convert = 2; m_convert = 2;
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -616,7 +616,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxGetMousePosition( &pos.x, &pos.y ); wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20; pos.y += 20;
@ -642,23 +642,23 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_LIBEDIT_CANCEL_EDITING: case ID_POPUP_LIBEDIT_CANCEL_EDITING:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
else else
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
break; break;
case ID_POPUP_LIBEDIT_DELETE_ITEM: case ID_POPUP_LIBEDIT_DELETE_ITEM:
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
break; break;
default: default:
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(),
wxEmptyString ); wxEmptyString );
break; break;
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( id ) switch( id )
{ {
@ -678,7 +678,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_LIBEDIT_END_CREATE_ITEM: case ID_POPUP_LIBEDIT_END_CREATE_ITEM:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( m_drawItem ) if( m_drawItem )
{ {
EndDrawGraphicItem( &dc ); EndDrawGraphicItem( &dc );
@ -688,7 +688,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM: case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM:
if( m_drawItem ) if( m_drawItem )
{ {
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
switch( m_drawItem->Type() ) switch( m_drawItem->Type() )
{ {
@ -707,7 +707,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
; ;
} }
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
break; break;
@ -717,12 +717,12 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( m_drawItem == NULL ) if( m_drawItem == NULL )
break; break;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
int oldFlags = m_drawItem->GetFlags(); int oldFlags = m_drawItem->GetFlags();
m_drawItem->ClearFlags(); m_drawItem->ClearFlags();
m_drawItem->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform ); m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform );
( (LIB_POLYLINE*) m_drawItem )->DeleteSegment( GetScreen()->GetCrossHairPosition( true ) ); ( (LIB_POLYLINE*) m_drawItem )->DeleteSegment( GetScreen()->GetCrossHairPosition( true ) );
m_drawItem->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform ); m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform );
m_drawItem->SetFlags( oldFlags ); m_drawItem->SetFlags( oldFlags );
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
break; break;
@ -749,7 +749,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( m_drawItem == NULL ) if( m_drawItem == NULL )
break; break;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( m_drawItem->Type() == LIB_RECTANGLE_T if( m_drawItem->Type() == LIB_RECTANGLE_T
|| m_drawItem->Type() == LIB_CIRCLE_T || m_drawItem->Type() == LIB_CIRCLE_T
|| m_drawItem->Type() == LIB_POLYLINE_T || m_drawItem->Type() == LIB_POLYLINE_T
@ -765,15 +765,15 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( m_drawItem == NULL ) if( m_drawItem == NULL )
break; break;
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
if( m_drawItem->Type() == LIB_FIELD_T ) if( m_drawItem->Type() == LIB_FIELD_T )
{ {
EditField( &dc, (LIB_FIELD*) m_drawItem ); EditField( &dc, (LIB_FIELD*) m_drawItem );
} }
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
break; break;
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM: case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:
@ -784,60 +784,60 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id ); GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case ID_POPUP_ZOOM_BLOCK: case ID_POPUP_ZOOM_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM; GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM;
HandleBlockEnd( &dc ); HandleBlockEnd( &dc );
break; break;
case ID_POPUP_DELETE_BLOCK: case ID_POPUP_DELETE_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE; GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockEnd( &dc ); HandleBlockEnd( &dc );
break; break;
case ID_POPUP_COPY_BLOCK: case ID_POPUP_COPY_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY; GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
case ID_POPUP_SELECT_ITEMS_BLOCK: case ID_POPUP_SELECT_ITEMS_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_SELECT_ITEMS_ONLY; GetScreen()->m_BlockLocate.m_Command = BLOCK_SELECT_ITEMS_ONLY;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockEnd( &dc ); HandleBlockEnd( &dc );
break; break;
case ID_POPUP_MIRROR_Y_BLOCK: case ID_POPUP_MIRROR_Y_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_Y; GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_Y;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
case ID_POPUP_MIRROR_X_BLOCK: case ID_POPUP_MIRROR_X_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_X; GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_X;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
case ID_POPUP_ROTATE_BLOCK: case ID_POPUP_ROTATE_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->m_BlockLocate.m_Command = BLOCK_ROTATE; GetScreen()->m_BlockLocate.m_Command = BLOCK_ROTATE;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
case ID_POPUP_PLACE_BLOCK: case ID_POPUP_PLACE_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
@ -846,7 +846,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
} }
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
if( GetToolId() == ID_NO_TOOL_SELECTED ) if( GetToolId() == ID_NO_TOOL_SELECTED )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
@ -933,7 +933,7 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
/* Deleting old text. */ /* Deleting old text. */
if( DC && !DrawItem->InEditMode() ) if( DC && !DrawItem->InEditMode() )
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform ); DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform );
DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem ); DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem );
frame->ShowModal(); frame->ShowModal();
@ -942,7 +942,7 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
/* Display new text. */ /* Display new text. */
if( DC && !DrawItem->InEditMode() ) if( DC && !DrawItem->InEditMode() )
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, NULL, DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, NULL,
DefaultTransform ); DefaultTransform );
} }
@ -968,7 +968,7 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
DisplayLibInfos(); DisplayLibInfos();
DisplayCmpDoc(); DisplayCmpDoc();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -984,11 +984,11 @@ void LIB_EDIT_FRAME::OnCreateNewPartFromExisting( wxCommandEvent& event )
wxCHECK_RET( m_component != NULL, wxCHECK_RET( m_component != NULL,
wxT( "Cannot create new part from non-existent current part." ) ); wxT( "Cannot create new part from non-existent current part." ) );
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
EditField( &dc, &m_component->GetValueField() ); EditField( &dc, &m_component->GetValueField() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
@ -998,13 +998,13 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
if( GetToolId() == ID_NO_TOOL_SELECTED ) if( GetToolId() == ID_NO_TOOL_SELECTED )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(),
wxEmptyString ); wxEmptyString );
switch( id ) switch( id )
{ {
case ID_NO_TOOL_SELECTED: case ID_NO_TOOL_SELECTED:
SetToolID( id, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( id, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_LIBEDIT_PIN_BUTT: case ID_LIBEDIT_PIN_BUTT:
@ -1018,7 +1018,7 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN ); cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
} }
break; break;
@ -1047,15 +1047,15 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
break; break;
case ID_LIBEDIT_IMPORT_BODY_BUTT: case ID_LIBEDIT_IMPORT_BODY_BUTT:
SetToolID( id, DrawPanel->GetDefaultCursor(), _( "Import" ) ); SetToolID( id, m_canvas->GetDefaultCursor(), _( "Import" ) );
LoadOneSymbol(); LoadOneSymbol();
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_LIBEDIT_EXPORT_BODY_BUTT: case ID_LIBEDIT_EXPORT_BODY_BUTT:
SetToolID( id, DrawPanel->GetDefaultCursor(), _( "Export" ) ); SetToolID( id, m_canvas->GetDefaultCursor(), _( "Export" ) );
SaveOneSymbol(); SaveOneSymbol();
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_LIBEDIT_DELETE_ITEM_BUTT: case ID_LIBEDIT_DELETE_ITEM_BUTT:
@ -1072,7 +1072,7 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
break; break;
} }
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
} }
@ -1093,7 +1093,7 @@ void LIB_EDIT_FRAME::OnRotateItem( wxCommandEvent& aEvent )
if( !m_drawItem->InEditMode() ) if( !m_drawItem->InEditMode() )
m_drawItem->ClearFlags(); m_drawItem->ClearFlags();
DrawPanel->Refresh(); m_canvas->Refresh();
if( GetToolId() == ID_NO_TOOL_SELECTED ) if( GetToolId() == ID_NO_TOOL_SELECTED )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
@ -1160,9 +1160,9 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF
// Set to NULL in case user aborts the clarification context menu. // Set to NULL in case user aborts the clarification context menu.
m_drawItem = NULL; m_drawItem = NULL;
DrawPanel->m_AbortRequest = true; // Changed to false if an item is selected m_canvas->m_AbortRequest = true; // Changed to false if an item is selected
PopupMenu( &selectMenu ); PopupMenu( &selectMenu );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
item = m_drawItem; item = m_drawItem;
} }
} }
@ -1180,7 +1180,7 @@ void LIB_EDIT_FRAME::deleteItem( wxDC* aDC )
{ {
wxCHECK_RET( m_drawItem != NULL, wxT( "No drawing item selected to delete." ) ); wxCHECK_RET( m_drawItem != NULL, wxT( "No drawing item selected to delete." ) );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
if( m_drawItem->Type() == LIB_PIN_T ) if( m_drawItem->Type() == LIB_PIN_T )
@ -1188,7 +1188,7 @@ void LIB_EDIT_FRAME::deleteItem( wxDC* aDC )
LIB_PIN* pin = (LIB_PIN*) m_drawItem; LIB_PIN* pin = (LIB_PIN*) m_drawItem;
wxPoint pos = pin->GetPosition(); wxPoint pos = pin->GetPosition();
m_component->RemoveDrawItem( (LIB_ITEM*) pin, DrawPanel, aDC ); m_component->RemoveDrawItem( (LIB_ITEM*) pin, m_canvas, aDC );
if( SynchronizePins() ) if( SynchronizePins() )
{ {
@ -1206,25 +1206,25 @@ void LIB_EDIT_FRAME::deleteItem( wxDC* aDC )
} }
} }
DrawPanel->Refresh(); m_canvas->Refresh();
} }
else else
{ {
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_endMouseCaptureCallback( DrawPanel, aDC ); m_canvas->m_endMouseCaptureCallback( m_canvas, aDC );
} }
else else
{ {
m_component->RemoveDrawItem( m_drawItem, DrawPanel, aDC ); m_component->RemoveDrawItem( m_drawItem, m_canvas, aDC );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
} }
m_drawItem = NULL; m_drawItem = NULL;
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
OnModify(); OnModify();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
} }
@ -1237,7 +1237,7 @@ void LIB_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
&& (index >= 0 && index < m_collectedItems.GetCount()) ) && (index >= 0 && index < m_collectedItems.GetCount()) )
{ {
LIB_ITEM* item = m_collectedItems[index]; LIB_ITEM* item = m_collectedItems[index];
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
m_drawItem = item; m_drawItem = item;
} }
} }

View File

@ -144,7 +144,7 @@ this component?" ),
if( !aField->InEditMode() ) if( !aField->InEditMode() )
{ {
SaveCopyInUndoList( parent ); SaveCopyInUndoList( parent );
( (LIB_ITEM*) aField )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, ( (LIB_ITEM*) aField )->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode,
&fieldText, DefaultTransform ); &fieldText, DefaultTransform );
} }
@ -152,7 +152,7 @@ this component?" ),
if( !aField->InEditMode() ) if( !aField->InEditMode() )
{ {
fieldText = aField->GetFullText( m_unit ); fieldText = aField->GetFullText( m_unit );
( (LIB_ITEM*) aField )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, ( (LIB_ITEM*) aField )->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode,
&fieldText, DefaultTransform ); &fieldText, DefaultTransform );
} }

View File

@ -57,7 +57,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) ) if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) )
{ {
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
if( item && item->GetFlags() ) if( item && item->GetFlags() )
@ -79,7 +79,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
item->Place( this, aDC ); item->Place( this, aDC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
return; return;
case SCH_LINE_T: // May already be drawing segment. case SCH_LINE_T: // May already be drawing segment.
@ -129,16 +129,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
m_itemToRepeat = AddNoConnect( aDC, gridPosition ); m_itemToRepeat = AddNoConnect( aDC, gridPosition );
GetScreen()->SetCurItem( m_itemToRepeat ); GetScreen()->SetCurItem( m_itemToRepeat );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case ID_JUNCTION_BUTT: case ID_JUNCTION_BUTT:
@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
m_itemToRepeat = AddJunction( aDC, gridPosition, true ); m_itemToRepeat = AddJunction( aDC, gridPosition, true );
GetScreen()->SetCurItem( m_itemToRepeat ); GetScreen()->SetCurItem( m_itemToRepeat );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case ID_WIRETOBUS_ENTRY_BUTT: case ID_WIRETOBUS_ENTRY_BUTT:
@ -165,15 +165,15 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ? item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ?
WIRE_TO_BUS : BUS_TO_BUS ); WIRE_TO_BUS : BUS_TO_BUS );
GetScreen()->SetCurItem( item ); GetScreen()->SetCurItem( item );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
break; break;
@ -183,29 +183,29 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_WIRE_BUTT: case ID_WIRE_BUTT:
BeginSegment( aDC, LAYER_WIRE ); BeginSegment( aDC, LAYER_WIRE );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
break; break;
case ID_BUS_BUTT: case ID_BUS_BUTT:
BeginSegment( aDC, LAYER_BUS ); BeginSegment( aDC, LAYER_BUS );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
break; break;
case ID_LINE_COMMENT_BUTT: case ID_LINE_COMMENT_BUTT:
BeginSegment( aDC, LAYER_NOTES ); BeginSegment( aDC, LAYER_NOTES );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
break; break;
case ID_TEXT_COMMENT_BUTT: case ID_TEXT_COMMENT_BUTT:
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) ); GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
break; break;
@ -213,12 +213,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateNewImage( aDC ) ); GetScreen()->SetCurItem( CreateNewImage( aDC ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
} }
break; break;
@ -226,14 +226,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) ); GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
@ -247,14 +247,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( GetToolId() == ID_HIERLABEL_BUTT ) if( GetToolId() == ID_HIERLABEL_BUTT )
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) ); GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
@ -262,14 +262,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{ {
GetScreen()->SetCurItem( CreateSheet( aDC ) ); GetScreen()->SetCurItem( CreateSheet( aDC ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
@ -292,7 +292,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
item->Place( this, aDC ); item->Place( this, aDC );
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
@ -300,14 +300,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( (item == NULL) || (item->GetFlags() == 0) ) if( (item == NULL) || (item->GetFlags() == 0) )
{ {
GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) ); GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
@ -316,19 +316,19 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{ {
GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ), GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ),
s_PowerNameList, false ) ); s_PowerNameList, false ) );
DrawPanel->m_AutoPAN_Request = true; m_canvas->m_AutoPAN_Request = true;
} }
else else
{ {
item->Place( this, aDC ); item->Place( this, aDC );
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
default: default:
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
wxFAIL_MSG( wxT( "SCH_EDIT_FRAME::OnLeftClick invalid tool ID <" ) + wxFAIL_MSG( wxT( "SCH_EDIT_FRAME::OnLeftClick invalid tool ID <" ) +
wxString::Format( wxT( "%d> selected." ), GetToolId() ) ); wxString::Format( wxT( "%d> selected." ), GetToolId() ) );
} }
@ -368,7 +368,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
case SCH_COMPONENT_T: case SCH_COMPONENT_T:
EditComponent( (SCH_COMPONENT*) item ); EditComponent( (SCH_COMPONENT*) item );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case SCH_TEXT_T: case SCH_TEXT_T:
@ -384,7 +384,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
case SCH_FIELD_T: case SCH_FIELD_T:
EditComponentFieldText( (SCH_FIELD*) item, aDC ); EditComponentFieldText( (SCH_FIELD*) item, aDC );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case SCH_MARKER_T: case SCH_MARKER_T:

View File

@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = GetScreen()->IsBlockActive(); bool BlockActive = GetScreen()->IsBlockActive();
// Do not start a block command on context menu. // Do not start a block command on context menu.
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
if( BlockActive ) if( BlockActive )
{ {
@ -91,9 +91,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins ); item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins );
// If the clarify item selection context menu is aborted, don't show the context menu. // If the clarify item selection context menu is aborted, don't show the context menu.
if( item == NULL && DrawPanel->m_AbortRequest ) if( item == NULL && m_canvas->m_AbortRequest )
{ {
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
return false; return false;
} }
} }

View File

@ -142,6 +142,7 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList )
void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem ) void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
{ {
wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) ); wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) );
if( aItem == NULL ) if( aItem == NULL )
return; return;
@ -155,7 +156,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
wxT( "Sheet label has invalid parent item." ) ); wxT( "Sheet label has invalid parent item." ) );
SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED ); SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED );
sheet->RemovePin( (SCH_SHEET_PIN*) aItem ); sheet->RemovePin( (SCH_SHEET_PIN*) aItem );
DrawPanel->RefreshDrawingRect( sheet->GetBoundingBox() ); m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
} }
else else
{ {
@ -165,7 +166,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
aItem->SetBack( NULL ); // Only one struct -> no link aItem->SetBack( NULL ); // Only one struct -> no link
SaveCopyInUndoList( aItem, UR_DELETED ); SaveCopyInUndoList( aItem, UR_DELETED );
DrawPanel->RefreshDrawingRect( aItem->GetBoundingBox() ); m_canvas->RefreshDrawingRect( aItem->GetBoundingBox() );
} }
} }

View File

@ -116,7 +116,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
if( pin->IsNew() ) if( pin->IsNew() )
{ {
pin->SetFlags( IS_CANCELLED ); pin->SetFlags( IS_CANCELLED );
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
} }
return; return;
} }
@ -152,7 +152,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
OnModify( ); OnModify( );
pin->DisplayInfo( this ); pin->DisplayInfo( this );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
pin->EnableEditMode( false, m_editPinsPerPartOrConvert ); pin->EnableEditMode( false, m_editPinsPerPartOrConvert );
@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
if( ask_for_pin && SynchronizePins() ) if( ask_for_pin && SynchronizePins() )
{ {
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
status = status =
IsOK( this, _( "This position is already occupied by \ IsOK( this, _( "This position is already occupied by \
another pin. Continue?" ) ); another pin. Continue?" ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
if( !status ) if( !status )
return; return;
@ -241,7 +241,7 @@ another pin. Continue?" ) );
else else
SaveCopyInUndoList( m_component ); SaveCopyInUndoList( m_component );
DrawPanel->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
OnModify(); OnModify();
CurrentPin->SetPosition( newpos ); CurrentPin->SetPosition( newpos );
@ -268,11 +268,11 @@ another pin. Continue?" ) );
Pin->ClearFlags(); Pin->ClearFlags();
} }
DrawPanel->CrossHairOff( DC ); m_canvas->CrossHairOff( DC );
bool showPinText = true; bool showPinText = true;
CurrentPin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, CurrentPin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE,
&showPinText, DefaultTransform ); &showPinText, DefaultTransform );
DrawPanel->CrossHairOn( DC ); m_canvas->CrossHairOn( DC );
m_drawItem = NULL; m_drawItem = NULL;
} }
@ -313,13 +313,13 @@ void LIB_EDIT_FRAME::StartMovePin( wxDC* DC )
startPos.x = OldPos.x; startPos.x = OldPos.x;
startPos.y = -OldPos.y; startPos.y = -OldPos.y;
DrawPanel->CrossHairOff( DC ); m_canvas->CrossHairOff( DC );
GetScreen()->SetCrossHairPosition( startPos ); GetScreen()->SetCrossHairPosition( startPos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
CurrentPin->DisplayInfo( this ); CurrentPin->DisplayInfo( this );
DrawPanel->SetMouseCapture( DrawMovePin, AbortPinMove ); m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
DrawPanel->CrossHairOn( DC ); m_canvas->CrossHairOn( DC );
} }
@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit ); pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
pin->SetVisible( LastPinVisible ); pin->SetVisible( LastPinVisible );
PinPreviousPos = pin->GetPosition(); PinPreviousPos = pin->GetPosition();
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN ); cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
if( pin->GetFlags() & IS_CANCELLED ) if( pin->GetFlags() & IS_CANCELLED )
{ {
@ -412,10 +412,10 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
else else
{ {
ClearTempCopyComponent(); ClearTempCopyComponent();
DrawPanel->SetMouseCapture( DrawMovePin, AbortPinMove ); m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
if( DC ) if( DC )
pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText, pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText,
DefaultTransform ); DefaultTransform );
} }
@ -503,7 +503,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
if( selected && !Pin->IsSelected() ) if( selected && !Pin->IsSelected() )
continue; continue;
Pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &showPinText, DefaultTransform ); Pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode, &showPinText, DefaultTransform );
switch( id ) switch( id )
{ {
@ -520,7 +520,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
break; break;
} }
Pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &showPinText, Pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &showPinText,
DefaultTransform ); DefaultTransform );
} }
} }
@ -553,7 +553,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
Pin->SetFlags( IS_LINKED ); Pin->SetFlags( IS_LINKED );
wxPoint savepos = GetScreen()->GetCrossHairPosition(); wxPoint savepos = GetScreen()->GetCrossHairPosition();
DrawPanel->CrossHairOff( DC ); m_canvas->CrossHairOff( DC );
GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x, -Pin->GetPosition().y ) ); GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x, -Pin->GetPosition().y ) );
// Add this new pin in list, and creates pins for others parts if needed // Add this new pin in list, and creates pins for others parts if needed
@ -563,7 +563,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
m_lastDrawItem = Pin; m_lastDrawItem = Pin;
GetScreen()->SetCrossHairPosition( savepos ); GetScreen()->SetCrossHairPosition( savepos );
DrawPanel->CrossHairOn( DC ); m_canvas->CrossHairOn( DC );
Pin->DisplayInfo( this ); Pin->DisplayInfo( this );
OnModify( ); OnModify( );

View File

@ -345,14 +345,14 @@ bool SCH_FIELD::Save( FILE* aFile ) const
void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC ) void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
frame->DrawPanel->SetMouseCapture( NULL, NULL ); frame->GetCanvas()->SetMouseCapture( NULL, NULL );
SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent(); SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent();
// save old cmp in undo list // save old cmp in undo list
frame->SaveUndoItemInUndoList( component ); frame->SaveUndoItemInUndoList( component );
Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
ClearFlags(); ClearFlags();
frame->GetScreen()->SetCurItem( NULL ); frame->GetScreen()->SetCurItem( NULL );
frame->OnModify(); frame->OnModify();

View File

@ -484,12 +484,12 @@ void SCH_SHEET::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
// fix size and position of the new sheet // fix size and position of the new sheet
// using the last values set by the m_mouseCaptureCallback function // using the last values set by the m_mouseCaptureCallback function
frame->DrawPanel->SetMouseCapture( NULL, NULL ); frame->GetCanvas()->SetMouseCapture( NULL, NULL );
if( !frame->EditSheet( this, DC ) ) if( !frame->EditSheet( this, DC ) )
{ {
frame->GetScreen()->SetCurItem( NULL ); frame->GetScreen()->SetCurItem( NULL );
Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), g_XorMode );
delete this; delete this;
return; return;
} }

View File

@ -144,11 +144,11 @@ void SCH_SHEET_PIN::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
} }
ClearFlags(); ClearFlags();
sheet->Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); sheet->Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
// Make sure we don't call the abort move function. // Make sure we don't call the abort move function.
aFrame->DrawPanel->SetMouseCapture( NULL, NULL ); aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
aFrame->DrawPanel->EndMouseCapture(); aFrame->GetCanvas()->EndMouseCapture();
} }

View File

@ -100,17 +100,17 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_DELETE: case ID_POPUP_SCH_DELETE:
// Stop the current command (if any) but keep the current tool // Stop the current command (if any) but keep the current tool
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
break; break;
default: default:
// Stop the current command and deselect the current tool // Stop the current command and deselect the current tool
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
break; break;
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
item = screen->GetCurItem(); // Can be modified by previous calls. item = screen->GetCurItem(); // Can be modified by previous calls.
switch( id ) switch( id )
@ -134,30 +134,30 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_SCH_ENTRY_SELECT_SLASH: case ID_POPUP_SCH_ENTRY_SELECT_SLASH:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
SetBusEntryShape( &dc, (SCH_BUS_ENTRY*) item, '/' ); SetBusEntryShape( &dc, (SCH_BUS_ENTRY*) item, '/' );
break; break;
case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH: case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
SetBusEntryShape( &dc, (SCH_BUS_ENTRY*) item, '\\' ); SetBusEntryShape( &dc, (SCH_BUS_ENTRY*) item, '\\' );
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
SetToolID( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString ); SetToolID( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString );
} }
else else
{ {
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
} }
break; break;
case ID_POPUP_END_LINE: case ID_POPUP_END_LINE:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
EndSegment( &dc ); EndSegment( &dc );
break; break;
@ -168,24 +168,24 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_DELETE_NODE: case ID_POPUP_SCH_DELETE_NODE:
case ID_POPUP_SCH_DELETE_CONNECTION: case ID_POPUP_SCH_DELETE_CONNECTION:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DeleteConnection( id == ID_POPUP_SCH_DELETE_CONNECTION ); DeleteConnection( id == ID_POPUP_SCH_DELETE_CONNECTION );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_POPUP_SCH_BREAK_WIRE: case ID_POPUP_SCH_BREAK_WIRE:
{ {
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
SCH_ITEM* oldWiresList = screen->ExtractWires( true ); SCH_ITEM* oldWiresList = screen->ExtractWires( true );
screen->BreakSegment( screen->GetCrossHairPosition() ); screen->BreakSegment( screen->GetCrossHairPosition() );
if( oldWiresList ) if( oldWiresList )
SaveCopyInUndoList( oldWiresList, UR_WIRE_IMAGE ); SaveCopyInUndoList( oldWiresList, UR_WIRE_IMAGE );
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
} }
break; break;
@ -197,19 +197,19 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
DeleteItem( item ); DeleteItem( item );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
SetSheetNumberAndCount(); SetSheetNumberAndCount();
OnModify(); OnModify();
break; break;
case ID_POPUP_SCH_END_SHEET: case ID_POPUP_SCH_END_SHEET:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
item->Place( this, &dc ); item->Place( this, &dc );
break; break;
case ID_POPUP_SCH_RESIZE_SHEET: case ID_POPUP_SCH_RESIZE_SHEET:
ReSizeSheet( (SCH_SHEET*) item, &dc ); ReSizeSheet( (SCH_SHEET*) item, &dc );
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
break; break;
case ID_POPUP_IMPORT_GLABEL: case ID_POPUP_IMPORT_GLABEL:
@ -236,12 +236,12 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SaveCopyInUndoList( sheet, UR_CHANGED ); SaveCopyInUndoList( sheet, UR_CHANGED );
sheet->CleanupSheet(); sheet->CleanupSheet();
OnModify(); OnModify();
DrawPanel->RefreshDrawingRect( sheet->GetBoundingBox() ); m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
} }
break; break;
case ID_POPUP_SCH_INIT_CMP: case ID_POPUP_SCH_INIT_CMP:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case ID_POPUP_SCH_EDIT_CONVERT_CMP: case ID_POPUP_SCH_EDIT_CONVERT_CMP:
@ -249,7 +249,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
// Ensure the struct is a component (could be a struct of a component, like Field, text..) // Ensure the struct is a component (could be a struct of a component, like Field, text..)
if( item && item->Type() == SCH_COMPONENT_T ) if( item && item->Type() == SCH_COMPONENT_T )
{ {
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
ConvertPart( (SCH_COMPONENT*) item, &dc ); ConvertPart( (SCH_COMPONENT*) item, &dc );
} }
@ -291,8 +291,8 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PLACE_BLOCK: case ID_POPUP_PLACE_BLOCK:
DrawPanel->m_AutoPAN_Request = false; m_canvas->m_AutoPAN_Request = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
@ -301,25 +301,25 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_DELETE_BLOCK: case ID_POPUP_DELETE_BLOCK:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockEndByPopUp( BLOCK_DELETE, &dc ); HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
SetSheetNumberAndCount(); SetSheetNumberAndCount();
break; break;
case ID_POPUP_COPY_BLOCK: case ID_POPUP_COPY_BLOCK:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockEndByPopUp( BLOCK_COPY, &dc ); HandleBlockEndByPopUp( BLOCK_COPY, &dc );
break; break;
case ID_POPUP_DRAG_BLOCK: case ID_POPUP_DRAG_BLOCK:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
HandleBlockEndByPopUp( BLOCK_DRAG, &dc ); HandleBlockEndByPopUp( BLOCK_DRAG, &dc );
break; break;
case ID_POPUP_SCH_ADD_JUNCTION: case ID_POPUP_SCH_ADD_JUNCTION:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
screen->SetCurItem( AddJunction( &dc, screen->GetCrossHairPosition(), true ) ); screen->SetCurItem( AddJunction( &dc, screen->GetCrossHairPosition(), true ) );
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
break; break;
@ -332,7 +332,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( item ) if( item )
{ {
item->Place( this, &dc ); item->Place( this, &dc );
screen->TestDanglingEnds( DrawPanel, &dc ); screen->TestDanglingEnds( m_canvas, &dc );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
} }
@ -380,7 +380,7 @@ void SCH_EDIT_FRAME::OnMoveItem( wxCommandEvent& aEvent )
return; return;
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( item->Type() ) switch( item->Type() )
{ {
@ -426,18 +426,18 @@ void SCH_EDIT_FRAME::OnCancelCurrentCommand( wxCommandEvent& aEvent )
if( screen->IsBlockActive() ) if( screen->IsBlockActive() )
{ {
DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) ); m_canvas->SetCursor( wxCursor( m_canvas->GetDefaultCursor() ) );
screen->ClearBlockCommand(); screen->ClearBlockCommand();
// Stop the current command (if any) but keep the current tool // Stop the current command (if any) but keep the current tool
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
} }
else else
{ {
if( DrawPanel->IsMouseCaptured() ) // Stop the current command but keep the current tool if( m_canvas->IsMouseCaptured() ) // Stop the current command but keep the current tool
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
else // Deselect current tool else // Deselect current tool
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
} }
} }
@ -447,12 +447,12 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
int id = aEvent.GetId(); int id = aEvent.GetId();
// Stop the current command and deselect the current tool. // Stop the current command and deselect the current tool.
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
switch( id ) switch( id )
{ {
case ID_NO_TOOL_SELECTED: case ID_NO_TOOL_SELECTED:
SetToolID( id, DrawPanel->GetDefaultCursor(), _( "No tool selected" ) ); SetToolID( id, m_canvas->GetDefaultCursor(), _( "No tool selected" ) );
break; break;
case ID_HIERARCHY_PUSH_POP_BUTT: case ID_HIERARCHY_PUSH_POP_BUTT:
@ -542,7 +542,7 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
wxPoint pos = data->GetPosition(); wxPoint pos = data->GetPosition();
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
OnLeftClick( &dc, pos ); OnLeftClick( &dc, pos );
} }
} }
@ -563,7 +563,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool aFullConnection )
if( screen->GetConnection( pos, pickList, aFullConnection ) != 0 ) if( screen->GetConnection( pos, pickList, aFullConnection ) != 0 )
{ {
DeleteItemsInList( DrawPanel, pickList ); DeleteItemsInList( m_canvas, pickList );
OnModify(); OnModify();
} }
} }
@ -585,7 +585,7 @@ bool SCH_EDIT_FRAME::DeleteItemAtCrossHair( wxDC* DC )
DeleteItem( item ); DeleteItem( item );
if( itemHasConnections ) if( itemHasConnections )
screen->TestDanglingEnds( DrawPanel, DC ); screen->TestDanglingEnds( m_canvas, DC );
OnModify(); OnModify();
return true; return true;
@ -676,18 +676,18 @@ void SCH_EDIT_FRAME::MoveItem( SCH_ITEM* aItem, wxDC* aDC )
aItem->SetFlags( IS_MOVED ); aItem->SetFlags( IS_MOVED );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
if( aItem->Type() != SCH_SHEET_PIN_T ) if( aItem->Type() != SCH_SHEET_PIN_T )
GetScreen()->SetCrossHairPosition( aItem->GetPosition() ); GetScreen()->SetCrossHairPosition( aItem->GetPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
OnModify(); OnModify();
DrawPanel->SetMouseCapture( moveItem, abortMoveItem ); m_canvas->SetMouseCapture( moveItem, abortMoveItem );
GetScreen()->SetCurItem( aItem ); GetScreen()->SetCurItem( aItem );
moveItem( DrawPanel, aDC, wxDefaultPosition, true ); moveItem( m_canvas, aDC, wxDefaultPosition, true );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
} }
@ -696,7 +696,7 @@ void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
SCH_ITEM* item = screen->GetCurItem(); SCH_ITEM* item = screen->GetCurItem();
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
if( item == NULL ) if( item == NULL )
{ {
@ -739,12 +739,12 @@ void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
case SCH_LABEL_T: case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T: case SCH_GLOBAL_LABEL_T:
case SCH_HIERARCHICAL_LABEL_T: case SCH_HIERARCHICAL_LABEL_T:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
ChangeTextOrient( (SCH_TEXT*) item, &dc ); ChangeTextOrient( (SCH_TEXT*) item, &dc );
break; break;
case SCH_FIELD_T: case SCH_FIELD_T:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
RotateField( (SCH_FIELD*) item, &dc ); RotateField( (SCH_FIELD*) item, &dc );
break; break;
@ -768,7 +768,7 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent )
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
SCH_ITEM* item = screen->GetCurItem(); SCH_ITEM* item = screen->GetCurItem();
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
if( item == NULL ) if( item == NULL )
{ {
@ -856,7 +856,7 @@ void SCH_EDIT_FRAME::OnDragItem( wxCommandEvent& aEvent )
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
SCH_ITEM* item = screen->GetCurItem(); SCH_ITEM* item = screen->GetCurItem();
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
if( item == NULL ) if( item == NULL )
{ {
@ -889,7 +889,7 @@ void SCH_EDIT_FRAME::OnDragItem( wxCommandEvent& aEvent )
case SCH_GLOBAL_LABEL_T: case SCH_GLOBAL_LABEL_T:
case SCH_HIERARCHICAL_LABEL_T: case SCH_HIERARCHICAL_LABEL_T:
case SCH_SHEET_T: case SCH_SHEET_T:
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
// The easiest way to handle a drag component or sheet command // The easiest way to handle a drag component or sheet command
// is to simulate a block drag command // is to simulate a block drag command
@ -920,7 +920,7 @@ void SCH_EDIT_FRAME::OnOrient( wxCommandEvent& aEvent )
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
SCH_ITEM* item = screen->GetCurItem(); SCH_ITEM* item = screen->GetCurItem();
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
if( item == NULL ) if( item == NULL )
{ {

View File

@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::GetSchematicFromUndoList( wxCommandEvent& event )
SetSheetNumberAndCount(); SetSheetNumberAndCount();
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -385,5 +385,5 @@ void SCH_EDIT_FRAME::GetSchematicFromRedoList( wxCommandEvent& event )
SetSheetNumberAndCount(); SetSheetNumberAndCount();
GetScreen()->TestDanglingEnds(); GetScreen()->TestDanglingEnds();
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -224,8 +224,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( DrawPanel ) if( m_canvas )
DrawPanel->m_Block_Enable = true; m_canvas->m_Block_Enable = true;
ReCreateMenuBar(); ReCreateMenuBar();
ReCreateHToolbar(); ReCreateHToolbar();
@ -260,8 +260,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
m_auimgr.AddPane( m_optionsToolBar, m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() ); wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
if( DrawPanel ) if( m_canvas )
m_auimgr.AddPane( DrawPanel, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); m_auimgr.AddPane( m_canvas, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
if( m_messagePanel ) if( m_messagePanel )
m_auimgr.AddPane( m_messagePanel, wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom(). m_auimgr.AddPane( m_messagePanel, wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().
@ -492,7 +492,7 @@ double SCH_EDIT_FRAME::BestZoom()
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x; dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y; dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
// Reserve no margin because best zoom shows the full page // Reserve no margin because best zoom shows the full page
// and margins are already included in function that draws the sheet refernces // and margins are already included in function that draws the sheet refernces
@ -653,7 +653,7 @@ void SCH_EDIT_FRAME::OnFindItems( wxCommandEvent& aEvent )
wxCHECK_RET( m_findReplaceData != NULL, wxCHECK_RET( m_findReplaceData != NULL,
wxT( "Forgot to create find/replace data. Bad Programmer!" ) ); wxT( "Forgot to create find/replace data. Bad Programmer!" ) );
this->DrawPanel->m_IgnoreMouseEvents = true; this->GetCanvas()->m_IgnoreMouseEvents = true;
if( m_dlgFindReplace ) if( m_dlgFindReplace )
{ {
@ -704,7 +704,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event )
m_dlgFindReplace = NULL; m_dlgFindReplace = NULL;
} }
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
} }
@ -722,7 +722,7 @@ void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event )
void SCH_EDIT_FRAME::OnLoadStuffFile( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnLoadStuffFile( wxCommandEvent& event )
{ {
ReadInputStuffFile(); ReadInputStuffFile();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -876,7 +876,7 @@ void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData ) void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData )
{ {
GetScreen()->Draw( DrawPanel, aDC, GR_DEFAULT_DRAWMODE ); GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness );
} }
@ -890,7 +890,7 @@ void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
&& (index >= 0 && index < m_collectedItems.GetCount()) ) && (index >= 0 && index < m_collectedItems.GetCount()) )
{ {
SCH_ITEM* item = m_collectedItems[index]; SCH_ITEM* item = m_collectedItems[index];
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
GetScreen()->SetCurItem( item ); GetScreen()->SetCurItem( item );
} }
} }

View File

@ -163,8 +163,8 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
} }
} }
aSheet->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
if( isUndoable ) if( isUndoable )
SaveCopyInUndoList( aSheet, UR_CHANGED ); SaveCopyInUndoList( aSheet, UR_CHANGED );
@ -203,9 +203,9 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
if( aSheet->GetName().IsEmpty() ) if( aSheet->GetName().IsEmpty() )
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) ); aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
aSheet->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
OnModify(); OnModify();
return true; return true;
@ -320,12 +320,12 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
// also need to update the hierarchy, if we are adding // also need to update the hierarchy, if we are adding
// a sheet to a screen that already has multiple instances (!) // a sheet to a screen that already has multiple instances (!)
GetScreen()->SetCurItem( sheet ); GetScreen()->SetCurItem( sheet );
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() ); GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
return sheet; return sheet;
} }
@ -340,16 +340,16 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
wxString::Format( wxT( "Cannot perform sheet resize on %s object." ), wxString::Format( wxT( "Cannot perform sheet resize on %s object." ),
GetChars( aSheet->GetClass() ) ) ); GetChars( aSheet->GetClass() ) ) );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aSheet->GetResizePosition() ); GetScreen()->SetCrossHairPosition( aSheet->GetResizePosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
SetUndoItem( aSheet ); SetUndoItem( aSheet );
aSheet->SetFlags( IS_RESIZED ); aSheet->SetFlags( IS_RESIZED );
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo
SetUndoItem( aSheet ); SetUndoItem( aSheet );
@ -361,15 +361,15 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC )
if( ( aSheet == NULL ) || ( aSheet->Type() != SCH_SHEET_T ) ) if( ( aSheet == NULL ) || ( aSheet->Type() != SCH_SHEET_T ) )
return; return;
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( aSheet->GetPosition() ); GetScreen()->SetCrossHairPosition( aSheet->GetPosition() );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( !aSheet->IsNew() ) if( !aSheet->IsNew() )
SetUndoItem( aSheet ); SetUndoItem( aSheet );
aSheet->SetFlags( IS_MOVED ); aSheet->SetFlags( IS_MOVED );
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
} }

View File

@ -75,7 +75,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
return wxID_CANCEL; return wxID_CANCEL;
if( aDC ) if( aDC )
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode ); aSheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
if( !aSheetPin->IsNew() ) if( !aSheetPin->IsNew() )
{ {
@ -89,7 +89,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
aSheetPin->SetShape( dlg.GetConnectionType() ); aSheetPin->SetShape( dlg.GetConnectionType() );
if( aDC ) if( aDC )
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); aSheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
return wxID_OK; return wxID_OK;
} }

View File

@ -94,7 +94,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem )
OnModify( ); OnModify( );
DrawItem->DisplayInfo( this ); DrawItem->DisplayInfo( this );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -123,7 +123,7 @@ static void AbortSymbolTraceOn( EDA_DRAW_PANEL* Panel, wxDC* DC )
LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
{ {
DrawPanel->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn ); m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
wxPoint drawPos = GetScreen()->GetCrossHairPosition( true ); wxPoint drawPos = GetScreen()->GetCrossHairPosition( true );
// no temp copy -> the current version of component will be used for Undo // no temp copy -> the current version of component will be used for Undo
@ -155,10 +155,10 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
Text->m_Orient = m_textOrientation; Text->m_Orient = m_textOrientation;
// Enter the graphic text info // Enter the graphic text info
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
EditSymbolText( NULL, Text ); EditSymbolText( NULL, Text );
DrawPanel->m_IgnoreMouseEvents = false; m_canvas->m_IgnoreMouseEvents = false;
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( Text->m_Text.IsEmpty() ) if( Text->m_Text.IsEmpty() )
{ {
@ -188,16 +188,16 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
m_drawItem->SetConvert( m_convert ); m_drawItem->SetConvert( m_convert );
// Draw initial symbol: // Draw initial symbol:
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
else else
{ {
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
return NULL; return NULL;
} }
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
return m_drawItem; return m_drawItem;
} }
@ -214,7 +214,7 @@ void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC )
if( m_drawItem->ContinueEdit( pos ) ) if( m_drawItem->ContinueEdit( pos ) )
{ {
m_drawItem->Draw( DrawPanel, DC, pos, -1, g_XorMode, NULL, DefaultTransform ); m_drawItem->Draw( m_canvas, DC, pos, -1, g_XorMode, NULL, DefaultTransform );
return; return;
} }
@ -262,8 +262,8 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC )
TempCopyComponent(); TempCopyComponent();
m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) ); m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) );
DrawPanel->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn ); m_canvas->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
} }
@ -275,8 +275,8 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC )
TempCopyComponent(); TempCopyComponent();
m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) ); m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) );
DrawPanel->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn ); m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
} }
@ -308,7 +308,7 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
if( GetToolId() != ID_NO_TOOL_SELECTED ) if( GetToolId() != ID_NO_TOOL_SELECTED )
SetCursor( wxCURSOR_PENCIL ); SetCursor( wxCURSOR_PENCIL );
else else
SetCursor( DrawPanel->GetDefaultCursor() ); SetCursor( m_canvas->GetDefaultCursor() );
if( GetTempCopyComponent() ) // used when editing an existing item if( GetTempCopyComponent() ) // used when editing an existing item
SaveCopyInUndoList( GetTempCopyComponent() ); SaveCopyInUndoList( GetTempCopyComponent() );
@ -325,6 +325,6 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
OnModify(); OnModify();
DrawPanel->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -57,7 +57,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) ) if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) )
return; return;
DrawPanel->m_IgnoreMouseEvents = true; m_canvas->m_IgnoreMouseEvents = true;
wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath(); wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath();
@ -69,8 +69,8 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
return; return;
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) ); GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
wxFileName fn = dlg.GetPath(); wxFileName fn = dlg.GetPath();
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );
@ -126,7 +126,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
m_component->ClearSelectedItems(); m_component->ClearSelectedItems();
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
delete Lib; delete Lib;
} }
@ -250,5 +250,5 @@ void LIB_EDIT_FRAME::PlaceAnchor()
/* Redraw the symbol */ /* Redraw the symbol */
RedrawScreen( wxPoint( 0 , 0 ), true ); RedrawScreen( wxPoint( 0 , 0 ), true );
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -302,6 +302,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
KiBitmap( lines90_xpm ), KiBitmap( lines90_xpm ),
_( "HV orientation for wires and bus" ), _( "HV orientation for wires and bus" ),
wxITEM_CHECK ); wxITEM_CHECK );
// set icon paddings // set icon paddings
m_optionsToolBar->SetToolBorderPadding(2); // padding m_optionsToolBar->SetToolBorderPadding(2); // padding
m_optionsToolBar->SetToolSeparation(0); m_optionsToolBar->SetToolSeparation(0);
@ -313,7 +314,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
if( DrawPanel == NULL ) if( m_canvas == NULL )
return; return;
int id = event.GetId(); int id = event.GetId();
@ -322,7 +323,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
case ID_TB_OPTIONS_HIDDEN_PINS: case ID_TB_OPTIONS_HIDDEN_PINS:
m_showAllPins = m_optionsToolBar->GetToolToggled( id ); m_showAllPins = m_optionsToolBar->GetToolToggled( id );
DrawPanel->Refresh( ); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_BUS_WIRES_ORIENT: case ID_TB_OPTIONS_BUS_WIRES_ORIENT:

View File

@ -191,8 +191,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
DisplayLibInfos(); DisplayLibInfos();
if( DrawPanel ) if( m_canvas )
DrawPanel->SetAcceleratorTable( table ); m_canvas->SetAcceleratorTable( table );
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
@ -227,7 +227,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
Left().Row( 1 ) ); Left().Row( 1 ) );
// Manage the draw panel // Manage the draw panel
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).Centre() ); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).Centre() );
// Manage the message panel // Manage the message panel
@ -354,7 +354,7 @@ double LIB_VIEW_FRAME::BestZoom()
return bestzoom; return bestzoom;
} }
wxSize size = DrawPanel->GetClientSize(); wxSize size = m_canvas->GetClientSize();
EDA_RECT BoundaryBox = component->GetBoundingBox( m_unit, m_convert ); EDA_RECT BoundaryBox = component->GetBoundingBox( m_unit, m_convert );
@ -407,7 +407,7 @@ void LIB_VIEW_FRAME::ReCreateListLib()
ReCreateListCmp(); ReCreateListCmp();
ReCreateHToolbar(); ReCreateHToolbar();
DisplayLibInfos(); DisplayLibInfos();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -462,7 +462,7 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
m_libraryName = name; m_libraryName = name;
ReCreateListCmp(); ReCreateListCmp();
DrawPanel->Refresh(); m_canvas->Refresh();
DisplayLibInfos(); DisplayLibInfos();
ReCreateHToolbar(); ReCreateHToolbar();
} }
@ -485,7 +485,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
m_convert = 1; m_convert = 1;
Zoom_Automatique( false ); Zoom_Automatique( false );
ReCreateHToolbar(); ReCreateHToolbar();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
} }

View File

@ -59,14 +59,14 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE );
m_convert = 1; m_convert = 1;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT: case ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT:
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE );
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true ); m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true );
m_convert = 2; m_convert = 2;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_LIBVIEW_SELECT_PART_NUMBER: case ID_LIBVIEW_SELECT_PART_NUMBER:
@ -74,7 +74,7 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( ii < 0 ) if( ii < 0 )
return; return;
m_unit = ii + 1; m_unit = ii + 1;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:
@ -135,7 +135,7 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary()
if( m_LibList ) if( m_LibList )
{ {
ReCreateListCmp(); ReCreateListCmp();
DrawPanel->Refresh(); m_canvas->Refresh();
DisplayLibInfos(); DisplayLibInfos();
ReCreateHToolbar(); ReCreateHToolbar();
int id = m_LibList->FindString( m_libraryName.GetData() ); int id = m_LibList->FindString( m_libraryName.GetData() );
@ -232,7 +232,7 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
m_entryName = CmpName; m_entryName = CmpName;
DisplayLibInfos(); DisplayLibInfos();
Zoom_Automatique( false ); Zoom_Automatique( false );
DrawPanel->Refresh( ); m_canvas->Refresh( );
if( m_CmpList ) if( m_CmpList )
{ {
@ -269,7 +269,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
component = entry->GetComponent(); component = entry->GetComponent();
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
if( !entry->IsRoot() ) if( !entry->IsRoot() )
{ {
@ -283,6 +283,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( m_unit < 1 ) if( m_unit < 1 )
m_unit = 1; m_unit = 1;
if( m_convert < 1 ) if( m_convert < 1 )
m_convert = 1; m_convert = 1;
} }
@ -291,10 +292,10 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
msg = _( "None" ); msg = _( "None" );
} }
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE );
/* Redraw the cursor */ /* Redraw the cursor */
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
if( !tmp.IsEmpty() ) if( !tmp.IsEmpty() )
component->SetName( tmp ); component->SetName( tmp );

View File

@ -77,23 +77,23 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC ) void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
{ {
wxASSERT( DrawPanel->IsMouseCaptured() ); wxASSERT( m_canvas->IsMouseCaptured() );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Move( DC ); Block_Move( DC );
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Duplicate( DC ); Block_Duplicate( DC );
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
@ -116,7 +116,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
break; break;
} }
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
GetScreen()->SetModify(); GetScreen()->SetModify();
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
@ -131,7 +131,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
bool nextcmd = false; bool nextcmd = false;
bool zoom_command = false; bool zoom_command = false;
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
@ -139,14 +139,14 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
nextcmd = true; nextcmd = true;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Delete( DC ); Block_Delete( DC );
break; break;
@ -172,8 +172,8 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
if( ! nextcmd ) if( ! nextcmd )
{ {
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
} }
if( zoom_command ) if( zoom_command )
@ -257,10 +257,10 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
wxPoint oldpos; wxPoint oldpos;
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->SetCrossHairPosition( oldpos ); GetScreen()->SetCrossHairPosition( oldpos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
GetScreen()->SetModify(); GetScreen()->SetModify();
GetScreen()->m_BlockLocate.Normalize(); GetScreen()->m_BlockLocate.Normalize();
@ -276,7 +276,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
gerb_item->MoveAB( delta ); gerb_item->MoveAB( delta );
} }
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
@ -286,10 +286,10 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
wxPoint oldpos; wxPoint oldpos;
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->SetCrossHairPosition( oldpos ); GetScreen()->SetCrossHairPosition( oldpos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
GetScreen()->SetModify(); GetScreen()->SetModify();
GetScreen()->m_BlockLocate.Normalize(); GetScreen()->m_BlockLocate.Normalize();
@ -297,9 +297,11 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
/* Copy items in block */ /* Copy items in block */
BOARD_ITEM* item = GetBoard()->m_Drawings; BOARD_ITEM* item = GetBoard()->m_Drawings;
for( ; item; item = item->Next() ) for( ; item; item = item->Next() )
{ {
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item; GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) ) if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) )
{ {
/* this item must be duplicated */ /* this item must be duplicated */
@ -309,5 +311,5 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
} }
} }
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -176,7 +176,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
} }
myframe->GetBoard()->SetVisibleLayers( visibleLayers ); myframe->GetBoard()->SetVisibleLayers( visibleLayers );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
break; break;
} }
} }
@ -188,6 +188,7 @@ void GERBER_LAYER_WIDGET::ReFill()
BOARD* brd = myframe->GetBoard(); BOARD* brd = myframe->GetBoard();
int layer; int layer;
ClearLayerRows(); ClearLayerRows();
for( layer = 0; layer < LAYER_COUNT; layer++ ) for( layer = 0; layer < LAYER_COUNT; layer++ )
{ {
wxString msg; wxString msg;
@ -205,7 +206,7 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
{ {
myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->GetBoard()->SetLayerColor( aLayer, aColor );
myframe->m_SelLayerBox->ResyncBitmapOnly(); myframe->m_SelLayerBox->ResyncBitmapOnly();
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer ) bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
@ -215,8 +216,9 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
int layer = myframe->getActiveLayer( ); int layer = myframe->getActiveLayer( );
myframe->setActiveLayer( aLayer, false ); myframe->setActiveLayer( aLayer, false );
myframe->syncLayerBox(); myframe->syncLayerBox();
if( layer != myframe->getActiveLayer( ) ) if( layer != myframe->getActiveLayer( ) )
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
return true; return true;
} }
@ -234,13 +236,13 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin
brd->SetVisibleLayers( visibleLayers ); brd->SetVisibleLayers( visibleLayers );
if( isFinal ) if( isFinal )
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor ) void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
{ {
myframe->GetBoard()->SetVisibleElementColor( aId, aColor ); myframe->GetBoard()->SetVisibleElementColor( aId, aColor );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
@ -248,7 +250,7 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
BOARD* brd = myframe->GetBoard(); BOARD* brd = myframe->GetBoard();
brd->SetElementVisibility( aId, isEnabled ); brd->SetElementVisibility( aId, isEnabled );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
//-----</LAYER_WIDGET callbacks>------------------------------------------ //-----</LAYER_WIDGET callbacks>------------------------------------------

View File

@ -24,25 +24,25 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
@ -55,13 +55,13 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = GetScreen()->GetCrossHairPosition(); pos = GetScreen()->GetCrossHairPosition();
GetScreen()->SetCrossHairPosition( oldpos ); GetScreen()->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( pos ); GetScreen()->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
} }
} }

View File

@ -37,8 +37,9 @@ void GERBVIEW_FRAME::InstallGerberOptionsDialog( wxCommandEvent& event )
{ {
DIALOG_DISPLAY_OPTIONS dlg( this ); DIALOG_DISPLAY_OPTIONS dlg( this );
int opt = dlg.ShowModal(); int opt = dlg.ShowModal();
if (opt > 0 ) if (opt > 0 )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) : DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) :

View File

@ -56,11 +56,11 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer,
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
g_DisplayPolygonsModeSketch = 0; g_DisplayPolygonsModeSketch = 0;
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode; m_canvas->m_PrintIsMirrored = aPrintMirrorMode;
GetBoard()->Draw( DrawPanel, aDC, -1, wxPoint( 0, 0 ) ); GetBoard()->Draw( m_canvas, aDC, -1, wxPoint( 0, 0 ) );
DrawPanel->m_PrintIsMirrored = false; m_canvas->m_PrintIsMirrored = false;
// Restore draw options: // Restore draw options:
GetBoard()->SetVisibleLayers( visiblemask ); GetBoard()->SetVisibleLayers( visiblemask );
@ -96,22 +96,22 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
// Draw according to the current setting. This needs to be GR_COPY or GR_OR. // Draw according to the current setting. This needs to be GR_COPY or GR_OR.
GetBoard()->Draw( DrawPanel, DC, drawMode, wxPoint( 0, 0 ) ); GetBoard()->Draw( m_canvas, DC, drawMode, wxPoint( 0, 0 ) );
// Draw the "background" now, i.e. grid and axis after gerber layers // Draw the "background" now, i.e. grid and axis after gerber layers
// because most of time the actual background is erased by successive drawings of each gerber // because most of time the actual background is erased by successive drawings of each gerber
// layer mainly in COPY mode // layer mainly in COPY mode
DrawPanel->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
if( IsElementVisible( DCODES_VISIBLE ) ) if( IsElementVisible( DCODES_VISIBLE ) )
DrawItemsDCodeID( DC, GR_COPY ); DrawItemsDCodeID( DC, GR_COPY );
TraceWorkSheet( DC, screen, 0 ); TraceWorkSheet( DC, screen, 0 );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
// Display the filename and the layer name (found in the gerber files, if any) // Display the filename and the layer name (found in the gerber files, if any)
// relative to the active layer // relative to the active layer
@ -406,7 +406,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode )
int color = g_ColorsSettings.GetItemColor( DCODES_VISIBLE ); int color = g_ColorsSettings.GetItemColor( DCODES_VISIBLE );
DrawGraphicText( DrawPanel, aDC, pos, (EDA_Colors) color, Line, DrawGraphicText( m_canvas, aDC, pos, (EDA_Colors) color, Line,
orient, wxSize( width, width ), orient, wxSize( width, width ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
0, false, false ); 0, false, false );

View File

@ -127,7 +127,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE ) if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
{ {
@ -138,26 +138,28 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
} }
if( GetToolId() == ID_NO_TOOL_SELECTED ) if( GetToolId() == ID_NO_TOOL_SELECTED )
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
else else
DrawPanel->SetCursor( DrawPanel->GetCurrentCursor() ); m_canvas->SetCursor( m_canvas->GetCurrentCursor() );
break; break;
default: default:
DrawPanel->EndMouseCapture(); m_canvas->EndMouseCapture();
break; break;
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( id ) switch( id )
{ {
case ID_GERBVIEW_SET_PAGE_BORDER: case ID_GERBVIEW_SET_PAGE_BORDER:
{ {
DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this ); DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this );
if (dlg.ShowModal() == wxID_OK ) if (dlg.ShowModal() == wxID_OK )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
break; break;
case ID_GERBVIEW_GLOBAL_DELETE: case ID_GERBVIEW_GLOBAL_DELETE:
@ -166,11 +168,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_NO_TOOL_SELECTED: case ID_NO_TOOL_SELECTED:
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_POPUP_CLOSE_CURRENT_TOOL: case ID_POPUP_CLOSE_CURRENT_TOOL:
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString ); SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
@ -182,7 +184,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PLACE_BLOCK: case ID_POPUP_PLACE_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE; GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
DrawPanel->m_AutoPAN_Request = FALSE; m_canvas->m_AutoPAN_Request = FALSE;
HandleBlockPlace( &dc ); HandleBlockPlace( &dc );
break; break;
@ -211,13 +213,15 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event ) void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event )
{ {
GERBER_IMAGE* gerber_image = g_GERBER_List[getActiveLayer()]; GERBER_IMAGE* gerber_image = g_GERBER_List[getActiveLayer()];
if( gerber_image ) if( gerber_image )
{ {
int tool = m_DCodeSelector->GetSelectedDCodeId(); int tool = m_DCodeSelector->GetSelectedDCodeId();
if( tool != gerber_image->m_Selected_Tool ) if( tool != gerber_image->m_Selected_Tool )
{ {
gerber_image->m_Selected_Tool = tool; gerber_image->m_Selected_Tool = tool;
DrawPanel->Refresh(); m_canvas->Refresh();
} }
} }
} }
@ -231,8 +235,9 @@ void GERBVIEW_FRAME::OnSelectActiveLayer( wxCommandEvent& event )
int layer = getActiveLayer(); int layer = getActiveLayer();
setActiveLayer( event.GetSelection() ); setActiveLayer( event.GetSelection() );
if( layer != getActiveLayer() ) if( layer != getActiveLayer() )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -283,7 +288,7 @@ void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
} }
if( GetDisplayMode() != oldMode ) if( GetDisplayMode() != oldMode )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event ) void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event )

View File

@ -56,18 +56,18 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
case ID_GERBVIEW_ERASE_ALL: case ID_GERBVIEW_ERASE_ALL:
Clear_Pcb( true ); Clear_Pcb( true );
Zoom_Automatique( false ); Zoom_Automatique( false );
DrawPanel->Refresh(); m_canvas->Refresh();
ClearMsgPanel(); ClearMsgPanel();
break; break;
case ID_GERBVIEW_LOAD_DRILL_FILE: case ID_GERBVIEW_LOAD_DRILL_FILE:
LoadExcellonFiles( wxEmptyString ); LoadExcellonFiles( wxEmptyString );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_GERBVIEW_LOAD_DCODE_FILE: case ID_GERBVIEW_LOAD_DCODE_FILE:
LoadDCodeFile( wxEmptyString ); LoadDCodeFile( wxEmptyString );
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
default: default:

View File

@ -75,8 +75,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_displayMode = 0; m_displayMode = 0;
m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 ); m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 );
if( DrawPanel ) if( m_canvas )
DrawPanel->m_Block_Enable = true; m_canvas->m_Block_Enable = true;
// Give an icon // Give an icon
wxIcon icon; wxIcon icon;
@ -98,7 +98,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
if( screenHeight <= 900 ) if( screenHeight <= 900 )
pointSize = (pointSize * 8) / 10; pointSize = (pointSize * 8) / 10;
m_LayersManager = new GERBER_LAYER_WIDGET( this, DrawPanel, pointSize ); m_LayersManager = new GERBER_LAYER_WIDGET( this, m_canvas, pointSize );
// LoadSettings() *after* creating m_LayersManager, because LoadSettings() // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
// initialize parameters in m_LayersManager // initialize parameters in m_LayersManager
@ -143,8 +143,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_auimgr.AddPane( m_optionsToolBar, m_auimgr.AddPane( m_optionsToolBar,
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() ); wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
if( DrawPanel ) if( m_canvas )
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
if( m_messagePanel ) if( m_messagePanel )
@ -187,7 +187,7 @@ double GERBVIEW_FRAME::BestZoom()
bbox.Merge( gerb_item->GetBoundingBox() ); bbox.Merge( gerb_item->GetBoundingBox() );
} }
wxSize size = DrawPanel->GetClientSize(); wxSize size = m_canvas->GetClientSize();
double x = (double) bbox.GetWidth() / (double) size.x; double x = (double) bbox.GetWidth() / (double) size.x;
double y = (double) bbox.GetHeight() / (double) size.y; double y = (double) bbox.GetHeight() / (double) size.y;

View File

@ -136,15 +136,16 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
break; break;
case HK_SWITCH_GBR_ITEMS_DISPLAY_MODE: case HK_SWITCH_GBR_ITEMS_DISPLAY_MODE:
DisplayOpt.DisplayPcbTrackFill ^= 1; DisplayOpt.DisplayPcbTrackFill &= 1; DisplayOpt.DisplayPcbTrackFill ^= 1;
DrawPanel->Refresh(); DisplayOpt.DisplayPcbTrackFill &= 1;
m_canvas->Refresh();
break; break;
case HK_SWITCH_LAYER_TO_PREVIOUS: case HK_SWITCH_LAYER_TO_PREVIOUS:
if( getActiveLayer() > 0 ) if( getActiveLayer() > 0 )
{ {
setActiveLayer( getActiveLayer() - 1 ); setActiveLayer( getActiveLayer() - 1 );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
break; break;
@ -152,7 +153,7 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
if( getActiveLayer() < 31 ) if( getActiveLayer() < 31 )
{ {
setActiveLayer( getActiveLayer() + 1 ); setActiveLayer( getActiveLayer() + 1 );
DrawPanel->Refresh(); m_canvas->Refresh();
} }
break; break;
} }

View File

@ -110,7 +110,7 @@ void GERBVIEW_FRAME::Erase_Current_Layer( bool query )
} }
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->Refresh(); m_canvas->Refresh();
m_LayersManager->UpdateLayerIcons(); m_LayersManager->UpdateLayerIcons();
syncLayerBox(); syncLayerBox();
} }

View File

@ -20,7 +20,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
// Do not initiate a start block validation on menu. // Do not initiate a start block validation on menu.
DrawPanel->m_CanStartBlock = -1; m_canvas->m_CanStartBlock = -1;
// Simple location of elements where possible. // Simple location of elements where possible.
if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) ) if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) )

View File

@ -43,7 +43,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
DisplayOpt.DisplayPadFill = m_DisplayPadFill = true; DisplayOpt.DisplayPadFill = m_DisplayPadFill = true;
} }
DrawPanel->Refresh( true );
m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_LINES_SKETCH: case ID_TB_OPTIONS_SHOW_LINES_SKETCH:
@ -57,7 +58,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
m_DisplayPcbTrackFill = true; m_DisplayPcbTrackFill = true;
DisplayOpt.DisplayPcbTrackFill = true; DisplayOpt.DisplayPcbTrackFill = true;
} }
DrawPanel->Refresh( true );
m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH: case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH:
@ -65,12 +67,13 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
g_DisplayPolygonsModeSketch = 1; g_DisplayPolygonsModeSketch = 1;
else else
g_DisplayPolygonsModeSketch = 0; g_DisplayPolygonsModeSketch = 0;
DrawPanel->Refresh( true );
m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_DCODES: case ID_TB_OPTIONS_SHOW_DCODES:
SetElementVisibility( DCODES_VISIBLE, state ); SetElementVisibility( DCODES_VISIBLE, state );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR: case ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR:

View File

@ -1,3 +1,28 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/** /**
* @file class_drawpanel.h: * @file class_drawpanel.h:
* @brief EDA_DRAW_PANEL class definition. * @brief EDA_DRAW_PANEL class definition.
@ -34,14 +59,13 @@ private:
int m_defaultCursor; ///< The default mouse cursor shape id. int m_defaultCursor; ///< The default mouse cursor shape id.
bool m_showCrossHair; ///< Indicate if cross hair is to be shown. bool m_showCrossHair; ///< Indicate if cross hair is to be shown.
int m_cursorLevel; ///< Index for cursor redraw in XOR mode. int m_cursorLevel; ///< Index for cursor redraw in XOR mode.
int m_scrollIncrementX; ///< X axis scroll increment in pixels per unit.
int m_scrollIncrementY; ///< Y axis scroll increment in pixels per unit.
wxPoint m_CursorStartPos; ///< Used for testing the cursor movement.
public: public:
EDA_RECT m_ClipBox; // the clipbox used in screen redraw (usually gives the EDA_RECT m_ClipBox; // the clipbox used in screen redraw (usually gives the
// visible area in internal units) // visible area in internal units)
wxPoint m_CursorStartPos; // useful in testing the cursor movement
int m_scrollIncrementX; // X axis scroll increment in pixels per unit.
int m_scrollIncrementY; // Y axis scroll increment in pixels per unit.
bool m_AbortRequest; // Flag to abort long commands bool m_AbortRequest; // Flag to abort long commands
bool m_AbortEnable; // true if abort button or menu to be displayed bool m_AbortEnable; // true if abort button or menu to be displayed

View File

@ -366,22 +366,22 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
///< Id of active button on the vertical toolbar. ///< Id of active button on the vertical toolbar.
int m_toolId; int m_toolId;
public:
EDA_DRAW_PANEL* DrawPanel; // Draw area
protected: protected:
EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList; EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList;
int m_LastGridSizeId; int m_LastGridSizeId;
bool m_DrawGrid; // hide/Show grid bool m_DrawGrid; // hide/Show grid
int m_GridColor; // Grid color int m_GridColor; // Grid color
/// The area to draw on.
EDA_DRAW_PANEL* m_canvas;
/// Internal units count that is equivalent to 1 inch. Set to 1000 (0.001") for /// Internal units count that is equivalent to 1 inch. Set to 1000 (0.001") for
/// schematic drawing and 10000 (0.0001") for PCB drawing. /// schematic drawing and 10000 (0.0001") for PCB drawing.
int m_internalUnits; int m_internalUnits;
/// Tool ID of previously active draw tool bar button. /// Tool ID of previously active draw tool bar button.
int m_lastDrawToolId; int m_lastDrawToolId;
// on the vertical toolbar
/// The shape of the KiCad cursor. The default value (0) is the normal cross /// The shape of the KiCad cursor. The default value (0) is the normal cross
/// hair cursor. Set to non-zero value to draw the full screen cursor. /// hair cursor. Set to non-zero value to draw the full screen cursor.
/// @note This is not the system mouse cursor. /// @note This is not the system mouse cursor.
@ -463,6 +463,8 @@ public:
int GetInternalUnits() const { return m_internalUnits; } int GetInternalUnits() const { return m_internalUnits; }
EDA_DRAW_PANEL* GetCanvas() { return m_canvas; }
virtual wxString GetScreenDesc(); virtual wxString GetScreenDesc();
/** /**

View File

@ -51,10 +51,10 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
return; return;
OnModify(); OnModify();
DrawPanel->CrossHairOff( DC ); // Erase cursor shape m_canvas->CrossHairOff( DC ); // Erase cursor shape
track->SetState( TRACK_LOCKED, Flag_On ); track->SetState( TRACK_LOCKED, Flag_On );
track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); track->Draw( m_canvas, DC, GR_OR | GR_HIGHLIGHT );
DrawPanel->CrossHairOn( DC ); // Display cursor shape m_canvas->CrossHairOn( DC ); // Display cursor shape
track->DisplayInfo( this ); track->DisplayInfo( this );
} }
@ -68,9 +68,9 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
if( (track == NULL ) || (track->Type() == PCB_ZONE_T) ) if( (track == NULL ) || (track->Type() == PCB_ZONE_T) )
return; return;
DrawPanel->CrossHairOff( DC ); // Erase cursor shape m_canvas->CrossHairOff( DC ); // Erase cursor shape
Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true ); Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true );
DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT ); DrawTraces( m_canvas, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT );
for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- ) for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
{ {
@ -79,7 +79,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
Track = Track->Next(); Track = Track->Next();
} }
DrawPanel->CrossHairOn( DC ); // Display cursor shape m_canvas->CrossHairOn( DC ); // Display cursor shape
OnModify(); OnModify();
} }
@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
} }
} }
DrawPanel->CrossHairOff( DC ); // Erase cursor shape m_canvas->CrossHairOff( DC ); // Erase cursor shape
while( Track ) /* Flag change */ while( Track ) /* Flag change */
{ {
@ -112,10 +112,10 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
OnModify(); OnModify();
Track->SetState( TRACK_LOCKED, Flag_On ); Track->SetState( TRACK_LOCKED, Flag_On );
Track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); Track->Draw( m_canvas, DC, GR_OR | GR_HIGHLIGHT );
Track = Track->Next(); Track = Track->Next();
} }
DrawPanel->CrossHairOn( DC ); // Display cursor shape m_canvas->CrossHairOn( DC ); // Display cursor shape
OnModify(); OnModify();
} }

View File

@ -69,7 +69,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
if( m_mainToolBar == NULL ) if( m_mainToolBar == NULL )
return; return;
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
switch( id ) switch( id )
{ {
@ -93,15 +93,15 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
return; return;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_endMouseCaptureCallback( DrawPanel, &dc ); m_canvas->m_endMouseCaptureCallback( m_canvas, &dc );
} }
break; break;
default: // Abort a current command (if any) default: // Abort a current command (if any)
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
break; break;
} }
@ -293,7 +293,7 @@ void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
if( newList.GetCount() ) if( newList.GetCount() )
SaveCopyInUndoList( newList, UR_CHANGED ); SaveCopyInUndoList( newList, UR_CHANGED );
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -117,8 +117,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
if( GetBoard()->m_Modules == NULL ) if( GetBoard()->m_Modules == NULL )
return; return;
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
DrawPanel->m_AbortEnable = true; m_canvas->m_AbortEnable = true;
switch( place_mode ) switch( place_mode )
{ {
@ -247,7 +247,7 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen
{ {
NbModules++; NbModules++;
Module->Draw( DrawPanel, DC, GR_XOR ); Module->Draw( m_canvas, DC, GR_XOR );
} }
else else
{ {
@ -390,8 +390,8 @@ end_of_tst:
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
Compile_Ratsnest( DC, true ); Compile_Ratsnest( DC, true );
DrawPanel->ReDraw( DC, true ); m_canvas->ReDraw( DC, true );
DrawPanel->m_AbortEnable = false; m_canvas->m_AbortEnable = false;
} }
@ -431,7 +431,7 @@ void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC )
color = DARKGRAY; color = DARKGRAY;
} }
GRPutPixel( &DrawPanel->m_ClipBox, DC, ox, oy, color ); GRPutPixel( &m_canvas->m_ClipBox, DC, ox, oy, color );
} }
} }
} }
@ -680,7 +680,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
} }
} }
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
mincout = -1.0; mincout = -1.0;
SetStatusText( wxT( "Score ??, pos ??" ) ); SetStatusText( wxT( "Score ??, pos ??" ) );
@ -690,19 +690,19 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
{ {
wxYield(); wxYield();
if( DrawPanel->m_AbortRequest ) if( m_canvas->m_AbortRequest )
{ {
if( IsOK( this, _( "Ok to abort?" ) ) ) if( IsOK( this, _( "Ok to abort?" ) ) )
return ESC; return ESC;
else else
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
} }
cx = aModule->m_Pos.x; cy = aModule->m_Pos.y; cx = aModule->m_Pos.x; cy = aModule->m_Pos.y;
aModule->m_BoundaryBox.SetX( ox + CurrPosition.x ); aModule->m_BoundaryBox.SetX( ox + CurrPosition.x );
aModule->m_BoundaryBox.SetY( oy + CurrPosition.y ); aModule->m_BoundaryBox.SetY( oy + CurrPosition.y );
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
g_Offset_Module.x = cx - CurrPosition.x; g_Offset_Module.x = cx - CurrPosition.x;
CurrPosition.y = bbbox.GetY() - oy; CurrPosition.y = bbbox.GetY() - oy;
@ -710,13 +710,13 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
/* Placement on grid. */ /* Placement on grid. */
CurrPosition.y -= CurrPosition.y % Board.m_GridRouting; CurrPosition.y -= CurrPosition.y % Board.m_GridRouting;
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
for( ; CurrPosition.y < bbbox.GetBottom() - fy; for( ; CurrPosition.y < bbbox.GetBottom() - fy;
CurrPosition.y += Board.m_GridRouting ) CurrPosition.y += Board.m_GridRouting )
{ {
/* Erase traces. */ /* Erase traces. */
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
if( showRat ) if( showRat )
Compute_Ratsnest_PlaceModule( aDC ); Compute_Ratsnest_PlaceModule( aDC );
@ -726,7 +726,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
aModule->m_BoundaryBox.SetY( oy + CurrPosition.y ); aModule->m_BoundaryBox.SetY( oy + CurrPosition.y );
g_Offset_Module.y = cy - CurrPosition.y; g_Offset_Module.y = cy - CurrPosition.y;
DrawModuleOutlines( DrawPanel, aDC, aModule ); DrawModuleOutlines( m_canvas, aDC, aModule );
keepOut = TstModuleOnBoard( GetBoard(), aModule, TstOtherSide ); keepOut = TstModuleOnBoard( GetBoard(), aModule, TstOtherSide );
if( keepOut >= 0 ) /* c a d if the module can be placed. */ if( keepOut >= 0 ) /* c a d if the module can be placed. */
@ -757,7 +757,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
} }
} }
DrawModuleOutlines( DrawPanel, aDC, aModule ); /* erasing the last traces */ DrawModuleOutlines( m_canvas, aDC, aModule ); /* erasing the last traces */
if( showRat ) if( showRat )
Compute_Ratsnest_PlaceModule( aDC ); Compute_Ratsnest_PlaceModule( aDC );
@ -956,7 +956,7 @@ float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC )
if( AutoPlaceShowAll ) if( AutoPlaceShowAll )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, ox, oy, fx, fy, 0, color ); GRLine( &m_canvas->m_ClipBox, DC, ox, oy, fx, fy, 0, color );
} }
/* Cost of the ratsnest. */ /* Cost of the ratsnest. */

View File

@ -173,7 +173,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
/* Construction of the track list for router. */ /* Construction of the track list for router. */
Build_Work( GetBoard() ); Build_Work( GetBoard() );
// DisplayBoard(DrawPanel, DC); // DisplayBoard(m_canvas, DC);
if( Nb_Sides == TWO_SIDES ) if( Nb_Sides == TWO_SIDES )
Solve( DC, TWO_SIDES ); /* double face */ Solve( DC, TWO_SIDES ); /* double face */

View File

@ -175,7 +175,7 @@ double PCB_BASE_FRAME::BestZoom( void )
dx = bbbox.GetWidth(); dx = bbbox.GetWidth();
dy = bbbox.GetHeight(); dy = bbbox.GetHeight();
size = DrawPanel->GetClientSize(); size = m_canvas->GetClientSize();
if( size.x ) if( size.x )
ii = (double)(dx + ( size.x / 2) ) / (double) size.x; ii = (double)(dx + ( size.x / 2) ) / (double) size.x;
@ -201,10 +201,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
wxClientDC dc( DrawPanel ); wxClientDC dc( m_canvas );
/* There may be need to reframe the drawing. */ /* There may be need to reframe the drawing. */
if( !DrawPanel->IsPointOnDisplay( aPos ) ) if( !m_canvas->IsPointOnDisplay( aPos ) )
{ {
screen->SetCrossHairPosition( aPos ); screen->SetCrossHairPosition( aPos );
RedrawScreen( aPos, true ); RedrawScreen( aPos, true );
@ -212,10 +212,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
else else
{ {
// Put cursor on item position // Put cursor on item position
DrawPanel->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
screen->SetCrossHairPosition( aPos ); screen->SetCrossHairPosition( aPos );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->CrossHairOn( &dc ); m_canvas->CrossHairOn( &dc );
} }
} }
@ -278,7 +278,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, int layer )
GetScreen()->m_Active_Layer = layer; GetScreen()->m_Active_Layer = layer;
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -293,7 +293,7 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent )
void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
{ {
m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill; m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill;
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -371,7 +371,7 @@ void PCB_BASE_FRAME::ProcessItemSelection( wxCommandEvent& aEvent )
if( id >= ID_POPUP_PCB_ITEM_SELECTION_START && id <= ID_POPUP_PCB_ITEM_SELECTION_END ) if( id >= ID_POPUP_PCB_ITEM_SELECTION_START && id <= ID_POPUP_PCB_ITEM_SELECTION_END )
{ {
BOARD_ITEM* item = (*m_Collector)[itemNdx]; BOARD_ITEM* item = (*m_Collector)[itemNdx];
DrawPanel->m_AbortRequest = false; m_canvas->m_AbortRequest = false;
#if 0 && defined (DEBUG) #if 0 && defined (DEBUG)
item->Show( 0, std::cout ); item->Show( 0, std::cout );
@ -455,8 +455,8 @@ void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
// must do this after the tool has been set, otherwise pad::Draw() does // must do this after the tool has been set, otherwise pad::Draw() does
// not show proper color when DisplayOpt.ContrastModeDisplay is true. // not show proper color when DisplayOpt.ContrastModeDisplay is true.
if( redraw && DrawPanel) if( redraw && m_canvas)
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -121,15 +121,15 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title
{ {
wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition(); wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition();
parent->DrawPanel->m_IgnoreMouseEvents = true; parent->GetCanvas()->m_IgnoreMouseEvents = true;
DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title ); DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title );
int cmd = dlg->ShowModal(); int cmd = dlg->ShowModal();
dlg->Destroy(); dlg->Destroy();
parent->GetScreen()->SetCrossHairPosition( oldpos ); parent->GetScreen()->SetCrossHairPosition( oldpos );
parent->DrawPanel->MoveCursorToCrossHair(); parent->GetCanvas()->MoveCursorToCrossHair();
parent->DrawPanel->m_IgnoreMouseEvents = false; parent->GetCanvas()->m_IgnoreMouseEvents = false;
return cmd == wxID_OK; return cmd == wxID_OK;
} }
@ -219,7 +219,7 @@ int PCB_EDIT_FRAME::ReturnBlockCommand( int aKey )
void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) ); DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
} }
@ -234,16 +234,16 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_DRAG: /* Drag */ case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Move(); Block_Move();
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
Block_Duplicate(); Block_Duplicate();
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
@ -259,7 +259,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
OnModify(); OnModify();
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
if( GetScreen()->m_BlockLocate.GetCount() ) if( GetScreen()->m_BlockLocate.GetCount() )
@ -278,8 +278,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
// If coming here after cancel block, clean up and exit // If coming here after cancel block, clean up and exit
if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK ) if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK )
{ {
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
return false; return false;
} }
@ -293,11 +293,11 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
cancelCmd = true; cancelCmd = true;
// undraw block outline // undraw block outline
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
else else
{ {
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false ); DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
Block_SelectItems(); Block_SelectItems();
// Exit if no items found // Exit if no items found
@ -306,7 +306,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
} }
} }
if( !cancelCmd && DrawPanel->IsMouseCaptured() ) if( !cancelCmd && m_canvas->IsMouseCaptured() )
{ {
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
{ {
@ -320,24 +320,24 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
nextcmd = true; nextcmd = true;
DrawPanel->m_mouseCaptureCallback = drawMovingBlock; m_canvas->m_mouseCaptureCallback = drawMovingBlock;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
break; break;
case BLOCK_DELETE: /* Delete */ case BLOCK_DELETE: /* Delete */
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Delete(); Block_Delete();
break; break;
case BLOCK_ROTATE: /* Rotation */ case BLOCK_ROTATE: /* Rotation */
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Rotate(); Block_Rotate();
break; break;
case BLOCK_FLIP: /* Flip */ case BLOCK_FLIP: /* Flip */
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Flip(); Block_Flip();
break; break;
@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
// Turn off the redraw block routine now so it is not displayed // Turn off the redraw block routine now so it is not displayed
// with one corner at the new center of the screen // with one corner at the new center of the screen
DrawPanel->m_mouseCaptureCallback = NULL; m_canvas->m_mouseCaptureCallback = NULL;
Window_Zoom( GetScreen()->m_BlockLocate ); Window_Zoom( GetScreen()->m_BlockLocate );
break; break;
@ -369,8 +369,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if( ! nextcmd ) if( ! nextcmd )
{ {
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
} }
return nextcmd; return nextcmd;
@ -647,7 +647,7 @@ void PCB_EDIT_FRAME::Block_Delete()
SaveCopyInUndoList( *itemsList, UR_DELETED ); SaveCopyInUndoList( *itemsList, UR_DELETED );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
@ -707,7 +707,7 @@ void PCB_EDIT_FRAME::Block_Rotate()
SaveCopyInUndoList( *itemsList, UR_ROTATED, centre ); SaveCopyInUndoList( *itemsList, UR_ROTATED, centre );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
@ -768,7 +768,7 @@ void PCB_EDIT_FRAME::Block_Flip()
SaveCopyInUndoList( *itemsList, UR_FLIPPED, center ); SaveCopyInUndoList( *itemsList, UR_FLIPPED, center );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
@ -822,7 +822,7 @@ void PCB_EDIT_FRAME::Block_Move()
SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector ); SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
@ -937,5 +937,5 @@ void PCB_EDIT_FRAME::Block_Duplicate()
SaveCopyInUndoList( newList, UR_NEW ); SaveCopyInUndoList( newList, UR_NEW );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }

View File

@ -122,13 +122,13 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
BlockState state = GetScreen()->m_BlockLocate.m_State; BlockState state = GetScreen()->m_BlockLocate.m_State;
CmdBlockType command = GetScreen()->m_BlockLocate.m_Command; CmdBlockType command = GetScreen()->m_BlockLocate.m_Command;
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC ); m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
GetScreen()->m_BlockLocate.m_State = state; GetScreen()->m_BlockLocate.m_State = state;
GetScreen()->m_BlockLocate.m_Command = command; GetScreen()->m_BlockLocate.m_Command = command;
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(), GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(),
GetScreen()->m_BlockLocate.GetBottom() ) ); GetScreen()->m_BlockLocate.GetBottom() ) );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
} }
switch( GetScreen()->m_BlockLocate.m_Command ) switch( GetScreen()->m_BlockLocate.m_Command )
@ -146,21 +146,21 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
nextcmd = true; nextcmd = true;
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
} }
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
break; break;
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
nextcmd = true; nextcmd = true;
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
break; break;
@ -218,9 +218,9 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
GetScreen()->ClearBlockCommand(); GetScreen()->ClearBlockCommand();
SetCurItem( NULL ); SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
false ); false );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
return nextcmd; return nextcmd;
@ -231,7 +231,7 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
MODULE* currentModule = GetBoard()->m_Modules; MODULE* currentModule = GetBoard()->m_Modules;
if( !DrawPanel->IsMouseCaptured() ) if( !m_canvas->IsMouseCaptured() )
{ {
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) ); DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
} }
@ -249,7 +249,7 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
SaveCopyInUndoList( currentModule, UR_MODEDIT ); SaveCopyInUndoList( currentModule, UR_MODEDIT );
MoveMarkedItems( currentModule, GetScreen()->m_BlockLocate.m_MoveVector ); MoveMarkedItems( currentModule, GetScreen()->m_BlockLocate.m_MoveVector );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
break; break;
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
@ -288,8 +288,8 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
SetCurItem( NULL ); SetCurItem( NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false ); m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }

View File

@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event )
GetScreen()->PushCommandToRedoList( List ); GetScreen()->PushCommandToRedoList( List );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }
@ -690,7 +690,7 @@ void PCB_EDIT_FRAME::GetBoardFromRedoList( wxCommandEvent& event )
GetScreen()->PushCommandToUndoList( List ); GetScreen()->PushCommandToUndoList( List );
OnModify(); OnModify();
DrawPanel->Refresh(); m_canvas->Refresh();
} }

View File

@ -301,7 +301,7 @@ void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
{ {
myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->GetBoard()->SetLayerColor( aLayer, aColor );
myframe->ReCreateLayerBox( NULL ); myframe->ReCreateLayerBox( NULL );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer ) bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
@ -311,7 +311,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
myframe->setActiveLayer( aLayer, false ); myframe->setActiveLayer( aLayer, false );
if(DisplayOpt.ContrastModeDisplay) if(DisplayOpt.ContrastModeDisplay)
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
return true; return true;
} }
@ -330,13 +330,13 @@ void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal
brd->SetVisibleLayers( visibleLayers ); brd->SetVisibleLayers( visibleLayers );
if( isFinal ) if( isFinal )
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor ) void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
{ {
myframe->GetBoard()->SetVisibleElementColor( aId, aColor ); myframe->GetBoard()->SetVisibleElementColor( aId, aColor );
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
@ -365,7 +365,7 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
brd->SetElementVisibility( aId, isEnabled ); brd->SetElementVisibility( aId, isEnabled );
} }
myframe->DrawPanel->Refresh(); myframe->GetCanvas()->Refresh();
} }
//-----</LAYER_WIDGET callbacks>------------------------------------------ //-----</LAYER_WIDGET callbacks>------------------------------------------

View File

@ -451,7 +451,7 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
if( GetBoard() && GetBoard()->m_PcbFrame ) if( GetBoard() && GetBoard()->m_PcbFrame )
{ {
// Use grid size because it is known // Use grid size because it is known
wxRealPoint grid = GetBoard()->m_PcbFrame->DrawPanel->GetGrid(); wxRealPoint grid = GetBoard()->m_PcbFrame->GetCanvas()->GetGrid();
min_dist = wxRound( MIN( grid.x, grid.y ) ); min_dist = wxRound( MIN( grid.x, grid.y ) );
} }
#endif #endif
@ -497,7 +497,7 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
if( GetBoard() && GetBoard()->m_PcbFrame ) if( GetBoard() && GetBoard()->m_PcbFrame )
{ {
// Use grid size because it is known // Use grid size because it is known
wxRealPoint grid = GetBoard()->m_PcbFrame->DrawPanel->GetGrid(); wxRealPoint grid = GetBoard()->m_PcbFrame->GetCanvas()->GetGrid();
min_dist = wxRound( MIN( grid.x, grid.y ) ); min_dist = wxRound( MIN( grid.x, grid.y ) );
} }
#endif #endif

View File

@ -68,7 +68,7 @@ void PCB_EDIT_FRAME::Clean_Pcb( wxDC* DC )
CleanupTracks( this, dlg.cleanVias, dlg.mergeSegments, CleanupTracks( this, dlg.cleanVias, dlg.mergeSegments,
dlg.deleteUnconnectedSegm, dlg.connectToPads ); dlg.deleteUnconnectedSegm, dlg.connectToPads );
DrawPanel->Refresh( true ); m_canvas->Refresh( true );
} }
@ -207,7 +207,7 @@ static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* aFrame )
if( aFrame->GetBoard()->m_Track == NULL ) if( aFrame->GetBoard()->m_Track == NULL )
return; return;
aFrame->DrawPanel->m_AbortRequest = false; aFrame->GetCanvas()->m_AbortRequest = false;
// correct via m_End defects // correct via m_End defects
for( segment = aFrame->GetBoard()->m_Track; segment; segment = next ) for( segment = aFrame->GetBoard()->m_Track; segment; segment = next )
@ -231,7 +231,7 @@ static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* aFrame )
{ {
next = segment->Next(); next = segment->Next();
if( aFrame->DrawPanel->m_AbortRequest ) if( aFrame->GetCanvas()->m_AbortRequest )
break; break;
if( segment->GetNet() != oldnetcode ) if( segment->GetNet() != oldnetcode )
@ -412,7 +412,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame )
int flag, no_inc; int flag, no_inc;
wxString msg; wxString msg;
aFrame->DrawPanel->m_AbortRequest = false; aFrame->GetCanvas()->m_AbortRequest = false;
// Delete null segments // Delete null segments
for( segment = aFrame->GetBoard()->m_Track; segment; segment = nextsegment ) for( segment = aFrame->GetBoard()->m_Track; segment; segment = nextsegment )
@ -475,7 +475,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame )
nextsegment = segment->Next(); nextsegment = segment->Next();
if( aFrame->DrawPanel->m_AbortRequest ) if( aFrame->GetCanvas()->m_AbortRequest )
return; return;
if( segment->Type() != PCB_TRACE_T ) if( segment->Type() != PCB_TRACE_T )
@ -856,13 +856,13 @@ void ConnectDanglingEndToPad( PCB_EDIT_FRAME* aFrame )
int nb_new_trace = 0; int nb_new_trace = 0;
wxString msg; wxString msg;
aFrame->DrawPanel->m_AbortRequest = false; aFrame->GetCanvas()->m_AbortRequest = false;
for( segment = aFrame->GetBoard()->m_Track; segment; segment = segment->Next() ) for( segment = aFrame->GetBoard()->m_Track; segment; segment = segment->Next() )
{ {
D_PAD* pad; D_PAD* pad;
if( aFrame->DrawPanel->m_AbortRequest ) if( aFrame->GetCanvas()->m_AbortRequest )
return; return;
pad = aFrame->GetBoard()->GetPad( segment, START ); pad = aFrame->GetBoard()->GetPad( segment, START );

View File

@ -234,18 +234,18 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
* a m_IgnoreMouseEvents++ ) * a m_IgnoreMouseEvents++ )
* was not balanced with the -- (now m_IgnoreMouseEvents=false), so I had to revert. * was not balanced with the -- (now m_IgnoreMouseEvents=false), so I had to revert.
* Somebody should track down these and make them balanced. * Somebody should track down these and make them balanced.
* DrawPanel->m_IgnoreMouseEvents = true; * m_canvas->m_IgnoreMouseEvents = true;
*/ */
// this menu's handler is void PCB_BASE_FRAME::ProcessItemSelection() // this menu's handler is void PCB_BASE_FRAME::ProcessItemSelection()
// and it calls SetCurItem() which in turn calls DisplayInfo() on the item. // and it calls SetCurItem() which in turn calls DisplayInfo() on the item.
DrawPanel->m_AbortRequest = true; // changed in false if an item is selected m_canvas->m_AbortRequest = true; // changed in false if an item is selected
PopupMenu( &itemMenu ); PopupMenu( &itemMenu );
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
// The function ProcessItemSelection() has set the current item, return it. // The function ProcessItemSelection() has set the current item, return it.
if( DrawPanel->m_AbortRequest ) // Nothing selected if( m_canvas->m_AbortRequest ) // Nothing selected
item = NULL; item = NULL;
else else
item = GetCurItem(); item = GetCurItem();
@ -270,25 +270,25 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
pos.y -= wxRound( gridSize.y ); pos.y -= wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD2: case WXK_NUMPAD2:
case WXK_DOWN: case WXK_DOWN:
pos.y += wxRound( gridSize.y ); pos.y += wxRound( gridSize.y );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD4: case WXK_NUMPAD4:
case WXK_LEFT: case WXK_LEFT:
pos.x -= wxRound( gridSize.x ); pos.x -= wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
case WXK_NUMPAD6: case WXK_NUMPAD6:
case WXK_RIGHT: case WXK_RIGHT:
pos.x += wxRound( gridSize.x ); pos.x += wxRound( gridSize.x );
DrawPanel->MoveCursor( pos ); m_canvas->MoveCursor( pos );
break; break;
default: default:
@ -345,23 +345,25 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
pos = GetScreen()->GetCrossHairPosition(); pos = GetScreen()->GetCrossHairPosition();
GetScreen()->SetCrossHairPosition( oldpos, false ); GetScreen()->SetCrossHairPosition( oldpos, false );
DrawPanel->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( pos, false ); GetScreen()->SetCrossHairPosition( pos, false );
DrawPanel->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
#else #else
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true ); m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
DrawPanel->m_overlay.Reset(); {
m_canvas->m_overlay.Reset();
}
#endif #endif
} }

View File

@ -57,7 +57,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
D( g_CurrentTrackList.VerifyListIntegrity(); ) D( g_CurrentTrackList.VerifyListIntegrity(); )
// Delete the current trace // Delete the current trace
ShowNewTrackWhenMovingCursor( DrawPanel, DC, wxDefaultPosition, false ); ShowNewTrackWhenMovingCursor( m_canvas, DC, wxDefaultPosition, false );
// delete the most recently entered // delete the most recently entered
delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack();
@ -100,7 +100,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
if( g_CurrentTrackList.GetCount() == 0 ) if( g_CurrentTrackList.GetCount() == 0 )
{ {
DrawPanel->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
HighLight( DC ); HighLight( DC );
@ -110,8 +110,8 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
} }
else else
{ {
if( DrawPanel->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
return g_CurrentTrackSegment; return g_CurrentTrackSegment;
} }
@ -126,7 +126,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
container->Remove( aTrack ); container->Remove( aTrack );
// redraw the area where the track was // redraw the area where the track was
DrawPanel->RefreshDrawingRect( aTrack->GetBoundingBox() ); m_canvas->RefreshDrawingRect( aTrack->GetBoundingBox() );
SaveCopyInUndoList( aTrack, UR_DELETED ); SaveCopyInUndoList( aTrack, UR_DELETED );
OnModify(); OnModify();
@ -176,7 +176,7 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack )
GetBoard()->m_Track.Remove( segm ); GetBoard()->m_Track.Remove( segm );
// redraw the area where the track was // redraw the area where the track was
DrawPanel->RefreshDrawingRect( segm->GetBoundingBox() ); m_canvas->RefreshDrawingRect( segm->GetBoundingBox() );
picker.m_PickedItem = segm; picker.m_PickedItem = segm;
picker.m_PickedItemType = segm->Type(); picker.m_PickedItemType = segm->Type();
itemsList.PushItem( picker ); itemsList.PushItem( picker );
@ -225,7 +225,7 @@ void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
GetBoard()->m_Track.Remove( tracksegment ); GetBoard()->m_Track.Remove( tracksegment );
// redraw the area where the track was // redraw the area where the track was
DrawPanel->RefreshDrawingRect( tracksegment->GetBoundingBox() ); m_canvas->RefreshDrawingRect( tracksegment->GetBoundingBox() );
picker.m_PickedItem = tracksegment; picker.m_PickedItem = tracksegment;
picker.m_PickedItemType = tracksegment->Type(); picker.m_PickedItemType = tracksegment->Type();
itemsList.PushItem( picker ); itemsList.PushItem( picker );

View File

@ -245,7 +245,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
screen->SetScalingFactor( 1.0 ); screen->SetScalingFactor( 1.0 );
float dpi = (float)m_Parent->GetInternalUnits(); float dpi = (float)m_Parent->GetInternalUnits();
EDA_DRAW_PANEL* panel = m_Parent->DrawPanel; EDA_DRAW_PANEL* panel = m_Parent->GetCanvas();
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like 1.3) // to print floating point numbers like 1.3)

View File

@ -165,7 +165,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick(wxCommandEvent& event)
DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection(); DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection();
DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection(); DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection();
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
EndModal( 1 ); EndModal( 1 );
} }

View File

@ -556,13 +556,11 @@ void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
void DIALOG_DRC_CONTROL::RedrawDrawPanel() void DIALOG_DRC_CONTROL::RedrawDrawPanel()
{ {
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }
/*********************************************************/
void DIALOG_DRC_CONTROL::DelDRCMarkers() void DIALOG_DRC_CONTROL::DelDRCMarkers()
/*********************************************************/
{ {
m_Parent->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker m_Parent->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
m_ClearanceListBox->DeleteAllItems(); m_ClearanceListBox->DeleteAllItems();
@ -611,6 +609,7 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
if( curTab == 0 ) if( curTab == 0 )
{ {
selectedIndex = m_ClearanceListBox->GetSelection(); selectedIndex = m_ClearanceListBox->GetSelection();
if( selectedIndex != wxNOT_FOUND ) if( selectedIndex != wxNOT_FOUND )
{ {
m_ClearanceListBox->DeleteItem( selectedIndex ); m_ClearanceListBox->DeleteItem( selectedIndex );
@ -622,6 +621,7 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
else if( curTab == 1 ) else if( curTab == 1 )
{ {
selectedIndex = m_UnconnectedListBox->GetSelection(); selectedIndex = m_UnconnectedListBox->GetSelection();
if( selectedIndex != wxNOT_FOUND ) if( selectedIndex != wxNOT_FOUND )
{ {
m_UnconnectedListBox->DeleteItem( selectedIndex ); m_UnconnectedListBox->DeleteItem( selectedIndex );

View File

@ -457,8 +457,8 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
if( m_DC ) if( m_DC )
{ {
m_Parent->DrawPanel->CrossHairOff( m_DC ); m_Parent->GetCanvas()->CrossHairOff( m_DC );
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR );
} }
// Initialize masks clearances // Initialize masks clearances
@ -475,8 +475,10 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
// A margin ratio de -50% means no paste on a pad, the ratio must be >= 50% // A margin ratio de -50% means no paste on a pad, the ratio must be >= 50%
if( dtmp < -50 ) if( dtmp < -50 )
dtmp = -50; dtmp = -50;
if( dtmp > +100 ) if( dtmp > +100 )
dtmp = +100; dtmp = +100;
m_CurrentModule->m_LocalSolderPasteMarginRatio = dtmp / 100; m_CurrentModule->m_LocalSolderPasteMarginRatio = dtmp / 100;
// Set Module Position // Set Module Position
@ -518,6 +520,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
long orient = 0; long orient = 0;
msg = m_OrientValue->GetValue(); msg = m_OrientValue->GetValue();
msg.ToLong( &orient ); msg.ToLong( &orient );
if( m_CurrentModule->m_Orient != orient ) if( m_CurrentModule->m_Orient != orient )
m_CurrentModule->Rotate( m_CurrentModule->m_Pos, m_CurrentModule->Rotate( m_CurrentModule->m_Pos,
orient - m_CurrentModule->m_Orient ); orient - m_CurrentModule->m_Orient );
@ -537,14 +540,19 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
/* Update 3D shape list */ /* Update 3D shape list */
int ii = m_3D_ShapeNameListBox->GetSelection(); int ii = m_3D_ShapeNameListBox->GetSelection();
if( ii >= 0 ) if( ii >= 0 )
TransfertDisplayTo3DValues( ii ); TransfertDisplayTo3DValues( ii );
S3D_MASTER* draw3D = m_CurrentModule->m_3D_Drawings; S3D_MASTER* draw3D = m_CurrentModule->m_3D_Drawings;
for( unsigned ii = 0; ii < m_Shapes3D_list.size(); ii++ ) for( unsigned ii = 0; ii < m_Shapes3D_list.size(); ii++ )
{ {
S3D_MASTER* draw3DCopy = m_Shapes3D_list[ii]; S3D_MASTER* draw3DCopy = m_Shapes3D_list[ii];
if( draw3DCopy->m_Shape3DName.IsEmpty() ) if( draw3DCopy->m_Shape3DName.IsEmpty() )
continue; continue;
if( draw3D == NULL ) if( draw3D == NULL )
{ {
draw3D = new S3D_MASTER( draw3D ); draw3D = new S3D_MASTER( draw3D );
@ -561,6 +569,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
// Remove old extra 3D shapes // Remove old extra 3D shapes
S3D_MASTER* nextdraw3D; S3D_MASTER* nextdraw3D;
for( ; draw3D != NULL; draw3D = nextdraw3D ) for( ; draw3D != NULL; draw3D = nextdraw3D )
{ {
nextdraw3D = (S3D_MASTER*) draw3D->Next(); nextdraw3D = (S3D_MASTER*) draw3D->Next();
@ -580,8 +589,8 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
if( m_DC ) if( m_DC )
{ {
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_OR );
m_Parent->DrawPanel->CrossHairOn( m_DC ); m_Parent->GetCanvas()->CrossHairOn( m_DC );
} }
} }

View File

@ -45,14 +45,13 @@ private:
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
}; };
/*************************************************************************************/
void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC ) void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC )
/**************************************************************************************/
{ {
DrawPanel->m_IgnoreMouseEvents = TRUE; m_canvas->m_IgnoreMouseEvents = TRUE;
DialogEditModuleText dialog( this, TextMod, DC ); DialogEditModuleText dialog( this, TextMod, DC );
dialog.ShowModal(); dialog.ShowModal();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
} }
@ -85,9 +84,7 @@ void DialogEditModuleText::OnCancelClick( wxCommandEvent& event )
} }
/********************************************************/
void DialogEditModuleText::initDlg( ) void DialogEditModuleText::initDlg( )
/********************************************************/
{ {
SetFocus(); SetFocus();
@ -97,13 +94,14 @@ void DialogEditModuleText::initDlg( )
{ {
wxString format = m_ModuleInfoText->GetLabel(); wxString format = m_ModuleInfoText->GetLabel();
msg.Printf( format, msg.Printf( format,
GetChars( m_module->m_Reference->m_Text ), GetChars( m_module->m_Reference->m_Text ),
GetChars( m_module->m_Value->m_Text ), GetChars( m_module->m_Value->m_Text ),
(float) m_module->m_Orient / 10 ); (float) m_module->m_Orient / 10 );
} }
else else
{
msg.Empty(); msg.Empty();
}
m_ModuleInfoText->SetLabel( msg ); m_ModuleInfoText->SetLabel( msg );
@ -141,6 +139,7 @@ void DialogEditModuleText::initDlg( )
int text_orient = m_currentText->m_Orient; int text_orient = m_currentText->m_Orient;
NORMALIZE_ANGLE_90(text_orient) NORMALIZE_ANGLE_90(text_orient)
if( (text_orient != 0) ) if( (text_orient != 0) )
m_Orient->SetSelection( 1 ); m_Orient->SetSelection( 1 );
@ -149,17 +148,16 @@ void DialogEditModuleText::initDlg( )
} }
/*********************************************************************************/
void DialogEditModuleText::OnOkClick( wxCommandEvent& event ) void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
/*********************************************************************************/
{ {
wxString msg; wxString msg;
if ( m_module) if ( m_module)
m_parent->SaveCopyInUndoList( m_module, UR_CHANGED ); m_parent->SaveCopyInUndoList( m_module, UR_CHANGED );
if( m_dc ) //Erase old text on screen if( m_dc ) //Erase old text on screen
{ {
m_currentText->Draw( m_parent->DrawPanel, m_dc, GR_XOR, m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) ); (m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
} }
m_currentText->m_Text = m_Name->GetValue(); m_currentText->m_Text = m_Name->GetValue();
@ -195,12 +193,16 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
// Test for a reasonnable width: // Test for a reasonnable width:
if( width <= 1 ) if( width <= 1 )
width = 1; width = 1;
int maxthickness = Clamp_Text_PenSize(width, m_currentText->m_Size ); int maxthickness = Clamp_Text_PenSize(width, m_currentText->m_Size );
if( width > maxthickness ) if( width > maxthickness )
{ {
DisplayError(NULL, _("The text thickness is too large for the text size. It will be clamped")); DisplayError( NULL,
_( "The text thickness is too large for the text size. It will be clamped" ) );
width = maxthickness; width = maxthickness;
} }
m_currentText->SetThickness( width ); m_currentText->SetThickness( width );
m_currentText->SetVisible( m_Show->GetSelection() == 0 ); m_currentText->SetVisible( m_Show->GetSelection() == 0 );
@ -209,9 +211,10 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
m_currentText->m_Orient = text_orient; m_currentText->m_Orient = text_orient;
m_currentText->SetDrawCoord(); m_currentText->SetDrawCoord();
if( m_dc ) // Display new text if( m_dc ) // Display new text
{ {
m_currentText->Draw( m_parent->DrawPanel, m_dc, GR_XOR, m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) ); (m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
} }

View File

@ -88,7 +88,7 @@ void Dialog_GeneralOptions::init()
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack ); m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed ); m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only ); m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_AutoPANOpt->SetValue( GetParent()->DrawPanel->m_AutoPAN_Enable ); m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->m_AutoPAN_Enable );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only ); m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild ); m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild );
@ -126,14 +126,14 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
if( m_Board->IsElementVisible(RATSNEST_VISIBLE) != m_ShowGlobalRatsnest->GetValue() ) if( m_Board->IsElementVisible(RATSNEST_VISIBLE) != m_ShowGlobalRatsnest->GetValue() )
{ {
GetParent()->SetElementVisibility(RATSNEST_VISIBLE, m_ShowGlobalRatsnest->GetValue() ); GetParent()->SetElementVisibility(RATSNEST_VISIBLE, m_ShowGlobalRatsnest->GetValue() );
GetParent()->DrawPanel->Refresh( ); GetParent()->GetCanvas()->Refresh( );
} }
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue(); g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue(); g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue(); Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue(); g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue();
GetParent()->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue(); GetParent()->GetCanvas()->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue(); g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue();
g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection(); g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection();
@ -159,9 +159,9 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
if( GetToolId() == ID_TRACK_BUTT ) if( GetToolId() == ID_TRACK_BUTT )
{ {
if( Drc_On ) if( Drc_On )
DrawPanel->SetCursor( wxCURSOR_PENCIL ); m_canvas->SetCursor( wxCURSOR_PENCIL );
else else
DrawPanel->SetCursor( wxCURSOR_QUESTION_ARROW ); m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW );
} }
break; break;
@ -174,7 +174,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
} }
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_MODULE_RATSNEST: case ID_TB_OPTIONS_SHOW_MODULE_RATSNEST:
@ -187,32 +187,32 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_ZONES: case ID_TB_OPTIONS_SHOW_ZONES:
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_ZONES_DISABLE: case ID_TB_OPTIONS_SHOW_ZONES_DISABLE:
DisplayOpt.DisplayZonesMode = 1; DisplayOpt.DisplayZonesMode = 1;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY: case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY:
DisplayOpt.DisplayZonesMode = 2; DisplayOpt.DisplayZonesMode = 2;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
m_DisplayViaFill = DisplayOpt.DisplayViaFill = !state; m_DisplayViaFill = DisplayOpt.DisplayViaFill = !state;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH: case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !state; m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !state;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE: case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
DisplayOpt.ContrastModeDisplay = state; DisplayOpt.ContrastModeDisplay = state;
DrawPanel->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE: case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE:

View File

@ -145,7 +145,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
m_Parent->Compile_Ratsnest( NULL, true ); m_Parent->Compile_Ratsnest( NULL, true );
} }
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
m_Parent->OnModify(); m_Parent->OnModify();
EndModal( 1 ); EndModal( 1 );

View File

@ -200,8 +200,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
} }
EndModal( 1 ); EndModal( 1 );
if( change ) if( change )
m_Parent->DrawPanel->Refresh(); m_Parent->GetCanvas()->Refresh();
} }

View File

@ -70,12 +70,13 @@ void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxD
DisplayError(this, wxT("InstallGraphicItemPropertiesDialog() error: NULL item")); DisplayError(this, wxT("InstallGraphicItemPropertiesDialog() error: NULL item"));
return; return;
} }
DrawPanel->m_IgnoreMouseEvents = TRUE;
m_canvas->m_IgnoreMouseEvents = TRUE;
DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this, DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this,
aItem, aDC ); aItem, aDC );
dialog->ShowModal(); dialog->Destroy(); dialog->ShowModal(); dialog->Destroy();
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
} }
/**************************************************************************/ /**************************************************************************/
@ -188,8 +189,9 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
m_Parent->SaveCopyInUndoList( m_Item, UR_CHANGED ); m_Parent->SaveCopyInUndoList( m_Item, UR_CHANGED );
wxString msg; wxString msg;
if( m_DC ) if( m_DC )
m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); m_Item->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR );
msg = m_Center_StartXCtrl->GetValue(); msg = m_Center_StartXCtrl->GetValue();
m_Item->SetStartX( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() )); m_Item->SetStartX( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
@ -225,8 +227,10 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
} }
m_Parent->OnModify(); m_Parent->OnModify();
if( m_DC ) if( m_DC )
m_Item->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); m_Item->Draw( m_Parent->GetCanvas(), m_DC, GR_OR );
m_Item->DisplayInfo( m_Parent ); m_Item->DisplayInfo( m_Parent );
m_Parent->GetBoard()->SetDesignSettings( m_BrdSettings ); m_Parent->GetBoard()->SetDesignSettings( m_BrdSettings );

View File

@ -102,9 +102,10 @@ void PCB_EDIT_FRAME::OnOrientFootprints( wxCommandEvent& event )
return; return;
wxString text = dlg.GetFilter(); wxString text = dlg.GetFilter();
if( ReOrientModules( text, dlg.GetOrientation(), dlg.ApplyToLockedModules() ) ) if( ReOrientModules( text, dlg.GetOrientation(), dlg.ApplyToLockedModules() ) )
{ {
DrawPanel->Refresh(); m_canvas->Refresh();
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
} }
} }

View File

@ -600,7 +600,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
// redraw the area where the pad was, without pad (delete pad on screen) // redraw the area where the pad was, without pad (delete pad on screen)
m_CurrentPad->SetFlags( DO_NOT_DRAW ); m_CurrentPad->SetFlags( DO_NOT_DRAW );
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentPad->GetBoundingBox() ); m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentPad->GetBoundingBox() );
m_CurrentPad->ClearFlags( DO_NOT_DRAW ); m_CurrentPad->ClearFlags( DO_NOT_DRAW );
// Update values // Update values
@ -673,7 +673,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
m_CurrentPad->DisplayInfo( m_Parent ); m_CurrentPad->DisplayInfo( m_Parent );
// redraw the area where the pad was // redraw the area where the pad was
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentPad->GetBoundingBox() ); m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentPad->GetBoundingBox() );
m_Parent->OnModify(); m_Parent->OnModify();
} }

View File

@ -68,11 +68,11 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent,
*/ */
void PCB_EDIT_FRAME::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ) void PCB_EDIT_FRAME::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC )
{ {
DrawPanel->m_IgnoreMouseEvents = TRUE; m_canvas->m_IgnoreMouseEvents = TRUE;
DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC ); DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC );
dlg.ShowModal(); dlg.ShowModal();
DrawPanel->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
DrawPanel->m_IgnoreMouseEvents = FALSE; m_canvas->m_IgnoreMouseEvents = FALSE;
} }
@ -102,6 +102,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
m_Parent->GetInternalUnits() ); m_Parent->GetInternalUnits() );
int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers(); int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers();
for( int layer = 0; layer < NB_LAYERS; ++layer ) for( int layer = 0; layer < NB_LAYERS; ++layer )
{ {
if( enabledLayers & (1 << layer) ) if( enabledLayers & (1 << layer) )
@ -109,6 +110,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
layerList.push_back( layer ); layerList.push_back( layer );
int itemIndex = int itemIndex =
m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) ); m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) );
if( m_SelectedPCBText->GetLayer() == layer ) if( m_SelectedPCBText->GetLayer() == layer )
m_LayerSelectionCtrl->SetSelection( itemIndex ); m_LayerSelectionCtrl->SetSelection( itemIndex );
} }
@ -119,14 +121,17 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
default: default:
m_OrientationCtrl->SetSelection( 0 ); m_OrientationCtrl->SetSelection( 0 );
break; break;
case 900: case 900:
case -2700: case -2700:
m_OrientationCtrl->SetSelection( 1 ); m_OrientationCtrl->SetSelection( 1 );
break; break;
case 1800: case 1800:
case -1800: case -1800:
m_OrientationCtrl->SetSelection( 2 ); m_OrientationCtrl->SetSelection( 2 );
break; break;
case 2700: case 2700:
case -900: case -900:
m_OrientationCtrl->SetSelection( 3 ); m_OrientationCtrl->SetSelection( 3 );
@ -185,7 +190,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
// Erase old text on screen if context is available // Erase old text on screen if context is available
if( m_DC ) if( m_DC )
{ {
m_SelectedPCBText->Draw( m_Parent->DrawPanel, m_DC, GR_XOR ); m_SelectedPCBText->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR );
} }
// Set the new text content // Set the new text content
@ -195,32 +200,45 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
} }
// Set PCB Text position // Set PCB Text position
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(), m_Parent->GetInternalUnits() ); newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(),
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(), m_Parent->GetInternalUnits() ); m_Parent->GetInternalUnits() );
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(),
m_Parent->GetInternalUnits() );
m_SelectedPCBText->m_Pos = newPosition; m_SelectedPCBText->m_Pos = newPosition;
// Check constraints and set PCB Text size // Check constraints and set PCB Text size
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(), m_Parent->GetInternalUnits() ); newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(),
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(), m_Parent->GetInternalUnits() ); m_Parent->GetInternalUnits() );
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(),
m_Parent->GetInternalUnits() );
if( newSize.x < TEXTS_MIN_SIZE ) if( newSize.x < TEXTS_MIN_SIZE )
newSize.x = TEXTS_MIN_SIZE; newSize.x = TEXTS_MIN_SIZE;
if( newSize.y < TEXTS_MIN_SIZE ) if( newSize.y < TEXTS_MIN_SIZE )
newSize.y = TEXTS_MIN_SIZE; newSize.y = TEXTS_MIN_SIZE;
if( newSize.x > TEXTS_MAX_WIDTH ) if( newSize.x > TEXTS_MAX_WIDTH )
newSize.x = TEXTS_MAX_WIDTH; newSize.x = TEXTS_MAX_WIDTH;
if( newSize.y > TEXTS_MAX_WIDTH ) if( newSize.y > TEXTS_MAX_WIDTH )
newSize.y = TEXTS_MAX_WIDTH; newSize.y = TEXTS_MAX_WIDTH;
m_SelectedPCBText->m_Size = newSize; m_SelectedPCBText->m_Size = newSize;
// Set the new thickness // Set the new thickness
m_SelectedPCBText->m_Thickness = ReturnValueFromString( g_UserUnit, m_ThicknessCtrl->GetValue(), m_Parent->GetInternalUnits() ); m_SelectedPCBText->m_Thickness = ReturnValueFromString( g_UserUnit,
m_ThicknessCtrl->GetValue(),
m_Parent->GetInternalUnits() );
// Test for acceptable values for thickness and size and clamp if fails // Test for acceptable values for thickness and size and clamp if fails
int maxthickness = Clamp_Text_PenSize( m_SelectedPCBText->m_Thickness, m_SelectedPCBText->m_Size ); int maxthickness = Clamp_Text_PenSize( m_SelectedPCBText->m_Thickness,
m_SelectedPCBText->m_Size );
if( m_SelectedPCBText->m_Thickness > maxthickness ) if( m_SelectedPCBText->m_Thickness > maxthickness )
{ {
DisplayError(NULL, _("The text thickness is too large for the text size. It will be clamped")); DisplayError( NULL,
_( "The text thickness is too large for the text size. It will be clamped" ) );
m_SelectedPCBText->m_Thickness = maxthickness; m_SelectedPCBText->m_Thickness = maxthickness;
} }
@ -255,8 +273,9 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
// Finally, display new text if there is a context to do so // Finally, display new text if there is a context to do so
if( m_DC ) if( m_DC )
{ {
m_SelectedPCBText->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); m_SelectedPCBText->Draw( m_Parent->GetCanvas(), m_DC, GR_OR );
} }
m_Parent->OnModify(); m_Parent->OnModify();
EndModal( 1 ); EndModal( 1 );
} }

Some files were not shown because too many files have changed in this diff Show More