More encapsulation improvements.
* EDA_DRAW_FRAME completely encapsulated. * Encapsulate the the low hanging fruit in EDA_DRAW_PANEL.
This commit is contained in:
parent
2df818b844
commit
c2e5fcaec8
|
@ -228,11 +228,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
|
|||
case BLOCK_MIRROR_X:
|
||||
case BLOCK_MIRROR_Y: /* mirror */
|
||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
Block->InitData( DrawPanel, startpos );
|
||||
Block->InitData( m_canvas, startpos );
|
||||
break;
|
||||
|
||||
case BLOCK_PASTE:
|
||||
Block->InitData( DrawPanel, startpos );
|
||||
Block->InitData( m_canvas, startpos );
|
||||
Block->m_BlockLastCursorPosition.x = 0;
|
||||
Block->m_BlockLastCursorPosition.y = 0;
|
||||
InitBlockPasteInfos();
|
||||
|
@ -241,11 +241,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
|
|||
{
|
||||
DisplayError( this, wxT( "No Block to paste" ), 20 );
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
Block->m_ItemsSelection.ClearItemsList();
|
||||
DisplayError( this,
|
||||
|
@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
|
|||
}
|
||||
|
||||
Block->m_State = STATE_BLOCK_MOVE;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, startpos, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -25,9 +25,9 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
|
|||
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
|
||||
{
|
||||
if( GetScreen()->IsBlockActive() )
|
||||
DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) );
|
||||
m_canvas->SetCursor( wxCursor( m_canvas->GetDefaultCursor() ) );
|
||||
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
|||
int ClipboardSizeX, ClipboardSizeY;
|
||||
bool DrawBlock = false;
|
||||
wxRect DrawArea;
|
||||
BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen();
|
||||
BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
|
||||
|
||||
/* scale is the ratio resolution/internal units */
|
||||
float scale = 82.0 / aFrame->GetInternalUnits();
|
||||
|
@ -73,7 +73,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
|||
|
||||
wxMetafileDC dc;
|
||||
|
||||
EDA_RECT tmp = aFrame->DrawPanel->m_ClipBox;
|
||||
EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox;
|
||||
GRResetPenAndBrush( &dc );
|
||||
const bool plotBlackAndWhite = false;
|
||||
GRForceBlackPen( plotBlackAndWhite );
|
||||
|
@ -81,10 +81,10 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
|||
dc.SetUserScale( scale, scale );
|
||||
ClipboardSizeX = dc.MaxX() + 10;
|
||||
ClipboardSizeY = dc.MaxY() + 10;
|
||||
aFrame->DrawPanel->m_ClipBox.SetX( 0 );
|
||||
aFrame->DrawPanel->m_ClipBox.SetY( 0 );
|
||||
aFrame->DrawPanel->m_ClipBox.SetWidth( 0x7FFFFF0 );
|
||||
aFrame->DrawPanel->m_ClipBox.SetHeight( 0x7FFFFF0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetX( 0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetY( 0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 );
|
||||
|
||||
if( DrawBlock )
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
|||
const int maskLayer = 0xFFFFFFFF;
|
||||
aFrame->PrintPage( &dc, maskLayer, false );
|
||||
screen->m_IsPrinting = false;
|
||||
aFrame->DrawPanel->m_ClipBox = tmp;
|
||||
aFrame->GetCanvas()->m_ClipBox = tmp;
|
||||
wxMetafile* mf = dc.Close();
|
||||
|
||||
if( mf )
|
||||
|
|
|
@ -37,8 +37,8 @@ void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
|
|||
DIALOG_PAGES_SETTINGS frame( this );
|
||||
int diag = frame.ShowModal();
|
||||
|
||||
if( DrawPanel && diag )
|
||||
DrawPanel->Refresh();
|
||||
if( m_canvas && diag )
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
|
|||
#endif
|
||||
|
||||
m_Screen->SetModify();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
|
|||
m_zoomSelectBox = NULL;
|
||||
m_HotkeysZoomAndGridList = NULL;
|
||||
|
||||
DrawPanel = NULL;
|
||||
m_canvas = NULL;
|
||||
m_messagePanel = NULL;
|
||||
m_currentScreen = NULL;
|
||||
m_toolId = ID_NO_TOOL_SELECTED;
|
||||
|
@ -142,7 +142,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
|
|||
m_FramePos.x = m_FramePos.y = 0;
|
||||
m_FrameSize.y -= m_MsgFrameHeight;
|
||||
|
||||
DrawPanel = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
|
||||
m_canvas = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
|
||||
m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ),
|
||||
wxSize( m_FrameSize.x, m_MsgFrameHeight ) );
|
||||
|
||||
|
@ -182,8 +182,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
|
|||
{
|
||||
m_FrameIsActive = event.GetActive();
|
||||
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
if( m_canvas )
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
event.Skip(); // required under wxMAC
|
||||
}
|
||||
|
@ -191,8 +191,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
|
|||
|
||||
void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
|
||||
{
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
if( m_canvas )
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
|
|||
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
|
||||
{
|
||||
SetGridVisibility( !IsGridVisible() );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -222,10 +222,10 @@ void EDA_DRAW_FRAME::OnSelectUnits( wxCommandEvent& aEvent )
|
|||
|
||||
void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent )
|
||||
{
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
m_cursorShape = !m_cursorShape;
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
}
|
||||
|
||||
|
||||
|
@ -445,9 +445,9 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
|||
// Keep default cursor in toolbars
|
||||
SetCursor( wxNullCursor );
|
||||
|
||||
// Change DrawPanel cursor if requested.
|
||||
if( DrawPanel && aCursor >= 0 )
|
||||
DrawPanel->SetCurrentCursor( aCursor );
|
||||
// Change m_canvas cursor if requested.
|
||||
if( m_canvas && aCursor >= 0 )
|
||||
m_canvas->SetCurrentCursor( aCursor );
|
||||
|
||||
DisplayToolMsg( aToolMsg );
|
||||
|
||||
|
@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
|
|||
void EDA_DRAW_FRAME::InitBlockPasteInfos()
|
||||
{
|
||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -508,7 +508,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
|
|||
BASE_SCREEN* screen = GetScreen();
|
||||
bool noRefresh = true;
|
||||
|
||||
if( screen == NULL || DrawPanel == NULL )
|
||||
if( screen == NULL || m_canvas == NULL )
|
||||
return;
|
||||
|
||||
double scalar = screen->GetScalingFactor();
|
||||
|
@ -518,7 +518,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
|
|||
|
||||
// Calculate the portion of the drawing that can be displayed in the
|
||||
// client area at the current zoom level.
|
||||
clientSize = DrawPanel->GetClientSize();
|
||||
clientSize = m_canvas->GetClientSize();
|
||||
|
||||
// The logical size of the client window.
|
||||
logicalClientSize.x = wxRound( (double) clientSize.x / scalar );
|
||||
|
@ -694,7 +694,7 @@ SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
|
|||
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
|
||||
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
|
||||
|
||||
DrawPanel->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
|
||||
m_canvas->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
|
||||
screen->m_ScrollPixelsPerUnitY,
|
||||
screen->m_ScrollbarNumber.x,
|
||||
screen->m_ScrollbarNumber.y,
|
||||
|
|
|
@ -204,7 +204,7 @@ static int overbar_position( int size_v, int thickness )
|
|||
/**
|
||||
* Function DrawGraphicText
|
||||
* Draw a graphic text (like module texts)
|
||||
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
|
||||
* @param aPanel = the current m_canvas. NULL if draw within a 3D GL Canvas
|
||||
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
|
||||
* @param aPos = text position (according to h_justify, v_justify)
|
||||
* @param aColor (enum EDA_Colors) = text color
|
||||
|
|
|
@ -100,13 +100,13 @@ void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
|
|||
m_Flags = 0;
|
||||
screen->SetModify();
|
||||
screen->SetCurItem( NULL );
|
||||
aFrame->DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
aFrame->DrawPanel->EndMouseCapture();
|
||||
aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
|
||||
aFrame->GetCanvas()->EndMouseCapture();
|
||||
|
||||
if( aDC )
|
||||
{
|
||||
EDA_CROSS_HAIR_MANAGER( aFrame->DrawPanel, aDC ); // Erase schematic cursor
|
||||
Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
EDA_CROSS_HAIR_MANAGER( aFrame->GetCanvas(), aDC ); // Erase schematic cursor
|
||||
Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1028,7 +1028,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( !screen->m_IsPrinting & g_ShowPageLimits )
|
||||
{
|
||||
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,
|
||||
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 */
|
||||
|
||||
#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 );
|
||||
|
||||
#else
|
||||
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 );
|
||||
|
||||
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:
|
||||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_VERT, size,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
width, false, false );
|
||||
|
@ -1082,7 +1082,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
case WS_SEGMENT_LU:
|
||||
xg = Sheet->m_LeftMargin - WsItem->m_Endx;
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
@ -1099,7 +1099,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
case WS_SEGMENT_LT:
|
||||
xg = Sheet->m_LeftMargin + WsItem->m_Endx;
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
@ -1117,10 +1117,10 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
Line.Printf( wxT( "%d" ), jj );
|
||||
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 );
|
||||
}
|
||||
DrawGraphicText( DrawPanel, DC,
|
||||
DrawGraphicText( m_canvas, DC,
|
||||
wxPoint( ( ii - gxpas / 2 ) * scale,
|
||||
( refy + GRID_REF_W / 2 ) * scale ),
|
||||
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 );
|
||||
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 );
|
||||
}
|
||||
DrawGraphicText( DrawPanel, DC,
|
||||
DrawGraphicText( m_canvas, DC,
|
||||
wxPoint( ( ii - gxpas / 2 ) * scale,
|
||||
( yg - GRID_REF_W / 2) * scale ),
|
||||
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 );
|
||||
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 );
|
||||
}
|
||||
DrawGraphicText( DrawPanel, DC,
|
||||
DrawGraphicText( m_canvas, DC,
|
||||
wxPoint( ( refx + GRID_REF_W / 2 ) * scale,
|
||||
( ii - gypas / 2 ) * scale ),
|
||||
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 );
|
||||
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 );
|
||||
}
|
||||
DrawGraphicText( DrawPanel, DC,
|
||||
DrawGraphicText( m_canvas, DC,
|
||||
wxPoint( ( xg - GRID_REF_W / 2 ) * scale,
|
||||
( ii - gxpas / 2 ) * scale ),
|
||||
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:
|
||||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1211,7 +1211,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = WsItem->m_Legende;
|
||||
if( screen->m_NumberOfScreen > 1 )
|
||||
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,
|
||||
GR_TEXT_VJUSTIFY_CENTER, width, false, false );
|
||||
break;
|
||||
|
@ -1220,7 +1220,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
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,
|
||||
GR_TEXT_VJUSTIFY_CENTER, width, false, false );
|
||||
break;
|
||||
|
@ -1229,7 +1229,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Company;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size1_5,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
|
@ -1241,7 +1241,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Title;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size1_5,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
|
@ -1253,14 +1253,14 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Commentaire1;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size3,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
false, false );
|
||||
pos.x = (Sheet->m_LeftMargin + 1260) * scale;
|
||||
pos.y = (Sheet->m_TopMargin + 270) * scale;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, 1800, size2,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
|
@ -1272,7 +1272,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Commentaire2;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1283,7 +1283,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Commentaire3;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1294,7 +1294,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Commentaire4;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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;
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
@ -1332,14 +1332,14 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg = screen->m_Commentaire1;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size3,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
false, false );
|
||||
pos.x = (Sheet->m_LeftMargin + 1260) * scale;
|
||||
pos.y = (Sheet->m_TopMargin + 270) * scale;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, 1800, size2,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
|
@ -1350,7 +1350,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
case WS_PODPIS_D:
|
||||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width,
|
||||
|
@ -1361,7 +1361,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
msg << screen->m_ScreenNumber;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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;
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
@ -1397,7 +1397,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
msg += screen->m_Date;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, true );
|
||||
|
@ -1407,7 +1407,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
msg += screen->m_Revision;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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 += g_ProductName + wxGetApp().GetAppName();
|
||||
msg += wxT( " " ) + GetBuildVersion();
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1429,7 +1429,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
msg += Sheet->m_Name;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1440,7 +1440,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
msg << screen->m_ScreenNumber << wxT( "/" ) << screen->m_NumberOfScreen;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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 << fname << wxT( "." ) << fext;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1466,7 +1466,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
if( WsItem->m_Legende )
|
||||
msg = WsItem->m_Legende;
|
||||
msg += GetScreenDesc();
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1479,7 +1479,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg += screen->m_Company;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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 )
|
||||
msg = WsItem->m_Legende;
|
||||
msg += screen->m_Title;
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1519,7 +1519,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg += screen->m_Commentaire2;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1533,7 +1533,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg += screen->m_Commentaire3;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
width, false, false );
|
||||
|
@ -1547,7 +1547,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
|
|||
msg += screen->m_Commentaire4;
|
||||
if( !msg.IsEmpty() )
|
||||
{
|
||||
DrawGraphicText( DrawPanel, DC, pos, Color,
|
||||
DrawGraphicText( m_canvas, DC, pos, Color,
|
||||
msg, TEXT_ORIENT_HORIZ, size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
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;
|
||||
yg = Sheet->m_Size.y -
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ void EDA_DRAW_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointe
|
|||
|
||||
// Move the mouse cursor to the on grid graphic cursor position
|
||||
if( aWarpPointer )
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
DrawPanel->Refresh();
|
||||
DrawPanel->Update();
|
||||
m_canvas->Refresh();
|
||||
m_canvas->Update();
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect )
|
|||
|
||||
/* Compute the best zoom */
|
||||
Rect.Normalize();
|
||||
size = DrawPanel->GetClientSize();
|
||||
size = m_canvas->GetClientSize();
|
||||
|
||||
// Use ceil to at least show the full rect
|
||||
scalex = (double) Rect.GetSize().x / size.x;
|
||||
|
@ -73,7 +73,7 @@ void EDA_DRAW_FRAME::Window_Zoom( EDA_RECT& Rect )
|
|||
*/
|
||||
void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
|
||||
{
|
||||
if( DrawPanel == NULL )
|
||||
if( m_canvas == NULL )
|
||||
return;
|
||||
|
||||
int i;
|
||||
|
@ -105,7 +105,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_ZOOM_REDRAW:
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_POPUP_ZOOM_CENTER:
|
||||
|
@ -121,7 +121,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_CANCEL:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -149,7 +149,7 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
|
|||
int maxZoomIds;
|
||||
int zoom;
|
||||
wxString msg;
|
||||
BASE_SCREEN * screen = DrawPanel->GetScreen();
|
||||
BASE_SCREEN * screen = m_canvas->GetScreen();
|
||||
|
||||
msg = AddHotkeyName( _( "Center" ), m_HotkeysZoomAndGridList, HK_ZOOM_CENTER );
|
||||
AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
|
||||
|
|
|
@ -128,7 +128,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
|
|||
m_auimgr.AddPane( m_drawToolBar,
|
||||
wxAuiPaneInfo( vert ).Name( wxT( "m_drawToolBar" ) ).Right() );
|
||||
|
||||
m_auimgr.AddPane( DrawPanel,
|
||||
m_auimgr.AddPane( m_canvas,
|
||||
wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
|
||||
|
||||
m_auimgr.AddPane( m_messagePanel,
|
||||
|
@ -313,7 +313,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
if( m_DisplayModText > 2 )
|
||||
m_DisplayModText = 0;
|
||||
|
||||
DrawPanel->Refresh( );
|
||||
m_canvas->Refresh( );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
|
||||
|
@ -322,7 +322,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
if( m_DisplayModEdge > 2 )
|
||||
m_DisplayModEdge = 0;
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -381,25 +381,25 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
|
|||
case WXK_NUMPAD8: /* cursor moved up */
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2: /* cursor moved down */
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4: /* cursor moved left */
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6: /* cursor moved right */
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -409,13 +409,13 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
|
|||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, 0 );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void )
|
|||
m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
|
||||
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
|
||||
m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,7 +83,8 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
|
|||
m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
|
||||
|
||||
m_DisplayFootprintFrame->Zoom_Automatique( false );
|
||||
m_DisplayFootprintFrame->DrawPanel->Refresh();
|
||||
m_DisplayFootprintFrame->GetCanvas()->Refresh();
|
||||
|
||||
// Display new cursor coordinates and zoom value:
|
||||
m_DisplayFootprintFrame->UpdateStatusBar();
|
||||
|
||||
|
@ -115,15 +116,15 @@ void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
if( !GetBoard() )
|
||||
return;
|
||||
|
||||
DrawPanel->DrawBackGround( DC );
|
||||
GetBoard()->Draw( DrawPanel, DC, GR_COPY );
|
||||
m_canvas->DrawBackGround( DC );
|
||||
GetBoard()->Draw( m_canvas, DC, GR_COPY );
|
||||
|
||||
MODULE* Module = GetBoard()->m_Modules;
|
||||
|
||||
if ( Module )
|
||||
Module->DisplayInfo( this );
|
||||
|
||||
DrawPanel->DrawCrossHair( DC );
|
||||
m_canvas->DrawCrossHair( DC );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||
m_CurrentSheet->UpdateAllScreenReferences();
|
||||
SetSheetNumberAndCount();
|
||||
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos()
|
|||
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
|
||||
|
||||
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;
|
||||
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
case BLOCK_MIRROR_Y:
|
||||
case BLOCK_DRAG: /* Drag */
|
||||
case BLOCK_MOVE: /* Move */
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, 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_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector );
|
||||
|
||||
|
@ -160,8 +160,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
break;
|
||||
|
||||
case BLOCK_PASTE:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
PasteListOfItems( DC );
|
||||
block->ClearItemsList();
|
||||
|
@ -182,7 +182,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
GetScreen()->ClearDrawingState();
|
||||
GetScreen()->ClearBlockCommand();
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
@ -190,8 +190,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
block->ClearItemsList();
|
||||
}
|
||||
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,19 +206,19 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
BlockState state = block->m_State;
|
||||
CmdBlockType command = block->m_Command;
|
||||
|
||||
if( DrawPanel->m_endMouseCaptureCallback )
|
||||
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC );
|
||||
if( m_canvas->m_endMouseCaptureCallback )
|
||||
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
|
||||
|
||||
block->m_State = state;
|
||||
block->m_Command = command;
|
||||
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
|
||||
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
|
||||
GetScreen()->SetCrossHairPosition( block->GetEnd() );
|
||||
|
||||
if( block->m_Command != BLOCK_ABORT )
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
}
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
switch( block->m_Command )
|
||||
{
|
||||
|
@ -243,36 +243,36 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
{
|
||||
nextcmd = true;
|
||||
GetScreen()->SelectBlockItems();
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
block->m_State = STATE_BLOCK_MOVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
m_canvas->SetMouseCapture( NULL, NULL );
|
||||
}
|
||||
break;
|
||||
|
||||
case BLOCK_DELETE: /* Delete */
|
||||
GetScreen()->UpdatePickList();
|
||||
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
DeleteItemsInList( DrawPanel, block->m_ItemsSelection );
|
||||
DeleteItemsInList( m_canvas, block->m_ItemsSelection );
|
||||
OnModify();
|
||||
}
|
||||
|
||||
block->ClearItemsList();
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
DrawPanel->Refresh();
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case BLOCK_SAVE: /* Save */
|
||||
GetScreen()->UpdatePickList();
|
||||
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
if( block->m_Command == BLOCK_ABORT )
|
||||
{
|
||||
GetScreen()->ClearDrawingState();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
if( ! nextcmd )
|
||||
|
@ -313,7 +313,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
block->m_State = STATE_NO_BLOCK;
|
||||
block->m_Command = BLOCK_IDLE;
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
}
|
||||
|
||||
|
@ -351,8 +351,8 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
break;
|
||||
|
||||
case BLOCK_DRAG: /* move to Drag */
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
// Clear list of items to move, and rebuild it with items to drag:
|
||||
block->ClearItemsList();
|
||||
|
@ -365,30 +365,30 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
blockCmdFinished = false;
|
||||
GetScreen()->SelectBlockItems();
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
block->m_State = STATE_BLOCK_MOVE;
|
||||
}
|
||||
break;
|
||||
|
||||
case BLOCK_DELETE: /* move to Delete */
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
DeleteItemsInList( DrawPanel, block->m_ItemsSelection );
|
||||
DeleteItemsInList( m_canvas, block->m_ItemsSelection );
|
||||
OnModify();
|
||||
}
|
||||
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
DrawPanel->Refresh();
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case BLOCK_SAVE: /* Save list in paste buffer*/
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
@ -399,15 +399,15 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
break;
|
||||
|
||||
case BLOCK_ZOOM: /* Window Zoom */
|
||||
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC );
|
||||
DrawPanel->SetCursor( DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
|
||||
m_canvas->SetCursor( m_canvas->GetDefaultCursor() );
|
||||
Window_Zoom( GetScreen()->m_BlockLocate );
|
||||
break;
|
||||
|
||||
|
||||
case BLOCK_ROTATE:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
@ -420,13 +420,13 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
OnModify();
|
||||
}
|
||||
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
DrawPanel->Refresh();
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case BLOCK_MIRROR_X:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
@ -438,13 +438,13 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
Mirror_X_ListOfItems( block->m_ItemsSelection, mirrorPoint );
|
||||
OnModify();
|
||||
}
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
DrawPanel->Refresh();
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case BLOCK_MIRROR_Y:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
@ -457,8 +457,8 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
OnModify();
|
||||
}
|
||||
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
DrawPanel->Refresh();
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -469,7 +469,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
|
|||
{
|
||||
block->Clear();
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
}
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
|
|||
}
|
||||
|
||||
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() );
|
||||
GetScreen()->SetDrawItems( Struct );
|
||||
}
|
||||
|
|
|
@ -92,13 +92,13 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
{
|
||||
BlockState state = GetScreen()->m_BlockLocate.m_State;
|
||||
CmdBlockType command = GetScreen()->m_BlockLocate.m_Command;
|
||||
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC );
|
||||
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
|
||||
GetScreen()->m_BlockLocate.m_State = state;
|
||||
GetScreen()->m_BlockLocate.m_Command = command;
|
||||
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
|
||||
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
|
||||
GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(),
|
||||
GetScreen()->m_BlockLocate.GetBottom() ) );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
}
|
||||
|
||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||
|
@ -118,21 +118,21 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
{
|
||||
nextCmd = true;
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
}
|
||||
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
nextCmd = true;
|
||||
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||
break;
|
||||
|
||||
|
@ -205,9 +205,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
return nextCmd;
|
||||
|
@ -218,7 +218,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
{
|
||||
wxPoint pt;
|
||||
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
if ( m_component )
|
||||
m_component->MoveSelectedItems( pt );
|
||||
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case BLOCK_COPY: /* Copy */
|
||||
|
@ -302,8 +302,8 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
|||
{
|
||||
s_ConnexionStartPoint = cursorpos;
|
||||
s_OldWiresList = GetScreen()->ExtractWires( true );
|
||||
GetScreen()->SchematicCleanUp( DrawPanel );
|
||||
GetScreen()->SchematicCleanUp( m_canvas );
|
||||
|
||||
switch( type )
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
|||
}
|
||||
|
||||
GetScreen()->SetCurItem( newsegment );
|
||||
DrawPanel->SetMouseCapture( DrawSegment, AbortCreateNewLine );
|
||||
m_canvas->SetMouseCapture( DrawSegment, AbortCreateNewLine );
|
||||
m_itemToRepeat = NULL;
|
||||
}
|
||||
else // A segment is in progress: terminates the current segment and add a new segment.
|
||||
|
@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
|||
return;
|
||||
}
|
||||
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
/* Creates the new segment, or terminates the command
|
||||
* if the end point is on a pin, junction or an other wire or bus */
|
||||
|
@ -193,9 +193,9 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
|||
|
||||
oldsegment->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( oldsegment );
|
||||
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor
|
||||
oldsegment->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( DC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOff( DC ); // Erase schematic cursor
|
||||
oldsegment->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( DC ); // Display schematic cursor
|
||||
|
||||
/* Create a new segment, and chain it after the current new segment */
|
||||
if( nextsegment )
|
||||
|
@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
|||
oldsegment->SetFlags( SELECTED );
|
||||
newsegment->SetFlags( IS_NEW );
|
||||
GetScreen()->SetCurItem( newsegment );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
/* This is the first segment: Now we know the start segment position.
|
||||
* Create a junction if needed. Note: a junction can be needed later,
|
||||
|
@ -282,7 +282,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
|||
GetScreen()->SetDrawItems( lastsegment );
|
||||
}
|
||||
|
||||
DrawPanel->EndMouseCapture( -1, -1, wxEmptyString, false );
|
||||
m_canvas->EndMouseCapture( -1, -1, wxEmptyString, false );
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
|
||||
wxPoint end_point, alt_end_point;
|
||||
|
@ -298,7 +298,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
|||
alt_end_point = lastsegment->GetStartPoint();
|
||||
}
|
||||
|
||||
GetScreen()->SchematicCleanUp( DrawPanel );
|
||||
GetScreen()->SchematicCleanUp( m_canvas );
|
||||
|
||||
/* clear flags and find last segment entered, for repeat function */
|
||||
segment = (SCH_LINE*) GetScreen()->GetDrawItems();
|
||||
|
@ -329,10 +329,10 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
|||
if( GetScreen()->IsJunctionNeeded( s_ConnexionStartPoint ) )
|
||||
AddJunction( DC, s_ConnexionStartPoint );
|
||||
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
|
||||
/* Redraw wires and junctions which can be changed by TestDanglingEnds() */
|
||||
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor
|
||||
m_canvas->CrossHairOff( DC ); // Erase schematic cursor
|
||||
EDA_ITEM* item = GetScreen()->GetDrawItems();
|
||||
|
||||
while( item )
|
||||
|
@ -341,7 +341,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
|||
{
|
||||
case SCH_JUNCTION_T:
|
||||
case SCH_LINE_T:
|
||||
DrawPanel->RefreshDrawingRect( item->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( item->GetBoundingBox() );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -351,7 +351,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
|||
item = item->Next();
|
||||
}
|
||||
|
||||
DrawPanel->CrossHairOn( DC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOn( DC ); // Display schematic cursor
|
||||
|
||||
SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE );
|
||||
s_OldWiresList = NULL;
|
||||
|
@ -436,15 +436,15 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
|
|||
}
|
||||
|
||||
polyLine->SetPoint( idx, endpos );
|
||||
polyLine->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
polyLine->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSegment( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawSegment( m_canvas, DC, wxDefaultPosition, false );
|
||||
}
|
||||
|
||||
screen->RemoveFromDrawList( screen->GetCurItem() );
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
screen->SetCurItem( NULL );
|
||||
}
|
||||
|
||||
|
@ -456,9 +456,9 @@ SCH_JUNCTION* SCH_EDIT_FRAME::AddJunction( wxDC* aDC, const wxPoint& aPosition,
|
|||
|
||||
m_itemToRepeat = junction;
|
||||
|
||||
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
junction->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
junction->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( aDC ); // Display schematic cursor
|
||||
|
||||
junction->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( junction );
|
||||
|
@ -478,9 +478,9 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( wxDC* aDC, const wxPoint& aPositio
|
|||
NewNoConnect = new SCH_NO_CONNECT( aPosition );
|
||||
m_itemToRepeat = NewNoConnect;
|
||||
|
||||
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
NewNoConnect->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
NewNoConnect->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( aDC ); // Display schematic cursor
|
||||
|
||||
NewNoConnect->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( NewNoConnect );
|
||||
|
@ -528,7 +528,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
|
|||
m_itemToRepeat->SetFlags( IS_NEW );
|
||||
( (SCH_COMPONENT*) m_itemToRepeat )->SetTimeStamp( GetNewTimeStamp() );
|
||||
m_itemToRepeat->Move( pos );
|
||||
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
MoveItem( m_itemToRepeat, DC );
|
||||
return;
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
|
|||
m_itemToRepeat->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( m_itemToRepeat );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
SaveCopyInUndoList( m_itemToRepeat, UR_NEW );
|
||||
m_itemToRepeat->ClearFlags();
|
||||
}
|
||||
|
|
|
@ -74,10 +74,10 @@ void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int en
|
|||
|
||||
s_LastShape = entry_shape == '/' ? '/' : '\\';
|
||||
|
||||
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
BusEntry->SetBusEntryShape( s_LastShape );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
OnModify( );
|
||||
}
|
||||
|
|
|
@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
|
|||
|
||||
// If the user aborted the clarification context menu, don't show it again at the
|
||||
// off grid position.
|
||||
if( !item && DrawPanel->m_AbortRequest )
|
||||
if( !item && m_canvas->m_AbortRequest )
|
||||
{
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
|
|||
|
||||
if( !item )
|
||||
{
|
||||
DrawPanel->m_AbortRequest = false; // Just in case the user aborted the context menu.
|
||||
m_canvas->m_AbortRequest = false; // Just in case the user aborted the context menu.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -171,9 +171,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
|
|||
|
||||
// Set to NULL in case user aborts the clarification context menu.
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->m_AbortRequest = true; // Changed to false if an item is selected
|
||||
m_canvas->m_AbortRequest = true; // Changed to false if an item is selected
|
||||
PopupMenu( &selectMenu );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
item = GetScreen()->GetCurItem();
|
||||
}
|
||||
}
|
||||
|
@ -208,25 +208,25 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -240,23 +240,23 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
#ifdef USE_WX_OVERLAY
|
||||
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
|
||||
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
|
||||
oDC.Clear();
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
|
||||
#else
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
#endif
|
||||
}
|
||||
#ifdef USE_WX_OVERLAY
|
||||
else
|
||||
DrawPanel->m_overlay.Reset();
|
||||
m_canvas->m_overlay.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -291,25 +291,25 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -323,23 +323,23 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
#ifdef USE_WX_OVERLAY
|
||||
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
|
||||
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
|
||||
oDC.Clear();
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
|
||||
#else
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
#endif
|
||||
}
|
||||
#ifdef USE_WX_OVERLAY
|
||||
else
|
||||
DrawPanel->m_overlay.Reset();
|
||||
m_canvas->m_overlay.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -371,25 +371,25 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -403,13 +403,13 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
|||
message = _( "Clear and annotate all of the components " );
|
||||
else
|
||||
message = _( "Annotate only the unannotated components " );
|
||||
|
||||
if( GetLevel() )
|
||||
message += _( "on the entire schematic?" );
|
||||
else
|
||||
|
@ -125,13 +126,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
|||
|
||||
message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
|
||||
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
|
||||
|
||||
if (response == wxCANCEL)
|
||||
return;
|
||||
|
||||
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
|
||||
(ANNOTATE_OPTION_T) GetAnnotateAlgo(),
|
||||
GetResetItems() , true );
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
m_btnClear->Enable();
|
||||
}
|
||||
|
@ -150,12 +152,13 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
|
|||
message += _( "the current sheet?" );
|
||||
|
||||
message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
|
||||
response = wxMessageBox( message, wxT( "" ),
|
||||
wxICON_EXCLAMATION | wxOK | wxCANCEL );
|
||||
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
|
||||
|
||||
if (response == wxCANCEL)
|
||||
return;
|
||||
|
||||
m_Parent->DeleteAnnotation( GetLevel() ? false : true );
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
m_btnClear->Enable(false);
|
||||
}
|
||||
|
|
|
@ -212,7 +212,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
|
|||
SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units
|
||||
|
||||
screen->SetScalingFactor( 1.0 );
|
||||
EDA_DRAW_PANEL* panel = frame->DrawPanel;
|
||||
EDA_DRAW_PANEL* panel = frame->GetCanvas();
|
||||
|
||||
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
|
||||
// to print floating point numbers like 1.3)
|
||||
|
|
|
@ -289,14 +289,17 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
|
|||
g_DrawBgColor = BLACK;
|
||||
|
||||
bool warning = false;
|
||||
|
||||
for( int ii = 0; ii < MAX_LAYERS; ii++ )
|
||||
{
|
||||
g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ];
|
||||
|
||||
if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] )
|
||||
warning = true;
|
||||
}
|
||||
|
||||
m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] );
|
||||
|
||||
if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] )
|
||||
warning = true;
|
||||
|
||||
|
@ -311,11 +314,9 @@ void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event )
|
|||
// Prompt the user if an item has the same color as the background
|
||||
// because this item cannot be seen:
|
||||
if( warning )
|
||||
wxMessageBox(
|
||||
_("Warning:\nSome items have the same color as the background\nand they will not be seen on screen")
|
||||
);
|
||||
wxMessageBox( _("Warning:\nSome items have the same color as the background\nand they will not be seen on screen") );
|
||||
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
EndModal( 1 );
|
||||
}
|
||||
|
@ -330,7 +331,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event )
|
|||
void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event )
|
||||
{
|
||||
UpdateColorsSettings();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
|
|||
wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T,
|
||||
wxT( "Invalid component object pointer. Bad Programmer!" ) );
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this );
|
||||
|
||||
|
@ -54,8 +54,8 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
|
|||
// so it comes up wide enough next time.
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
dlg->Destroy();
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
|
|||
|
||||
m_Parent->OnModify();
|
||||
m_Parent->GetScreen()->TestDanglingEnds();
|
||||
m_Parent->DrawPanel->Refresh( true );
|
||||
m_Parent->GetCanvas()->Refresh( true );
|
||||
|
||||
EndModal( 0 );
|
||||
}
|
||||
|
@ -834,8 +834,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
|||
if( m_Cmp->m_Flags == 0 )
|
||||
m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED );
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, m_Parent->DrawPanel );
|
||||
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() );
|
||||
m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
// Initialize field values to default values found in library:
|
||||
LIB_FIELD& refField = entry->GetReferenceField();
|
||||
|
@ -850,6 +850,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
|||
|
||||
m_Parent->OnModify();
|
||||
|
||||
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
EndModal( 1 );
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ void DialogLabelEditor::OnOkClick( wxCommandEvent& aEvent )
|
|||
|
||||
void DialogLabelEditor::OnCancelClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_Parent->DrawPanel->MoveCursorToCrossHair();
|
||||
m_Parent->GetCanvas()->MoveCursorToCrossHair();
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
|
|||
if( m_CurrentText->GetFlags() == 0 )
|
||||
m_Parent->SaveCopyInUndoList( m_CurrentText, UR_CHANGED );
|
||||
|
||||
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
|
||||
text = m_textLabel->GetValue();
|
||||
|
||||
|
@ -269,7 +269,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
|
|||
if( m_CurrentText->IsNew() )
|
||||
g_DefaultTextLabelSize = m_CurrentText->m_Size.x;
|
||||
|
||||
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
m_Parent->DrawPanel->MoveCursorToCrossHair();
|
||||
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
m_Parent->GetCanvas()->MoveCursorToCrossHair();
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
|
|||
if( m_component == NULL )
|
||||
return;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
|
||||
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_component );
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
|
|||
|
||||
ScreenList.DeleteAllMarkers( MARK_ERC );
|
||||
m_MarkersList->ClearList();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -563,7 +563,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
|||
DisplayERC_MarkersList();
|
||||
|
||||
// Display new markers:
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
if( m_writeErcFile )
|
||||
{
|
||||
|
|
|
@ -316,7 +316,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
|
|||
wxRect fitRect;
|
||||
wxDC* dc = GetDC();
|
||||
SCH_EDIT_FRAME* parent = m_Parent->GetParent();
|
||||
EDA_DRAW_PANEL* panel = parent->DrawPanel;
|
||||
EDA_DRAW_PANEL* panel = parent->GetCanvas();
|
||||
|
||||
wxBusyCursor dummy;
|
||||
|
||||
|
|
|
@ -133,9 +133,9 @@ SCH_BITMAP* SCH_EDIT_FRAME::CreateNewImage( wxDC* aDC )
|
|||
|
||||
|
||||
image->SetFlags( IS_NEW | IS_MOVED );
|
||||
image->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
image->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
DrawPanel->SetMouseCapture( moveBitmap, abortMoveBitmap );
|
||||
m_canvas->SetMouseCapture( moveBitmap, abortMoveBitmap );
|
||||
GetScreen()->SetCurItem( image );
|
||||
|
||||
OnModify();
|
||||
|
@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::MoveImage( SCH_BITMAP* aImageItem, wxDC* aDC )
|
|||
{
|
||||
aImageItem->SetFlags( IS_MOVED );
|
||||
|
||||
DrawPanel->SetMouseCapture( moveBitmap, abortMoveBitmap );
|
||||
m_canvas->SetMouseCapture( moveBitmap, abortMoveBitmap );
|
||||
GetScreen()->SetCurItem( aImageItem );
|
||||
m_itemToRepeat = NULL;
|
||||
|
||||
SetUndoItem( aImageItem );
|
||||
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
GetScreen()->SetCrossHairPosition( aImageItem->GetPosition() );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ void SCH_EDIT_FRAME::RotateImage( SCH_BITMAP* aItem )
|
|||
|
||||
aItem->Rotate( aItem->GetPosition() );
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis )
|
||||
|
@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::MirrorImage( SCH_BITMAP* aItem, bool Is_X_axis )
|
|||
aItem->Mirror_Y( aItem->GetPosition().x );
|
||||
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
|
||||
|
@ -196,5 +196,5 @@ void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
|
|||
|
||||
dlg.TransfertToImage(aItem->m_Image);
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
|
|||
// Don't use GetText() here. If the field is the reference designator and it's parent
|
||||
// component has multiple parts, we don't want the part suffix added to the field.
|
||||
wxString newtext = aField->m_Text;
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
wxString title;
|
||||
title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
|
||||
|
@ -82,8 +82,8 @@ create a new power component with the new value." ), GetChars( entry->GetName()
|
|||
wxTextEntryDialog dlg( this, wxEmptyString , title, newtext );
|
||||
int response = dlg.ShowModal();
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
newtext = dlg.GetValue( );
|
||||
newtext.Trim( true );
|
||||
newtext.Trim( false );
|
||||
|
@ -91,7 +91,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
|
|||
if ( response != wxID_OK || newtext == aField->GetText() )
|
||||
return; // canceled by user
|
||||
|
||||
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
if( !newtext.IsEmpty() )
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
|
|||
}
|
||||
}
|
||||
|
||||
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
component->DisplayInfo( this );
|
||||
OnModify();
|
||||
}
|
||||
|
@ -152,14 +152,14 @@ void SCH_EDIT_FRAME::RotateField( SCH_FIELD* aField, wxDC* aDC )
|
|||
if( aField->GetFlags() == 0 )
|
||||
SaveCopyInUndoList( component, UR_CHANGED );
|
||||
|
||||
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
if( aField->m_Orient == TEXT_ORIENT_HORIZ )
|
||||
aField->m_Orient = TEXT_ORIENT_VERT;
|
||||
else
|
||||
aField->m_Orient = TEXT_ORIENT_HORIZ;
|
||||
|
||||
aField->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
|
|
@ -60,12 +60,12 @@ void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC )
|
|||
if( aTextItem->GetFlags() == 0 )
|
||||
SaveCopyInUndoList( aTextItem, UR_CHANGED );
|
||||
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
aTextItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
aTextItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
aTextItem->SetOrientation( orient );
|
||||
OnModify();
|
||||
aTextItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
aTextItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +106,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
|
|||
textItem->m_Size.x = textItem->m_Size.y = g_DefaultTextLabelSize;
|
||||
textItem->SetFlags( IS_NEW | IS_MOVED );
|
||||
|
||||
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
EditSchematicText( textItem );
|
||||
|
||||
if( textItem->m_Text.IsEmpty() )
|
||||
|
@ -124,7 +124,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )
|
|||
lastGlobalLabelShape = textItem->GetShape();
|
||||
}
|
||||
|
||||
textItem->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
textItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
MoveItem( (SCH_ITEM*) textItem, aDC );
|
||||
|
||||
return textItem;
|
||||
|
@ -220,17 +220,17 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
|
|||
* put in undo list later, at the end of the current command (if not aborted)
|
||||
*/
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
DrawPanel->CrossHairOff( &dc ); // Erase schematic cursor
|
||||
text->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
m_canvas->CrossHairOff( &dc ); // Erase schematic cursor
|
||||
text->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
screen->RemoveFromDrawList( text );
|
||||
screen->AddToDrawList( newtext );
|
||||
GetScreen()->SetCurItem( newtext );
|
||||
m_itemToRepeat = NULL;
|
||||
OnModify();
|
||||
newtext->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( &dc ); // redraw schematic cursor
|
||||
newtext->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( &dc ); // redraw schematic cursor
|
||||
|
||||
if( text->IsNew() )
|
||||
{
|
||||
|
|
|
@ -47,16 +47,16 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
if( GetScreen() == NULL )
|
||||
return;
|
||||
|
||||
DrawPanel->DrawBackGround( DC );
|
||||
m_canvas->DrawBackGround( DC );
|
||||
|
||||
GetScreen()->Draw( DrawPanel, DC, GR_DEFAULT_DRAWMODE );
|
||||
GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
|
||||
|
||||
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, FALSE );
|
||||
|
||||
DrawPanel->DrawCrossHair( DC );
|
||||
m_canvas->DrawCrossHair( DC );
|
||||
|
||||
// Display the sheet filename, and the sheet path, for non root sheets
|
||||
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
|
||||
|
|
|
@ -170,13 +170,13 @@ bool EDA_APP::OnInit()
|
|||
wxSetWorkingDirectory( filename.GetPath() );
|
||||
|
||||
if( frame->LoadOneEEProject( filename.GetFullPath(), false ) )
|
||||
frame->DrawPanel->Refresh( true );
|
||||
frame->GetCanvas()->Refresh( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Read a default config file if no file to load.
|
||||
frame->LoadProjectFile( wxEmptyString, true );
|
||||
frame->DrawPanel->Refresh( true );
|
||||
frame->GetCanvas()->Refresh( true );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
|
|||
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
|
||||
dlg.SetShowGrid( IsGridVisible() );
|
||||
dlg.SetShowHiddenPins( m_showAllPins );
|
||||
dlg.SetEnableAutoPan( DrawPanel->m_AutoPAN_Enable );
|
||||
dlg.SetEnableAutoPan( m_canvas->m_AutoPAN_Enable );
|
||||
dlg.SetEnableHVBusOrientation( g_HVLines );
|
||||
dlg.SetShowPageLimits( g_ShowPageLimits );
|
||||
dlg.Layout();
|
||||
|
@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
|
|||
SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 );
|
||||
SetGridVisibility( dlg.GetShowGrid() );
|
||||
m_showAllPins = dlg.GetShowHiddenPins();
|
||||
DrawPanel->m_AutoPAN_Enable = dlg.GetEnableAutoPan();
|
||||
m_canvas->m_AutoPAN_Enable = dlg.GetEnableAutoPan();
|
||||
g_HVLines = dlg.GetEnableHVBusOrientation();
|
||||
g_ShowPageLimits = dlg.GetShowPageLimits();
|
||||
|
||||
|
@ -247,7 +247,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
|
|||
if( !curr_item || curr_item->GetFlags() )
|
||||
return;
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
switch( curr_item->Type() )
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
|
|||
MoveItem( (SCH_ITEM*) newitem, &dc );
|
||||
|
||||
// Redraw the original part, because StartMovePart() erased it from screen.
|
||||
curr_item->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -49,7 +49,7 @@ void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
|
|||
MoveItem( (SCH_ITEM*) newitem, &dc );
|
||||
|
||||
/* Redraw the original part in XOR mode */
|
||||
curr_item->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
curr_item->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
|
|||
LoadProjectFile( wxEmptyString, true );
|
||||
Zoom_Automatique( false );
|
||||
SetSheetNumberAndCount();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
|
|||
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
||||
Zoom_Automatique( false );
|
||||
SetSheetNumberAndCount();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
return diag;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
|||
|
||||
|
||||
/* There may be need to reframe the drawing */
|
||||
if( ! DrawPanel->IsPointOnDisplay( pos ) )
|
||||
if( ! m_canvas->IsPointOnDisplay( pos ) )
|
||||
{
|
||||
centerAndRedraw = true;
|
||||
}
|
||||
|
@ -221,16 +221,16 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
|||
|
||||
else
|
||||
{
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
|
||||
if( aWarpMouse )
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
|
||||
GetScreen()->SetCrossHairPosition(pos);
|
||||
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
static wxString lastCommponentName;
|
||||
|
||||
m_itemToRepeat = NULL;
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
if( !libname.IsEmpty() )
|
||||
{
|
||||
|
@ -122,8 +122,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
|
||||
if ( dlg.ShowModal() == wxID_CANCEL )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -140,8 +140,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
|
||||
if( Name.IsEmpty() )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -157,8 +157,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
|
||||
if( Name.IsEmpty() )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -168,8 +168,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
|
||||
if( GetNameOfPartToLoad( this, Library, Name ) == 0 )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -180,8 +180,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
|
||||
if( Name.IsEmpty() )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -200,14 +200,14 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
|
||||
if( Entry == NULL )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
if( Entry == NULL )
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
|||
// Set the component value that can differ from component name in lib, for aliases
|
||||
component->GetField( VALUE )->m_Text = Name;
|
||||
component->DisplayInfo( this );
|
||||
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
component->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
component->SetFlags( IS_NEW );
|
||||
|
||||
MoveItem( (SCH_ITEM*) component, DC );
|
||||
|
@ -252,7 +252,7 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
|
|||
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
if( component->GetFlags() == 0 )
|
||||
{
|
||||
|
@ -260,27 +260,27 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
|
|||
GetScreen()->SetCurItem( NULL );
|
||||
}
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
// Erase the previous component in it's current orientation.
|
||||
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
|
||||
if( component->GetFlags() )
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
else
|
||||
DrawPanel->RefreshDrawingRect( component->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( component->GetBoundingBox() );
|
||||
|
||||
component->SetOrientation( aOrientation );
|
||||
|
||||
/* Redraw the component in the new position. */
|
||||
if( component->GetFlags() )
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
else
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, &dc );
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
GetScreen()->TestDanglingEnds( m_canvas, &dc );
|
||||
OnModify();
|
||||
}
|
||||
|
||||
|
@ -296,9 +296,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
|
|||
wxCHECK_RET( item != NULL && item->Type() == SCH_COMPONENT_T,
|
||||
wxT( "Cannot select unit of invalid schematic item." ) );
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
|
||||
|
||||
|
@ -330,9 +330,9 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
|
|||
SaveCopyInUndoList( component, UR_CHANGED );
|
||||
|
||||
if( flags )
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
else
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
/* Update the unit number. */
|
||||
component->SetUnitSelection( m_CurrentSheet, unit );
|
||||
|
@ -342,11 +342,11 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
|
|||
|
||||
/* Redraw the component in the new position. */
|
||||
if( flags )
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
else
|
||||
component->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
OnModify();
|
||||
}
|
||||
|
||||
|
@ -372,9 +372,9 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
|
|||
int flags = DrawComponent->GetFlags();
|
||||
|
||||
if( DrawComponent->GetFlags() )
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
else
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 );
|
||||
|
||||
|
@ -392,10 +392,10 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
|
|||
|
||||
/* Redraw the component in the new position. */
|
||||
if( DrawComponent->IsMoving() )
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode, g_GhostColor );
|
||||
else
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawComponent->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
OnModify( );
|
||||
}
|
||||
|
|
|
@ -280,26 +280,26 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
|
|||
// update the References
|
||||
m_CurrentSheet->UpdateAllScreenReferences();
|
||||
SetSheetNumberAndCount();
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
if( screen->m_FirstRedraw )
|
||||
{
|
||||
Zoom_Automatique( false );
|
||||
screen->m_FirstRedraw = false;
|
||||
screen->SetCrossHairPosition( screen->GetScrollCenterPosition() );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
}
|
||||
else
|
||||
{
|
||||
RedrawScreen( screen->GetScrollCenterPosition(), true );
|
||||
}
|
||||
|
||||
// Now refresh DrawPanel. Should be not necessary, but because screen has changed
|
||||
// Now refresh m_canvas. Should be not necessary, but because screen has changed
|
||||
// the previous refresh has set all new draw parameters (scroll position ..)
|
||||
// but most of time there were some inconsitencies about cursor parameters
|
||||
// ( previous position of cursor ...) and artefacts can happen
|
||||
// mainly when sheet size has changed
|
||||
// This second refresh clears artefacts because at this point,
|
||||
// all parameters are now updated
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
|
|||
m_lastLibImportPath = fn.GetPath();
|
||||
DisplayLibInfos();
|
||||
GetScreen()->ClearUndoRedoList();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
delete LibTmp;
|
||||
|
|
|
@ -118,7 +118,7 @@ void LIB_EDIT_FRAME::LoadOneLibraryPart( wxCommandEvent& event )
|
|||
wxString CmpName;
|
||||
LIB_ALIAS* LibEntry = NULL;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
|
||||
if( GetScreen()->IsModify()
|
||||
&& !IsOK( this, _( "Current part not saved.\n\nDiscard current changes?" ) ) )
|
||||
|
@ -235,7 +235,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
if( GetScreen() == NULL )
|
||||
return;
|
||||
|
||||
DrawPanel->DrawBackGround( DC );
|
||||
m_canvas->DrawBackGround( DC );
|
||||
|
||||
if( m_component )
|
||||
{
|
||||
|
@ -246,15 +246,15 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
wxString fieldText = Field->m_Text;
|
||||
wxString fieldfullText = Field->GetFullText( m_unit );
|
||||
Field->m_Text = fieldfullText;
|
||||
m_component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit,
|
||||
m_component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit,
|
||||
m_convert, GR_DEFAULT_DRAWMODE );
|
||||
Field->m_Text = fieldText;
|
||||
}
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
DrawPanel->DrawCrossHair( DC );
|
||||
m_canvas->DrawCrossHair( DC );
|
||||
|
||||
DisplayLibInfos();
|
||||
UpdateStatusBar();
|
||||
|
@ -266,7 +266,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
|
|||
wxFileName fn;
|
||||
wxString msg;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
|
||||
if( m_library == NULL )
|
||||
{
|
||||
|
@ -456,7 +456,7 @@ void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
|
|||
wxArrayString ListNames;
|
||||
wxString msg;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
|
||||
m_lastDrawItem = NULL;
|
||||
m_drawItem = NULL;
|
||||
|
@ -536,7 +536,7 @@ All changes will be lost. Discard changes?" ) ) )
|
|||
m_aliasName.Empty();
|
||||
}
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -550,7 +550,7 @@ void LIB_EDIT_FRAME::CreateNewLibraryPart( wxCommandEvent& event )
|
|||
lost!\n\nClear the current component from the screen?" ) ) )
|
||||
return;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
|
||||
m_drawItem = NULL;
|
||||
|
||||
|
@ -634,7 +634,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
|
|||
m_lastDrawItem = NULL;
|
||||
GetScreen()->ClearUndoRedoList();
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
m_mainToolBar->Refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
|
|||
{
|
||||
DisplayCmpDoc();
|
||||
|
||||
if( DrawPanel->m_AbortRequest )
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
if( m_canvas->m_AbortRequest )
|
||||
m_canvas->m_AbortRequest = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,12 +97,12 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
|
|||
case ID_LIBEDIT_ANCHOR_ITEM_BUTT:
|
||||
SaveCopyInUndoList( m_component );
|
||||
PlaceAnchor();
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxString::Format( wxT( "Unhandled command ID %d" ), GetToolId() ) );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
|
|||
else
|
||||
return;
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
switch( m_drawItem->Type() )
|
||||
{
|
||||
|
@ -187,6 +187,6 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
|
|||
break;
|
||||
}
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
}
|
||||
|
|
|
@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
|||
item = LocateItemUsingCursor( aPosition );
|
||||
|
||||
// If the clarify item selection context menu is aborted, don't show the context menu.
|
||||
if( item == NULL && DrawPanel->m_AbortRequest )
|
||||
if( item == NULL && m_canvas->m_AbortRequest )
|
||||
{
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,9 +88,9 @@ void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
|
|||
|
||||
void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg )
|
||||
{
|
||||
wxSize image_size = DrawPanel->GetClientSize();
|
||||
wxSize image_size = m_canvas->GetClientSize();
|
||||
|
||||
wxClientDC dc( DrawPanel );
|
||||
wxClientDC dc( m_canvas );
|
||||
wxBitmap bitmap( image_size.x, image_size.y );
|
||||
wxMemoryDC memdc;
|
||||
|
||||
|
@ -125,7 +125,7 @@ void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode
|
|||
plot_offset.x = pagesize.x/2;
|
||||
plot_offset.y = pagesize.y/2;
|
||||
|
||||
m_component->Draw( DrawPanel, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE );
|
||||
m_component->Draw( m_canvas, aDC, plot_offset, m_unit, m_convert, GR_DEFAULT_DRAWMODE );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event )
|
|||
SetShowDeMorgan( m_component->HasConversion() );
|
||||
DisplayLibInfos();
|
||||
DisplayCmpDoc();
|
||||
OnModify( );
|
||||
DrawPanel->Refresh();
|
||||
OnModify();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,5 +99,5 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
|
|||
DisplayLibInfos();
|
||||
DisplayCmpDoc();
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
||||
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_Block_Enable = true;
|
||||
if( m_canvas )
|
||||
m_canvas->m_Block_Enable = true;
|
||||
|
||||
EnsureActiveLibExists();
|
||||
ReCreateMenuBar();
|
||||
|
@ -256,7 +256,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
|
|||
m_auimgr.AddPane( m_optionsToolBar,
|
||||
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
|
||||
|
||||
m_auimgr.AddPane( DrawPanel,
|
||||
m_auimgr.AddPane( m_canvas,
|
||||
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
||||
|
||||
m_auimgr.AddPane( m_messagePanel,
|
||||
|
@ -382,7 +382,7 @@ double LIB_EDIT_FRAME::BestZoom()
|
|||
GetScreen()->SetScrollCenterPosition( wxPoint( 0, 0 ) );
|
||||
}
|
||||
|
||||
size = DrawPanel->GetClientSize();
|
||||
size = m_canvas->GetClientSize();
|
||||
|
||||
// Reserve a 10% margin around component bounding box.
|
||||
double margin_scale_factor = 0.8;
|
||||
|
@ -562,7 +562,7 @@ void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event )
|
|||
m_aliasName = m_aliasSelectBox->GetStringSelection();
|
||||
|
||||
DisplayCmpDoc();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -575,7 +575,7 @@ void LIB_EDIT_FRAME::OnSelectPart( wxCommandEvent& event )
|
|||
|
||||
m_lastDrawItem = NULL;
|
||||
m_unit = i + 1;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
DisplayCmpDoc();
|
||||
}
|
||||
|
||||
|
@ -599,7 +599,7 @@ void LIB_EDIT_FRAME::OnViewEntryDoc( 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 )
|
||||
m_convert = 1;
|
||||
|
@ -607,7 +607,7 @@ void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
|
|||
m_convert = 2;
|
||||
|
||||
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();
|
||||
wxPoint pos;
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
wxGetMousePosition( &pos.x, &pos.y );
|
||||
pos.y += 20;
|
||||
|
@ -642,23 +642,23 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_LIBEDIT_CANCEL_EDITING:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->EndMouseCapture();
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->EndMouseCapture();
|
||||
else
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
break;
|
||||
|
||||
case ID_POPUP_LIBEDIT_DELETE_ITEM:
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
break;
|
||||
|
||||
default:
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(),
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(),
|
||||
wxEmptyString );
|
||||
break;
|
||||
}
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
switch( id )
|
||||
{
|
||||
|
@ -678,7 +678,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_LIBEDIT_END_CREATE_ITEM:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
if( m_drawItem )
|
||||
{
|
||||
EndDrawGraphicItem( &dc );
|
||||
|
@ -688,7 +688,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM:
|
||||
if( m_drawItem )
|
||||
{
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
|
||||
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;
|
||||
|
||||
|
@ -717,12 +717,12 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( m_drawItem == NULL )
|
||||
break;
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
int oldFlags = m_drawItem->GetFlags();
|
||||
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 ) );
|
||||
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_lastDrawItem = NULL;
|
||||
break;
|
||||
|
@ -749,7 +749,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( m_drawItem == NULL )
|
||||
break;
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
if( m_drawItem->Type() == LIB_RECTANGLE_T
|
||||
|| m_drawItem->Type() == LIB_CIRCLE_T
|
||||
|| m_drawItem->Type() == LIB_POLYLINE_T
|
||||
|
@ -765,15 +765,15 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( m_drawItem == NULL )
|
||||
break;
|
||||
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
|
||||
if( m_drawItem->Type() == LIB_FIELD_T )
|
||||
{
|
||||
EditField( &dc, (LIB_FIELD*) m_drawItem );
|
||||
}
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
break;
|
||||
|
||||
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 );
|
||||
GlobalSetPins( &dc, (LIB_PIN*) m_drawItem, id );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
break;
|
||||
|
||||
case ID_POPUP_ZOOM_BLOCK:
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM;
|
||||
HandleBlockEnd( &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_DELETE_BLOCK:
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockEnd( &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_COPY_BLOCK:
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
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;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockEnd( &dc );
|
||||
break;
|
||||
|
||||
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;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
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;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_ROTATE_BLOCK:
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_ROTATE;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_PLACE_BLOCK:
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
|
@ -846,7 +846,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
}
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
|
||||
if( GetToolId() == ID_NO_TOOL_SELECTED )
|
||||
m_lastDrawItem = NULL;
|
||||
|
@ -933,7 +933,7 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
|
|||
|
||||
/* Deleting old text. */
|
||||
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 );
|
||||
frame->ShowModal();
|
||||
|
@ -942,7 +942,7 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
|
|||
|
||||
/* Display new text. */
|
||||
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 );
|
||||
}
|
||||
|
||||
|
@ -968,7 +968,7 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
|
|||
DisplayLibInfos();
|
||||
DisplayCmpDoc();
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -984,11 +984,11 @@ void LIB_EDIT_FRAME::OnCreateNewPartFromExisting( wxCommandEvent& event )
|
|||
wxCHECK_RET( m_component != NULL,
|
||||
wxT( "Cannot create new part from non-existent current part." ) );
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
EditField( &dc, &m_component->GetValueField() );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
}
|
||||
|
||||
void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
||||
|
@ -998,13 +998,13 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
|||
if( GetToolId() == ID_NO_TOOL_SELECTED )
|
||||
m_lastDrawItem = NULL;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(),
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(),
|
||||
wxEmptyString );
|
||||
|
||||
switch( id )
|
||||
{
|
||||
case ID_NO_TOOL_SELECTED:
|
||||
SetToolID( id, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( id, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
|
||||
case ID_LIBEDIT_PIN_BUTT:
|
||||
|
@ -1018,7 +1018,7 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
|||
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
||||
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
|
||||
GetEventHandler()->ProcessEvent( cmd );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1047,15 +1047,15 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
|||
break;
|
||||
|
||||
case ID_LIBEDIT_IMPORT_BODY_BUTT:
|
||||
SetToolID( id, DrawPanel->GetDefaultCursor(), _( "Import" ) );
|
||||
SetToolID( id, m_canvas->GetDefaultCursor(), _( "Import" ) );
|
||||
LoadOneSymbol();
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
|
||||
case ID_LIBEDIT_EXPORT_BODY_BUTT:
|
||||
SetToolID( id, DrawPanel->GetDefaultCursor(), _( "Export" ) );
|
||||
SetToolID( id, m_canvas->GetDefaultCursor(), _( "Export" ) );
|
||||
SaveOneSymbol();
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
|
||||
case ID_LIBEDIT_DELETE_ITEM_BUTT:
|
||||
|
@ -1072,7 +1072,7 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
|||
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() )
|
||||
m_drawItem->ClearFlags();
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
|
||||
if( GetToolId() == ID_NO_TOOL_SELECTED )
|
||||
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.
|
||||
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 );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
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." ) );
|
||||
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
SaveCopyInUndoList( m_component );
|
||||
|
||||
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;
|
||||
wxPoint pos = pin->GetPosition();
|
||||
|
||||
m_component->RemoveDrawItem( (LIB_ITEM*) pin, DrawPanel, aDC );
|
||||
m_component->RemoveDrawItem( (LIB_ITEM*) pin, m_canvas, aDC );
|
||||
|
||||
if( SynchronizePins() )
|
||||
{
|
||||
|
@ -1206,25 +1206,25 @@ void LIB_EDIT_FRAME::deleteItem( wxDC* aDC )
|
|||
}
|
||||
}
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_endMouseCaptureCallback( DrawPanel, aDC );
|
||||
m_canvas->m_endMouseCaptureCallback( m_canvas, aDC );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_component->RemoveDrawItem( m_drawItem, DrawPanel, aDC );
|
||||
DrawPanel->Refresh();
|
||||
m_component->RemoveDrawItem( m_drawItem, m_canvas, aDC );
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
m_drawItem = NULL;
|
||||
m_lastDrawItem = NULL;
|
||||
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()) )
|
||||
{
|
||||
LIB_ITEM* item = m_collectedItems[index];
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
m_drawItem = item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ this component?" ),
|
|||
if( !aField->InEditMode() )
|
||||
{
|
||||
SaveCopyInUndoList( parent );
|
||||
( (LIB_ITEM*) aField )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode,
|
||||
( (LIB_ITEM*) aField )->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode,
|
||||
&fieldText, DefaultTransform );
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ this component?" ),
|
|||
if( !aField->InEditMode() )
|
||||
{
|
||||
fieldText = aField->GetFullText( m_unit );
|
||||
( (LIB_ITEM*) aField )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode,
|
||||
( (LIB_ITEM*) aField )->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode,
|
||||
&fieldText, DefaultTransform );
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
|
||||
if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) )
|
||||
{
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
m_itemToRepeat = NULL;
|
||||
|
||||
if( item && item->GetFlags() )
|
||||
|
@ -79,7 +79,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
item->Place( this, aDC );
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
return;
|
||||
|
||||
case SCH_LINE_T: // May already be drawing segment.
|
||||
|
@ -129,16 +129,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
{
|
||||
m_itemToRepeat = AddNoConnect( aDC, gridPosition );
|
||||
GetScreen()->SetCurItem( m_itemToRepeat );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
}
|
||||
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_JUNCTION_BUTT:
|
||||
|
@ -146,16 +146,16 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
{
|
||||
m_itemToRepeat = AddJunction( aDC, gridPosition, true );
|
||||
GetScreen()->SetCurItem( m_itemToRepeat );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
}
|
||||
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_WIRETOBUS_ENTRY_BUTT:
|
||||
|
@ -165,15 +165,15 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ?
|
||||
WIRE_TO_BUS : BUS_TO_BUS );
|
||||
GetScreen()->SetCurItem( item );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->Refresh( true );
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -183,29 +183,29 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
|
||||
case ID_WIRE_BUTT:
|
||||
BeginSegment( aDC, LAYER_WIRE );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
break;
|
||||
|
||||
case ID_BUS_BUTT:
|
||||
BeginSegment( aDC, LAYER_BUS );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
break;
|
||||
|
||||
case ID_LINE_COMMENT_BUTT:
|
||||
BeginSegment( aDC, LAYER_NOTES );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
break;
|
||||
|
||||
case ID_TEXT_COMMENT_BUTT:
|
||||
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
|
||||
{
|
||||
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -213,12 +213,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
|
||||
{
|
||||
GetScreen()->SetCurItem( CreateNewImage( aDC ) );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -226,14 +226,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
|
||||
{
|
||||
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -247,14 +247,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
if( GetToolId() == ID_HIERLABEL_BUTT )
|
||||
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) );
|
||||
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -262,14 +262,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
|
||||
{
|
||||
GetScreen()->SetCurItem( CreateSheet( aDC ) );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -292,7 +292,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
{
|
||||
item->Place( this, aDC );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -300,14 +300,14 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
if( (item == NULL) || (item->GetFlags() == 0) )
|
||||
{
|
||||
GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -316,19 +316,19 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
{
|
||||
GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ),
|
||||
s_PowerNameList, false ) );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
m_canvas->m_AutoPAN_Request = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Place( this, aDC );
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
wxFAIL_MSG( wxT( "SCH_EDIT_FRAME::OnLeftClick invalid tool ID <" ) +
|
||||
wxString::Format( wxT( "%d> selected." ), GetToolId() ) );
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
|
||||
case SCH_COMPONENT_T:
|
||||
EditComponent( (SCH_COMPONENT*) item );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
break;
|
||||
|
||||
case SCH_TEXT_T:
|
||||
|
@ -384,7 +384,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
|
||||
case SCH_FIELD_T:
|
||||
EditComponentFieldText( (SCH_FIELD*) item, aDC );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
break;
|
||||
|
||||
case SCH_MARKER_T:
|
||||
|
|
|
@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
|||
bool BlockActive = GetScreen()->IsBlockActive();
|
||||
|
||||
// Do not start a block command on context menu.
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
if( BlockActive )
|
||||
{
|
||||
|
@ -91,9 +91,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
|||
item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins );
|
||||
|
||||
// If the clarify item selection context menu is aborted, don't show the context menu.
|
||||
if( item == NULL && DrawPanel->m_AbortRequest )
|
||||
if( item == NULL && m_canvas->m_AbortRequest )
|
||||
{
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList )
|
|||
void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
|
||||
{
|
||||
wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) );
|
||||
|
||||
if( aItem == NULL )
|
||||
return;
|
||||
|
||||
|
@ -155,7 +156,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
|
|||
wxT( "Sheet label has invalid parent item." ) );
|
||||
SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED );
|
||||
sheet->RemovePin( (SCH_SHEET_PIN*) aItem );
|
||||
DrawPanel->RefreshDrawingRect( sheet->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -165,7 +166,7 @@ void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
|
|||
aItem->SetBack( NULL ); // Only one struct -> no link
|
||||
|
||||
SaveCopyInUndoList( aItem, UR_DELETED );
|
||||
DrawPanel->RefreshDrawingRect( aItem->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( aItem->GetBoundingBox() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
if( pin->IsNew() )
|
||||
{
|
||||
pin->SetFlags( IS_CANCELLED );
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
|
||||
OnModify( );
|
||||
pin->DisplayInfo( this );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
pin->EnableEditMode( false, m_editPinsPerPartOrConvert );
|
||||
|
@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
|
|||
|
||||
if( ask_for_pin && SynchronizePins() )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
status =
|
||||
IsOK( this, _( "This position is already occupied by \
|
||||
another pin. Continue?" ) );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
|
||||
if( !status )
|
||||
return;
|
||||
|
@ -241,7 +241,7 @@ another pin. Continue?" ) );
|
|||
else
|
||||
SaveCopyInUndoList( m_component );
|
||||
|
||||
DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
m_canvas->SetMouseCapture( NULL, NULL );
|
||||
OnModify();
|
||||
CurrentPin->SetPosition( newpos );
|
||||
|
||||
|
@ -268,11 +268,11 @@ another pin. Continue?" ) );
|
|||
Pin->ClearFlags();
|
||||
}
|
||||
|
||||
DrawPanel->CrossHairOff( DC );
|
||||
m_canvas->CrossHairOff( DC );
|
||||
bool showPinText = true;
|
||||
CurrentPin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE,
|
||||
CurrentPin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE,
|
||||
&showPinText, DefaultTransform );
|
||||
DrawPanel->CrossHairOn( DC );
|
||||
m_canvas->CrossHairOn( DC );
|
||||
|
||||
m_drawItem = NULL;
|
||||
}
|
||||
|
@ -313,13 +313,13 @@ void LIB_EDIT_FRAME::StartMovePin( wxDC* DC )
|
|||
|
||||
startPos.x = OldPos.x;
|
||||
startPos.y = -OldPos.y;
|
||||
DrawPanel->CrossHairOff( DC );
|
||||
m_canvas->CrossHairOff( DC );
|
||||
GetScreen()->SetCrossHairPosition( startPos );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
CurrentPin->DisplayInfo( this );
|
||||
DrawPanel->SetMouseCapture( DrawMovePin, AbortPinMove );
|
||||
DrawPanel->CrossHairOn( DC );
|
||||
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
|
||||
m_canvas->CrossHairOn( DC );
|
||||
}
|
||||
|
||||
|
||||
|
@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
|
|||
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
|
||||
pin->SetVisible( LastPinVisible );
|
||||
PinPreviousPos = pin->GetPosition();
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
||||
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
|
||||
GetEventHandler()->ProcessEvent( cmd );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
|
||||
if( pin->GetFlags() & IS_CANCELLED )
|
||||
{
|
||||
|
@ -412,10 +412,10 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
|
|||
else
|
||||
{
|
||||
ClearTempCopyComponent();
|
||||
DrawPanel->SetMouseCapture( DrawMovePin, AbortPinMove );
|
||||
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
|
||||
|
||||
if( DC )
|
||||
pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText,
|
||||
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText,
|
||||
DefaultTransform );
|
||||
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
|
|||
if( selected && !Pin->IsSelected() )
|
||||
continue;
|
||||
|
||||
Pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, &showPinText, DefaultTransform );
|
||||
Pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, g_XorMode, &showPinText, DefaultTransform );
|
||||
|
||||
switch( id )
|
||||
{
|
||||
|
@ -520,7 +520,7 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
|
|||
break;
|
||||
}
|
||||
|
||||
Pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &showPinText,
|
||||
Pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, &showPinText,
|
||||
DefaultTransform );
|
||||
}
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
|||
Pin->SetFlags( IS_LINKED );
|
||||
|
||||
wxPoint savepos = GetScreen()->GetCrossHairPosition();
|
||||
DrawPanel->CrossHairOff( DC );
|
||||
m_canvas->CrossHairOff( DC );
|
||||
GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x, -Pin->GetPosition().y ) );
|
||||
|
||||
// Add this new pin in list, and creates pins for others parts if needed
|
||||
|
@ -563,7 +563,7 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
|||
m_lastDrawItem = Pin;
|
||||
|
||||
GetScreen()->SetCrossHairPosition( savepos );
|
||||
DrawPanel->CrossHairOn( DC );
|
||||
m_canvas->CrossHairOn( DC );
|
||||
|
||||
Pin->DisplayInfo( this );
|
||||
OnModify( );
|
||||
|
|
|
@ -345,14 +345,14 @@ bool SCH_FIELD::Save( FILE* aFile ) const
|
|||
|
||||
void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
|
||||
{
|
||||
frame->DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
frame->GetCanvas()->SetMouseCapture( NULL, NULL );
|
||||
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent();
|
||||
|
||||
// save old cmp in undo list
|
||||
frame->SaveUndoItemInUndoList( component );
|
||||
|
||||
Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
ClearFlags();
|
||||
frame->GetScreen()->SetCurItem( NULL );
|
||||
frame->OnModify();
|
||||
|
|
|
@ -484,12 +484,12 @@ void SCH_SHEET::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
|
|||
{
|
||||
// fix size and position of the new sheet
|
||||
// using the last values set by the m_mouseCaptureCallback function
|
||||
frame->DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
frame->GetCanvas()->SetMouseCapture( NULL, NULL );
|
||||
|
||||
if( !frame->EditSheet( this, DC ) )
|
||||
{
|
||||
frame->GetScreen()->SetCurItem( NULL );
|
||||
Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
delete this;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -144,11 +144,11 @@ void SCH_SHEET_PIN::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
|
|||
}
|
||||
|
||||
ClearFlags();
|
||||
sheet->Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
sheet->Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
// Make sure we don't call the abort move function.
|
||||
aFrame->DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
aFrame->DrawPanel->EndMouseCapture();
|
||||
aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
|
||||
aFrame->GetCanvas()->EndMouseCapture();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -100,17 +100,17 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_SCH_DELETE:
|
||||
|
||||
// Stop the current command (if any) but keep the current tool
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
item = screen->GetCurItem(); // Can be modified by previous calls.
|
||||
|
||||
switch( id )
|
||||
|
@ -134,30 +134,30 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_SCH_ENTRY_SELECT_SLASH:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
SetBusEntryShape( &dc, (SCH_BUS_ENTRY*) item, '/' );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
SetBusEntryShape( &dc, (SCH_BUS_ENTRY*) item, '\\' );
|
||||
break;
|
||||
|
||||
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->EndMouseCapture();
|
||||
SetToolID( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString );
|
||||
m_canvas->EndMouseCapture();
|
||||
SetToolID( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ID_POPUP_END_LINE:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
EndSegment( &dc );
|
||||
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_CONNECTION:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
DeleteConnection( id == ID_POPUP_SCH_DELETE_CONNECTION );
|
||||
screen->SetCurItem( NULL );
|
||||
m_itemToRepeat = NULL;
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
DrawPanel->Refresh();
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_BREAK_WIRE:
|
||||
{
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
SCH_ITEM* oldWiresList = screen->ExtractWires( true );
|
||||
screen->BreakSegment( screen->GetCrossHairPosition() );
|
||||
|
||||
if( oldWiresList )
|
||||
SaveCopyInUndoList( oldWiresList, UR_WIRE_IMAGE );
|
||||
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -197,19 +197,19 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
DeleteItem( item );
|
||||
screen->SetCurItem( NULL );
|
||||
m_itemToRepeat = NULL;
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
SetSheetNumberAndCount();
|
||||
OnModify();
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_END_SHEET:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
item->Place( this, &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_RESIZE_SHEET:
|
||||
ReSizeSheet( (SCH_SHEET*) item, &dc );
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_IMPORT_GLABEL:
|
||||
|
@ -236,12 +236,12 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
SaveCopyInUndoList( sheet, UR_CHANGED );
|
||||
sheet->CleanupSheet();
|
||||
OnModify();
|
||||
DrawPanel->RefreshDrawingRect( sheet->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_INIT_CMP:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
break;
|
||||
|
||||
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..)
|
||||
if( item && item->Type() == SCH_COMPONENT_T )
|
||||
{
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
ConvertPart( (SCH_COMPONENT*) item, &dc );
|
||||
}
|
||||
|
||||
|
@ -291,8 +291,8 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_PLACE_BLOCK:
|
||||
DrawPanel->m_AutoPAN_Request = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_AutoPAN_Request = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
|
@ -301,25 +301,25 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_DELETE_BLOCK:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
|
||||
SetSheetNumberAndCount();
|
||||
break;
|
||||
|
||||
case ID_POPUP_COPY_BLOCK:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockEndByPopUp( BLOCK_COPY, &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_DRAG_BLOCK:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
HandleBlockEndByPopUp( BLOCK_DRAG, &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_ADD_JUNCTION:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
screen->SetCurItem( AddJunction( &dc, screen->GetCrossHairPosition(), true ) );
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
screen->SetCurItem( NULL );
|
||||
break;
|
||||
|
||||
|
@ -332,7 +332,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( item )
|
||||
{
|
||||
item->Place( this, &dc );
|
||||
screen->TestDanglingEnds( DrawPanel, &dc );
|
||||
screen->TestDanglingEnds( m_canvas, &dc );
|
||||
screen->SetCurItem( NULL );
|
||||
}
|
||||
|
||||
|
@ -380,7 +380,7 @@ void SCH_EDIT_FRAME::OnMoveItem( wxCommandEvent& aEvent )
|
|||
return;
|
||||
}
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
|
@ -426,18 +426,18 @@ void SCH_EDIT_FRAME::OnCancelCurrentCommand( wxCommandEvent& aEvent )
|
|||
|
||||
if( screen->IsBlockActive() )
|
||||
{
|
||||
DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) );
|
||||
m_canvas->SetCursor( wxCursor( m_canvas->GetDefaultCursor() ) );
|
||||
screen->ClearBlockCommand();
|
||||
|
||||
// Stop the current command (if any) but keep the current tool
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( DrawPanel->IsMouseCaptured() ) // Stop the current command but keep the current tool
|
||||
DrawPanel->EndMouseCapture();
|
||||
if( m_canvas->IsMouseCaptured() ) // Stop the current command but keep the current tool
|
||||
m_canvas->EndMouseCapture();
|
||||
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();
|
||||
|
||||
// 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 )
|
||||
{
|
||||
case ID_NO_TOOL_SELECTED:
|
||||
SetToolID( id, DrawPanel->GetDefaultCursor(), _( "No tool selected" ) );
|
||||
SetToolID( id, m_canvas->GetDefaultCursor(), _( "No tool selected" ) );
|
||||
break;
|
||||
|
||||
case ID_HIERARCHY_PUSH_POP_BUTT:
|
||||
|
@ -542,7 +542,7 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
|||
|
||||
wxPoint pos = data->GetPosition();
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
OnLeftClick( &dc, pos );
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ void SCH_EDIT_FRAME::DeleteConnection( bool aFullConnection )
|
|||
|
||||
if( screen->GetConnection( pos, pickList, aFullConnection ) != 0 )
|
||||
{
|
||||
DeleteItemsInList( DrawPanel, pickList );
|
||||
DeleteItemsInList( m_canvas, pickList );
|
||||
OnModify();
|
||||
}
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ bool SCH_EDIT_FRAME::DeleteItemAtCrossHair( wxDC* DC )
|
|||
DeleteItem( item );
|
||||
|
||||
if( itemHasConnections )
|
||||
screen->TestDanglingEnds( DrawPanel, DC );
|
||||
screen->TestDanglingEnds( m_canvas, DC );
|
||||
|
||||
OnModify();
|
||||
return true;
|
||||
|
@ -676,18 +676,18 @@ void SCH_EDIT_FRAME::MoveItem( SCH_ITEM* aItem, wxDC* aDC )
|
|||
|
||||
aItem->SetFlags( IS_MOVED );
|
||||
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
|
||||
if( aItem->Type() != SCH_SHEET_PIN_T )
|
||||
GetScreen()->SetCrossHairPosition( aItem->GetPosition() );
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
OnModify();
|
||||
DrawPanel->SetMouseCapture( moveItem, abortMoveItem );
|
||||
m_canvas->SetMouseCapture( moveItem, abortMoveItem );
|
||||
GetScreen()->SetCurItem( aItem );
|
||||
moveItem( DrawPanel, aDC, wxDefaultPosition, true );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
moveItem( m_canvas, aDC, wxDefaultPosition, true );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
}
|
||||
|
||||
|
||||
|
@ -696,7 +696,7 @@ void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
|
|||
SCH_SCREEN* screen = GetScreen();
|
||||
SCH_ITEM* item = screen->GetCurItem();
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
if( item == NULL )
|
||||
{
|
||||
|
@ -739,12 +739,12 @@ void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
|
|||
case SCH_LABEL_T:
|
||||
case SCH_GLOBAL_LABEL_T:
|
||||
case SCH_HIERARCHICAL_LABEL_T:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
ChangeTextOrient( (SCH_TEXT*) item, &dc );
|
||||
break;
|
||||
|
||||
case SCH_FIELD_T:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
RotateField( (SCH_FIELD*) item, &dc );
|
||||
break;
|
||||
|
||||
|
@ -768,7 +768,7 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent )
|
|||
SCH_SCREEN* screen = GetScreen();
|
||||
SCH_ITEM* item = screen->GetCurItem();
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
if( item == NULL )
|
||||
{
|
||||
|
@ -856,7 +856,7 @@ void SCH_EDIT_FRAME::OnDragItem( wxCommandEvent& aEvent )
|
|||
SCH_SCREEN* screen = GetScreen();
|
||||
SCH_ITEM* item = screen->GetCurItem();
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
if( item == NULL )
|
||||
{
|
||||
|
@ -889,7 +889,7 @@ void SCH_EDIT_FRAME::OnDragItem( wxCommandEvent& aEvent )
|
|||
case SCH_GLOBAL_LABEL_T:
|
||||
case SCH_HIERARCHICAL_LABEL_T:
|
||||
case SCH_SHEET_T:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
// The easiest way to handle a drag component or sheet command
|
||||
// is to simulate a block drag command
|
||||
|
@ -920,7 +920,7 @@ void SCH_EDIT_FRAME::OnOrient( wxCommandEvent& aEvent )
|
|||
SCH_SCREEN* screen = GetScreen();
|
||||
SCH_ITEM* item = screen->GetCurItem();
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
if( item == NULL )
|
||||
{
|
||||
|
|
|
@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::GetSchematicFromUndoList( wxCommandEvent& event )
|
|||
SetSheetNumberAndCount();
|
||||
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -385,5 +385,5 @@ void SCH_EDIT_FRAME::GetSchematicFromRedoList( wxCommandEvent& event )
|
|||
SetSheetNumberAndCount();
|
||||
|
||||
GetScreen()->TestDanglingEnds();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -224,8 +224,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
|
|||
|
||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_Block_Enable = true;
|
||||
if( m_canvas )
|
||||
m_canvas->m_Block_Enable = true;
|
||||
|
||||
ReCreateMenuBar();
|
||||
ReCreateHToolbar();
|
||||
|
@ -260,8 +260,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
|
|||
m_auimgr.AddPane( m_optionsToolBar,
|
||||
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
|
||||
|
||||
if( DrawPanel )
|
||||
m_auimgr.AddPane( DrawPanel, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
||||
if( m_canvas )
|
||||
m_auimgr.AddPane( m_canvas, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
||||
|
||||
if( m_messagePanel )
|
||||
m_auimgr.AddPane( m_messagePanel, wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().
|
||||
|
@ -492,7 +492,7 @@ double SCH_EDIT_FRAME::BestZoom()
|
|||
dx = GetScreen()->m_CurrentSheetDesc->m_Size.x;
|
||||
dy = GetScreen()->m_CurrentSheetDesc->m_Size.y;
|
||||
|
||||
size = DrawPanel->GetClientSize();
|
||||
size = m_canvas->GetClientSize();
|
||||
|
||||
// Reserve no margin because best zoom shows the full page
|
||||
// and margins are already included in function that draws the sheet refernces
|
||||
|
@ -653,7 +653,7 @@ void SCH_EDIT_FRAME::OnFindItems( wxCommandEvent& aEvent )
|
|||
wxCHECK_RET( m_findReplaceData != NULL,
|
||||
wxT( "Forgot to create find/replace data. Bad Programmer!" ) );
|
||||
|
||||
this->DrawPanel->m_IgnoreMouseEvents = true;
|
||||
this->GetCanvas()->m_IgnoreMouseEvents = true;
|
||||
|
||||
if( m_dlgFindReplace )
|
||||
{
|
||||
|
@ -704,7 +704,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event )
|
|||
m_dlgFindReplace = NULL;
|
||||
}
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -722,7 +722,7 @@ void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event )
|
|||
void SCH_EDIT_FRAME::OnLoadStuffFile( wxCommandEvent& event )
|
||||
{
|
||||
ReadInputStuffFile();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -876,7 +876,7 @@ void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
|
|||
|
||||
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData )
|
||||
{
|
||||
GetScreen()->Draw( DrawPanel, aDC, GR_DEFAULT_DRAWMODE );
|
||||
GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
|
||||
TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness );
|
||||
}
|
||||
|
||||
|
@ -890,7 +890,7 @@ void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
|
|||
&& (index >= 0 && index < m_collectedItems.GetCount()) )
|
||||
{
|
||||
SCH_ITEM* item = m_collectedItems[index];
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
GetScreen()->SetCurItem( item );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,8 +163,8 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
|
|||
}
|
||||
}
|
||||
|
||||
aSheet->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
if( isUndoable )
|
||||
SaveCopyInUndoList( aSheet, UR_CHANGED );
|
||||
|
@ -203,9 +203,9 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
|
|||
if( aSheet->GetName().IsEmpty() )
|
||||
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) );
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
aSheet->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
OnModify();
|
||||
|
||||
return true;
|
||||
|
@ -320,12 +320,12 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
|
|||
// also need to update the hierarchy, if we are adding
|
||||
// a sheet to a screen that already has multiple instances (!)
|
||||
GetScreen()->SetCurItem( sheet );
|
||||
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, false );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
@ -340,16 +340,16 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
|
|||
wxString::Format( wxT( "Cannot perform sheet resize on %s object." ),
|
||||
GetChars( aSheet->GetClass() ) ) );
|
||||
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
GetScreen()->SetCrossHairPosition( aSheet->GetResizePosition() );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
SetUndoItem( aSheet );
|
||||
aSheet->SetFlags( IS_RESIZED );
|
||||
|
||||
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, true );
|
||||
m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
|
||||
|
||||
if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo
|
||||
SetUndoItem( aSheet );
|
||||
|
@ -361,15 +361,15 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC )
|
|||
if( ( aSheet == NULL ) || ( aSheet->Type() != SCH_SHEET_T ) )
|
||||
return;
|
||||
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
GetScreen()->SetCrossHairPosition( aSheet->GetPosition() );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
if( !aSheet->IsNew() )
|
||||
SetUndoItem( aSheet );
|
||||
|
||||
aSheet->SetFlags( IS_MOVED );
|
||||
DrawPanel->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, wxDefaultPosition, true );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
|
|||
return wxID_CANCEL;
|
||||
|
||||
if( aDC )
|
||||
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
aSheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
if( !aSheetPin->IsNew() )
|
||||
{
|
||||
|
@ -89,7 +89,7 @@ int SCH_EDIT_FRAME::EditSheetPin( SCH_SHEET_PIN* aSheetPin, wxDC* aDC )
|
|||
aSheetPin->SetShape( dlg.GetConnectionType() );
|
||||
|
||||
if( aDC )
|
||||
aSheetPin->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
aSheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
return wxID_OK;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem )
|
|||
OnModify( );
|
||||
|
||||
DrawItem->DisplayInfo( this );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,7 +123,7 @@ static void AbortSymbolTraceOn( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
|||
|
||||
LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
|
||||
{
|
||||
DrawPanel->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
|
||||
m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
|
||||
wxPoint drawPos = GetScreen()->GetCrossHairPosition( true );
|
||||
|
||||
// no temp copy -> the current version of component will be used for Undo
|
||||
|
@ -155,10 +155,10 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
|
|||
Text->m_Orient = m_textOrientation;
|
||||
|
||||
// Enter the graphic text info
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
EditSymbolText( NULL, Text );
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
if( Text->m_Text.IsEmpty() )
|
||||
{
|
||||
|
@ -188,16 +188,16 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
|
|||
m_drawItem->SetConvert( m_convert );
|
||||
|
||||
// Draw initial symbol:
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = FALSE;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = FALSE;
|
||||
|
||||
return m_drawItem;
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ void LIB_EDIT_FRAME::GraphicItemBeginDraw( wxDC* DC )
|
|||
|
||||
if( m_drawItem->ContinueEdit( pos ) )
|
||||
{
|
||||
m_drawItem->Draw( DrawPanel, DC, pos, -1, g_XorMode, NULL, DefaultTransform );
|
||||
m_drawItem->Draw( m_canvas, DC, pos, -1, g_XorMode, NULL, DefaultTransform );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -262,8 +262,8 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC )
|
|||
|
||||
TempCopyComponent();
|
||||
m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) );
|
||||
DrawPanel->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, true );
|
||||
m_canvas->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -275,8 +275,8 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC )
|
|||
|
||||
TempCopyComponent();
|
||||
m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) );
|
||||
DrawPanel->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, true );
|
||||
m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -308,7 +308,7 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
|
|||
if( GetToolId() != ID_NO_TOOL_SELECTED )
|
||||
SetCursor( wxCURSOR_PENCIL );
|
||||
else
|
||||
SetCursor( DrawPanel->GetDefaultCursor() );
|
||||
SetCursor( m_canvas->GetDefaultCursor() );
|
||||
|
||||
if( GetTempCopyComponent() ) // used when editing an existing item
|
||||
SaveCopyInUndoList( GetTempCopyComponent() );
|
||||
|
@ -325,6 +325,6 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
|
|||
|
||||
OnModify();
|
||||
|
||||
DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->SetMouseCapture( NULL, NULL );
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
|
|||
if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) )
|
||||
return;
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath();
|
||||
|
||||
|
@ -69,8 +69,8 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
|
|||
return;
|
||||
|
||||
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = FALSE;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = FALSE;
|
||||
|
||||
wxFileName fn = dlg.GetPath();
|
||||
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );
|
||||
|
@ -126,7 +126,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
|
|||
m_component->ClearSelectedItems();
|
||||
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
|
||||
delete Lib;
|
||||
}
|
||||
|
@ -250,5 +250,5 @@ void LIB_EDIT_FRAME::PlaceAnchor()
|
|||
|
||||
/* Redraw the symbol */
|
||||
RedrawScreen( wxPoint( 0 , 0 ), true );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -302,6 +302,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
|
|||
KiBitmap( lines90_xpm ),
|
||||
_( "HV orientation for wires and bus" ),
|
||||
wxITEM_CHECK );
|
||||
|
||||
// set icon paddings
|
||||
m_optionsToolBar->SetToolBorderPadding(2); // padding
|
||||
m_optionsToolBar->SetToolSeparation(0);
|
||||
|
@ -313,7 +314,7 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
|
|||
|
||||
void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||
{
|
||||
if( DrawPanel == NULL )
|
||||
if( m_canvas == NULL )
|
||||
return;
|
||||
|
||||
int id = event.GetId();
|
||||
|
@ -322,7 +323,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
{
|
||||
case ID_TB_OPTIONS_HIDDEN_PINS:
|
||||
m_showAllPins = m_optionsToolBar->GetToolToggled( id );
|
||||
DrawPanel->Refresh( );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_BUS_WIRES_ORIENT:
|
||||
|
|
|
@ -191,8 +191,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
|
|||
|
||||
DisplayLibInfos();
|
||||
|
||||
if( DrawPanel )
|
||||
DrawPanel->SetAcceleratorTable( table );
|
||||
if( m_canvas )
|
||||
m_canvas->SetAcceleratorTable( table );
|
||||
|
||||
m_auimgr.SetManagedWindow( this );
|
||||
|
||||
|
@ -227,7 +227,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
|
|||
Left().Row( 1 ) );
|
||||
|
||||
// Manage the draw panel
|
||||
m_auimgr.AddPane( DrawPanel,
|
||||
m_auimgr.AddPane( m_canvas,
|
||||
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).Centre() );
|
||||
|
||||
// Manage the message panel
|
||||
|
@ -354,7 +354,7 @@ double LIB_VIEW_FRAME::BestZoom()
|
|||
return bestzoom;
|
||||
}
|
||||
|
||||
wxSize size = DrawPanel->GetClientSize();
|
||||
wxSize size = m_canvas->GetClientSize();
|
||||
|
||||
EDA_RECT BoundaryBox = component->GetBoundingBox( m_unit, m_convert );
|
||||
|
||||
|
@ -407,7 +407,7 @@ void LIB_VIEW_FRAME::ReCreateListLib()
|
|||
ReCreateListCmp();
|
||||
ReCreateHToolbar();
|
||||
DisplayLibInfos();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -462,7 +462,7 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
|
|||
|
||||
m_libraryName = name;
|
||||
ReCreateListCmp();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
DisplayLibInfos();
|
||||
ReCreateHToolbar();
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
|
|||
m_convert = 1;
|
||||
Zoom_Automatique( false );
|
||||
ReCreateHToolbar();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,14 +59,14 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
|
||||
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, FALSE );
|
||||
m_convert = 1;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT:
|
||||
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, FALSE );
|
||||
m_mainToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true );
|
||||
m_convert = 2;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_LIBVIEW_SELECT_PART_NUMBER:
|
||||
|
@ -74,7 +74,7 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( ii < 0 )
|
||||
return;
|
||||
m_unit = ii + 1;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -135,7 +135,7 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary()
|
|||
if( m_LibList )
|
||||
{
|
||||
ReCreateListCmp();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
DisplayLibInfos();
|
||||
ReCreateHToolbar();
|
||||
int id = m_LibList->FindString( m_libraryName.GetData() );
|
||||
|
@ -232,7 +232,7 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
|
|||
m_entryName = CmpName;
|
||||
DisplayLibInfos();
|
||||
Zoom_Automatique( false );
|
||||
DrawPanel->Refresh( );
|
||||
m_canvas->Refresh( );
|
||||
|
||||
if( m_CmpList )
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
|
||||
component = entry->GetComponent();
|
||||
|
||||
DrawPanel->DrawBackGround( DC );
|
||||
m_canvas->DrawBackGround( DC );
|
||||
|
||||
if( !entry->IsRoot() )
|
||||
{
|
||||
|
@ -283,6 +283,7 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
|
||||
if( m_unit < 1 )
|
||||
m_unit = 1;
|
||||
|
||||
if( m_convert < 1 )
|
||||
m_convert = 1;
|
||||
}
|
||||
|
@ -291,10 +292,10 @@ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
msg = _( "None" );
|
||||
}
|
||||
|
||||
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE );
|
||||
component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE );
|
||||
|
||||
/* Redraw the cursor */
|
||||
DrawPanel->DrawCrossHair( DC );
|
||||
m_canvas->DrawCrossHair( DC );
|
||||
|
||||
if( !tmp.IsEmpty() )
|
||||
component->SetName( tmp );
|
||||
|
|
|
@ -77,23 +77,23 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
|
|||
|
||||
void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
{
|
||||
wxASSERT( DrawPanel->IsMouseCaptured() );
|
||||
wxASSERT( m_canvas->IsMouseCaptured() );
|
||||
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||
|
||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||
{
|
||||
case BLOCK_MOVE: /* Move */
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
Block_Move( DC );
|
||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
break;
|
||||
|
||||
case BLOCK_COPY: /* Copy */
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
Block_Duplicate( DC );
|
||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
|
@ -116,7 +116,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
break;
|
||||
}
|
||||
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
|
||||
GetScreen()->SetModify();
|
||||
GetScreen()->ClearBlockCommand();
|
||||
|
||||
|
@ -131,7 +131,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
bool nextcmd = false;
|
||||
bool zoom_command = false;
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
|
||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||
{
|
||||
|
@ -139,14 +139,14 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
case BLOCK_COPY: /* Copy */
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||
nextcmd = true;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
break;
|
||||
|
||||
case BLOCK_DELETE: /* Delete */
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
Block_Delete( DC );
|
||||
break;
|
||||
|
||||
|
@ -172,7 +172,7 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
if( ! nextcmd )
|
||||
{
|
||||
GetScreen()->ClearBlockCommand();
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
}
|
||||
|
||||
|
@ -257,10 +257,10 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
|
|||
wxPoint oldpos;
|
||||
|
||||
oldpos = GetScreen()->GetCrossHairPosition();
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
|
||||
GetScreen()->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
GetScreen()->SetModify();
|
||||
GetScreen()->m_BlockLocate.Normalize();
|
||||
|
||||
|
@ -276,7 +276,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
|
|||
gerb_item->MoveAB( delta );
|
||||
}
|
||||
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -286,10 +286,10 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
|
|||
wxPoint oldpos;
|
||||
|
||||
oldpos = GetScreen()->GetCrossHairPosition();
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
|
||||
GetScreen()->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
GetScreen()->SetModify();
|
||||
GetScreen()->m_BlockLocate.Normalize();
|
||||
|
||||
|
@ -297,9 +297,11 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
|
|||
|
||||
/* Copy items in block */
|
||||
BOARD_ITEM* item = GetBoard()->m_Drawings;
|
||||
|
||||
for( ; item; item = item->Next() )
|
||||
{
|
||||
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
||||
|
||||
if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) )
|
||||
{
|
||||
/* this item must be duplicated */
|
||||
|
@ -309,5 +311,5 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
|
|||
}
|
||||
}
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
myframe->GetBoard()->SetVisibleLayers( visibleLayers );
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +188,7 @@ void GERBER_LAYER_WIDGET::ReFill()
|
|||
BOARD* brd = myframe->GetBoard();
|
||||
int layer;
|
||||
ClearLayerRows();
|
||||
|
||||
for( layer = 0; layer < LAYER_COUNT; layer++ )
|
||||
{
|
||||
wxString msg;
|
||||
|
@ -205,7 +206,7 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
|
|||
{
|
||||
myframe->GetBoard()->SetLayerColor( aLayer, aColor );
|
||||
myframe->m_SelLayerBox->ResyncBitmapOnly();
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
||||
|
@ -215,8 +216,9 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
|||
int layer = myframe->getActiveLayer( );
|
||||
myframe->setActiveLayer( aLayer, false );
|
||||
myframe->syncLayerBox();
|
||||
|
||||
if( layer != myframe->getActiveLayer( ) )
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -234,13 +236,13 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin
|
|||
brd->SetVisibleLayers( visibleLayers );
|
||||
|
||||
if( isFinal )
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
|
||||
{
|
||||
myframe->GetBoard()->SetVisibleElementColor( aId, aColor );
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
||||
|
@ -248,7 +250,7 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
|||
BOARD* brd = myframe->GetBoard();
|
||||
brd->SetElementVisibility( aId, isEnabled );
|
||||
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
//-----</LAYER_WIDGET callbacks>------------------------------------------
|
||||
|
|
|
@ -24,25 +24,25 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -55,13 +55,13 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
{
|
||||
pos = GetScreen()->GetCrossHairPosition();
|
||||
GetScreen()->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
GetScreen()->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,9 @@ void GERBVIEW_FRAME::InstallGerberOptionsDialog( wxCommandEvent& event )
|
|||
{
|
||||
DIALOG_DISPLAY_OPTIONS dlg( this );
|
||||
int opt = dlg.ShowModal();
|
||||
|
||||
if (opt > 0 )
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) :
|
||||
|
|
|
@ -56,11 +56,11 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer,
|
|||
DisplayOpt.DisplayZonesMode = 0;
|
||||
g_DisplayPolygonsModeSketch = 0;
|
||||
|
||||
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
||||
m_canvas->m_PrintIsMirrored = aPrintMirrorMode;
|
||||
|
||||
GetBoard()->Draw( DrawPanel, aDC, -1, wxPoint( 0, 0 ) );
|
||||
GetBoard()->Draw( m_canvas, aDC, -1, wxPoint( 0, 0 ) );
|
||||
|
||||
DrawPanel->m_PrintIsMirrored = false;
|
||||
m_canvas->m_PrintIsMirrored = false;
|
||||
|
||||
// Restore draw options:
|
||||
GetBoard()->SetVisibleLayers( visiblemask );
|
||||
|
@ -96,22 +96,22 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
}
|
||||
|
||||
// Draw according to the current setting. This needs to be GR_COPY or GR_OR.
|
||||
GetBoard()->Draw( DrawPanel, DC, drawMode, wxPoint( 0, 0 ) );
|
||||
GetBoard()->Draw( m_canvas, DC, drawMode, wxPoint( 0, 0 ) );
|
||||
|
||||
// Draw the "background" now, i.e. grid and axis after gerber layers
|
||||
// because most of time the actual background is erased by successive drawings of each gerber
|
||||
// layer mainly in COPY mode
|
||||
DrawPanel->DrawBackGround( DC );
|
||||
m_canvas->DrawBackGround( DC );
|
||||
|
||||
if( IsElementVisible( DCODES_VISIBLE ) )
|
||||
DrawItemsDCodeID( DC, GR_COPY );
|
||||
|
||||
TraceWorkSheet( DC, screen, 0 );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
DrawPanel->DrawCrossHair( DC );
|
||||
m_canvas->DrawCrossHair( DC );
|
||||
|
||||
// Display the filename and the layer name (found in the gerber files, if any)
|
||||
// relative to the active layer
|
||||
|
@ -406,7 +406,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode )
|
|||
|
||||
int color = g_ColorsSettings.GetItemColor( DCODES_VISIBLE );
|
||||
|
||||
DrawGraphicText( DrawPanel, aDC, pos, (EDA_Colors) color, Line,
|
||||
DrawGraphicText( m_canvas, aDC, pos, (EDA_Colors) color, Line,
|
||||
orient, wxSize( width, width ),
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
0, false, false );
|
||||
|
|
|
@ -127,7 +127,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
|
||||
if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
|
||||
{
|
||||
|
@ -138,26 +138,28 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
if( GetToolId() == ID_NO_TOOL_SELECTED )
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
else
|
||||
DrawPanel->SetCursor( DrawPanel->GetCurrentCursor() );
|
||||
m_canvas->SetCursor( m_canvas->GetCurrentCursor() );
|
||||
break;
|
||||
|
||||
default:
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
break;
|
||||
}
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
switch( id )
|
||||
{
|
||||
case ID_GERBVIEW_SET_PAGE_BORDER:
|
||||
{
|
||||
DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this );
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK )
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ID_GERBVIEW_GLOBAL_DELETE:
|
||||
|
@ -166,11 +168,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_NO_TOOL_SELECTED:
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
|
||||
case ID_POPUP_CLOSE_CURRENT_TOOL:
|
||||
SetToolID( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor(), wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
|
||||
break;
|
||||
|
||||
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
||||
|
@ -182,7 +184,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
case ID_POPUP_PLACE_BLOCK:
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
|
||||
DrawPanel->m_AutoPAN_Request = FALSE;
|
||||
m_canvas->m_AutoPAN_Request = FALSE;
|
||||
HandleBlockPlace( &dc );
|
||||
break;
|
||||
|
||||
|
@ -211,13 +213,15 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event )
|
||||
{
|
||||
GERBER_IMAGE* gerber_image = g_GERBER_List[getActiveLayer()];
|
||||
|
||||
if( gerber_image )
|
||||
{
|
||||
int tool = m_DCodeSelector->GetSelectedDCodeId();
|
||||
|
||||
if( tool != gerber_image->m_Selected_Tool )
|
||||
{
|
||||
gerber_image->m_Selected_Tool = tool;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -231,8 +235,9 @@ void GERBVIEW_FRAME::OnSelectActiveLayer( wxCommandEvent& event )
|
|||
int layer = getActiveLayer();
|
||||
|
||||
setActiveLayer( event.GetSelection() );
|
||||
|
||||
if( layer != getActiveLayer() )
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -283,7 +288,7 @@ void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
if( GetDisplayMode() != oldMode )
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event )
|
||||
|
|
|
@ -56,18 +56,18 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
|
|||
case ID_GERBVIEW_ERASE_ALL:
|
||||
Clear_Pcb( true );
|
||||
Zoom_Automatique( false );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
ClearMsgPanel();
|
||||
break;
|
||||
|
||||
case ID_GERBVIEW_LOAD_DRILL_FILE:
|
||||
LoadExcellonFiles( wxEmptyString );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_GERBVIEW_LOAD_DCODE_FILE:
|
||||
LoadDCodeFile( wxEmptyString );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -75,8 +75,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
|
|||
m_displayMode = 0;
|
||||
m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 );
|
||||
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_Block_Enable = true;
|
||||
if( m_canvas )
|
||||
m_canvas->m_Block_Enable = true;
|
||||
|
||||
// Give an icon
|
||||
wxIcon icon;
|
||||
|
@ -98,7 +98,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
|
|||
if( screenHeight <= 900 )
|
||||
pointSize = (pointSize * 8) / 10;
|
||||
|
||||
m_LayersManager = new GERBER_LAYER_WIDGET( this, DrawPanel, pointSize );
|
||||
m_LayersManager = new GERBER_LAYER_WIDGET( this, m_canvas, pointSize );
|
||||
|
||||
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
||||
// initialize parameters in m_LayersManager
|
||||
|
@ -143,8 +143,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
|
|||
m_auimgr.AddPane( m_optionsToolBar,
|
||||
wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left() );
|
||||
|
||||
if( DrawPanel )
|
||||
m_auimgr.AddPane( DrawPanel,
|
||||
if( m_canvas )
|
||||
m_auimgr.AddPane( m_canvas,
|
||||
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
||||
|
||||
if( m_messagePanel )
|
||||
|
@ -187,7 +187,7 @@ double GERBVIEW_FRAME::BestZoom()
|
|||
bbox.Merge( gerb_item->GetBoundingBox() );
|
||||
}
|
||||
|
||||
wxSize size = DrawPanel->GetClientSize();
|
||||
wxSize size = m_canvas->GetClientSize();
|
||||
|
||||
double x = (double) bbox.GetWidth() / (double) size.x;
|
||||
double y = (double) bbox.GetHeight() / (double) size.y;
|
||||
|
|
|
@ -136,15 +136,16 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
|
|||
break;
|
||||
|
||||
case HK_SWITCH_GBR_ITEMS_DISPLAY_MODE:
|
||||
DisplayOpt.DisplayPcbTrackFill ^= 1; DisplayOpt.DisplayPcbTrackFill &= 1;
|
||||
DrawPanel->Refresh();
|
||||
DisplayOpt.DisplayPcbTrackFill ^= 1;
|
||||
DisplayOpt.DisplayPcbTrackFill &= 1;
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case HK_SWITCH_LAYER_TO_PREVIOUS:
|
||||
if( getActiveLayer() > 0 )
|
||||
{
|
||||
setActiveLayer( getActiveLayer() - 1 );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -152,7 +153,7 @@ void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
|
|||
if( getActiveLayer() < 31 )
|
||||
{
|
||||
setActiveLayer( getActiveLayer() + 1 );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ void GERBVIEW_FRAME::Erase_Current_Layer( bool query )
|
|||
}
|
||||
|
||||
GetScreen()->SetModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
m_LayersManager->UpdateLayerIcons();
|
||||
syncLayerBox();
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
|||
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
|
||||
|
||||
// Do not initiate a start block validation on menu.
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
// Simple location of elements where possible.
|
||||
if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) )
|
||||
|
|
|
@ -43,7 +43,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
{
|
||||
DisplayOpt.DisplayPadFill = m_DisplayPadFill = true;
|
||||
}
|
||||
DrawPanel->Refresh( true );
|
||||
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_LINES_SKETCH:
|
||||
|
@ -57,7 +58,8 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
m_DisplayPcbTrackFill = true;
|
||||
DisplayOpt.DisplayPcbTrackFill = true;
|
||||
}
|
||||
DrawPanel->Refresh( true );
|
||||
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH:
|
||||
|
@ -65,12 +67,13 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
g_DisplayPolygonsModeSketch = 1;
|
||||
else
|
||||
g_DisplayPolygonsModeSketch = 0;
|
||||
DrawPanel->Refresh( true );
|
||||
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_DCODES:
|
||||
SetElementVisibility( DCODES_VISIBLE, state );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR:
|
||||
|
|
|
@ -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:
|
||||
* @brief EDA_DRAW_PANEL class definition.
|
||||
|
@ -34,14 +59,13 @@ private:
|
|||
int m_defaultCursor; ///< The default mouse cursor shape id.
|
||||
bool m_showCrossHair; ///< Indicate if cross hair is to be shown.
|
||||
int m_cursorLevel; ///< Index for cursor redraw in XOR mode.
|
||||
int m_scrollIncrementX; ///< X axis scroll increment in pixels per unit.
|
||||
int m_scrollIncrementY; ///< Y axis scroll increment in pixels per unit.
|
||||
wxPoint m_CursorStartPos; ///< Used for testing the cursor movement.
|
||||
|
||||
public:
|
||||
EDA_RECT m_ClipBox; // the clipbox used in screen redraw (usually gives the
|
||||
// visible area in internal units)
|
||||
wxPoint m_CursorStartPos; // useful in testing the cursor movement
|
||||
int m_scrollIncrementX; // X axis scroll increment in pixels per unit.
|
||||
int m_scrollIncrementY; // Y axis scroll increment in pixels per unit.
|
||||
|
||||
bool m_AbortRequest; // Flag to abort long commands
|
||||
bool m_AbortEnable; // true if abort button or menu to be displayed
|
||||
|
||||
|
|
|
@ -366,22 +366,22 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
|
|||
///< Id of active button on the vertical toolbar.
|
||||
int m_toolId;
|
||||
|
||||
public:
|
||||
EDA_DRAW_PANEL* DrawPanel; // Draw area
|
||||
|
||||
protected:
|
||||
EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList;
|
||||
int m_LastGridSizeId;
|
||||
bool m_DrawGrid; // hide/Show grid
|
||||
int m_GridColor; // Grid color
|
||||
|
||||
/// The area to draw on.
|
||||
EDA_DRAW_PANEL* m_canvas;
|
||||
|
||||
/// Internal units count that is equivalent to 1 inch. Set to 1000 (0.001") for
|
||||
/// schematic drawing and 10000 (0.0001") for PCB drawing.
|
||||
int m_internalUnits;
|
||||
|
||||
/// Tool ID of previously active draw tool bar button.
|
||||
int m_lastDrawToolId;
|
||||
// on the vertical toolbar
|
||||
|
||||
/// The shape of the KiCad cursor. The default value (0) is the normal cross
|
||||
/// hair cursor. Set to non-zero value to draw the full screen cursor.
|
||||
/// @note This is not the system mouse cursor.
|
||||
|
@ -463,6 +463,8 @@ public:
|
|||
|
||||
int GetInternalUnits() const { return m_internalUnits; }
|
||||
|
||||
EDA_DRAW_PANEL* GetCanvas() { return m_canvas; }
|
||||
|
||||
virtual wxString GetScreenDesc();
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,10 +51,10 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
|
|||
return;
|
||||
|
||||
OnModify();
|
||||
DrawPanel->CrossHairOff( DC ); // Erase cursor shape
|
||||
m_canvas->CrossHairOff( DC ); // Erase cursor shape
|
||||
track->SetState( TRACK_LOCKED, Flag_On );
|
||||
track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
|
||||
DrawPanel->CrossHairOn( DC ); // Display cursor shape
|
||||
track->Draw( m_canvas, DC, GR_OR | GR_HIGHLIGHT );
|
||||
m_canvas->CrossHairOn( DC ); // Display cursor shape
|
||||
track->DisplayInfo( this );
|
||||
}
|
||||
|
||||
|
@ -68,9 +68,9 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
|
|||
if( (track == NULL ) || (track->Type() == PCB_ZONE_T) )
|
||||
return;
|
||||
|
||||
DrawPanel->CrossHairOff( DC ); // Erase cursor shape
|
||||
m_canvas->CrossHairOff( DC ); // Erase cursor shape
|
||||
Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true );
|
||||
DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT );
|
||||
DrawTraces( m_canvas, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT );
|
||||
|
||||
for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
|
|||
Track = Track->Next();
|
||||
}
|
||||
|
||||
DrawPanel->CrossHairOn( DC ); // Display cursor shape
|
||||
m_canvas->CrossHairOn( DC ); // Display cursor shape
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
|
|||
}
|
||||
}
|
||||
|
||||
DrawPanel->CrossHairOff( DC ); // Erase cursor shape
|
||||
m_canvas->CrossHairOff( DC ); // Erase cursor shape
|
||||
|
||||
while( Track ) /* Flag change */
|
||||
{
|
||||
|
@ -112,10 +112,10 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
|
|||
|
||||
OnModify();
|
||||
Track->SetState( TRACK_LOCKED, Flag_On );
|
||||
Track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
|
||||
Track->Draw( m_canvas, DC, GR_OR | GR_HIGHLIGHT );
|
||||
Track = Track->Next();
|
||||
}
|
||||
|
||||
DrawPanel->CrossHairOn( DC ); // Display cursor shape
|
||||
m_canvas->CrossHairOn( DC ); // Display cursor shape
|
||||
OnModify();
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
|
|||
if( m_mainToolBar == NULL )
|
||||
return;
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
|
||||
switch( id )
|
||||
{
|
||||
|
@ -93,15 +93,15 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
|
|||
return;
|
||||
|
||||
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_endMouseCaptureCallback( DrawPanel, &dc );
|
||||
m_canvas->m_endMouseCaptureCallback( m_canvas, &dc );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default: // Abort a current command (if any)
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
|
|||
if( newList.GetCount() )
|
||||
SaveCopyInUndoList( newList, UR_CHANGED );
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -117,8 +117,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
|
|||
if( GetBoard()->m_Modules == NULL )
|
||||
return;
|
||||
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
DrawPanel->m_AbortEnable = true;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
m_canvas->m_AbortEnable = true;
|
||||
|
||||
switch( place_mode )
|
||||
{
|
||||
|
@ -247,7 +247,7 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
|
|||
if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen
|
||||
{
|
||||
NbModules++;
|
||||
Module->Draw( DrawPanel, DC, GR_XOR );
|
||||
Module->Draw( m_canvas, DC, GR_XOR );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -390,8 +390,8 @@ end_of_tst:
|
|||
|
||||
GetBoard()->m_Status_Pcb = 0;
|
||||
Compile_Ratsnest( DC, true );
|
||||
DrawPanel->ReDraw( DC, true );
|
||||
DrawPanel->m_AbortEnable = false;
|
||||
m_canvas->ReDraw( DC, true );
|
||||
m_canvas->m_AbortEnable = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -431,7 +431,7 @@ void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC )
|
|||
color = DARKGRAY;
|
||||
}
|
||||
|
||||
GRPutPixel( &DrawPanel->m_ClipBox, DC, ox, oy, color );
|
||||
GRPutPixel( &m_canvas->m_ClipBox, DC, ox, oy, color );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
|
|||
}
|
||||
}
|
||||
|
||||
DrawModuleOutlines( DrawPanel, aDC, aModule );
|
||||
DrawModuleOutlines( m_canvas, aDC, aModule );
|
||||
|
||||
mincout = -1.0;
|
||||
SetStatusText( wxT( "Score ??, pos ??" ) );
|
||||
|
@ -690,19 +690,19 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
|
|||
{
|
||||
wxYield();
|
||||
|
||||
if( DrawPanel->m_AbortRequest )
|
||||
if( m_canvas->m_AbortRequest )
|
||||
{
|
||||
if( IsOK( this, _( "Ok to abort?" ) ) )
|
||||
return ESC;
|
||||
else
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
}
|
||||
|
||||
cx = aModule->m_Pos.x; cy = aModule->m_Pos.y;
|
||||
aModule->m_BoundaryBox.SetX( ox + CurrPosition.x );
|
||||
aModule->m_BoundaryBox.SetY( oy + CurrPosition.y );
|
||||
|
||||
DrawModuleOutlines( DrawPanel, aDC, aModule );
|
||||
DrawModuleOutlines( m_canvas, aDC, aModule );
|
||||
|
||||
g_Offset_Module.x = cx - CurrPosition.x;
|
||||
CurrPosition.y = bbbox.GetY() - oy;
|
||||
|
@ -710,13 +710,13 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
|
|||
/* Placement on grid. */
|
||||
CurrPosition.y -= CurrPosition.y % Board.m_GridRouting;
|
||||
|
||||
DrawModuleOutlines( DrawPanel, aDC, aModule );
|
||||
DrawModuleOutlines( m_canvas, aDC, aModule );
|
||||
|
||||
for( ; CurrPosition.y < bbbox.GetBottom() - fy;
|
||||
CurrPosition.y += Board.m_GridRouting )
|
||||
{
|
||||
/* Erase traces. */
|
||||
DrawModuleOutlines( DrawPanel, aDC, aModule );
|
||||
DrawModuleOutlines( m_canvas, aDC, aModule );
|
||||
|
||||
if( showRat )
|
||||
Compute_Ratsnest_PlaceModule( aDC );
|
||||
|
@ -726,7 +726,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
|
|||
aModule->m_BoundaryBox.SetY( oy + CurrPosition.y );
|
||||
|
||||
g_Offset_Module.y = cy - CurrPosition.y;
|
||||
DrawModuleOutlines( DrawPanel, aDC, aModule );
|
||||
DrawModuleOutlines( m_canvas, aDC, aModule );
|
||||
keepOut = TstModuleOnBoard( GetBoard(), aModule, TstOtherSide );
|
||||
|
||||
if( keepOut >= 0 ) /* c a d if the module can be placed. */
|
||||
|
@ -757,7 +757,7 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
|
|||
}
|
||||
}
|
||||
|
||||
DrawModuleOutlines( DrawPanel, aDC, aModule ); /* erasing the last traces */
|
||||
DrawModuleOutlines( m_canvas, aDC, aModule ); /* erasing the last traces */
|
||||
|
||||
if( showRat )
|
||||
Compute_Ratsnest_PlaceModule( aDC );
|
||||
|
@ -956,7 +956,7 @@ float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC )
|
|||
|
||||
if( AutoPlaceShowAll )
|
||||
{
|
||||
GRLine( &DrawPanel->m_ClipBox, DC, ox, oy, fx, fy, 0, color );
|
||||
GRLine( &m_canvas->m_ClipBox, DC, ox, oy, fx, fy, 0, color );
|
||||
}
|
||||
|
||||
/* Cost of the ratsnest. */
|
||||
|
|
|
@ -173,7 +173,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
|
|||
/* Construction of the track list for router. */
|
||||
Build_Work( GetBoard() );
|
||||
|
||||
// DisplayBoard(DrawPanel, DC);
|
||||
// DisplayBoard(m_canvas, DC);
|
||||
|
||||
if( Nb_Sides == TWO_SIDES )
|
||||
Solve( DC, TWO_SIDES ); /* double face */
|
||||
|
|
|
@ -175,7 +175,7 @@ double PCB_BASE_FRAME::BestZoom( void )
|
|||
dx = bbbox.GetWidth();
|
||||
dy = bbbox.GetHeight();
|
||||
|
||||
size = DrawPanel->GetClientSize();
|
||||
size = m_canvas->GetClientSize();
|
||||
|
||||
if( size.x )
|
||||
ii = (double)(dx + ( size.x / 2) ) / (double) size.x;
|
||||
|
@ -201,10 +201,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
|
|||
|
||||
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
|
||||
|
||||
wxClientDC dc( DrawPanel );
|
||||
wxClientDC dc( m_canvas );
|
||||
|
||||
/* There may be need to reframe the drawing. */
|
||||
if( !DrawPanel->IsPointOnDisplay( aPos ) )
|
||||
if( !m_canvas->IsPointOnDisplay( aPos ) )
|
||||
{
|
||||
screen->SetCrossHairPosition( aPos );
|
||||
RedrawScreen( aPos, true );
|
||||
|
@ -212,10 +212,10 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
|
|||
else
|
||||
{
|
||||
// Put cursor on item position
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
screen->SetCrossHairPosition( aPos );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, int layer )
|
|||
GetScreen()->m_Active_Layer = layer;
|
||||
|
||||
if( DisplayOpt.ContrastModeDisplay )
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -293,7 +293,7 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent )
|
|||
void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -371,7 +371,7 @@ void PCB_BASE_FRAME::ProcessItemSelection( wxCommandEvent& aEvent )
|
|||
if( id >= ID_POPUP_PCB_ITEM_SELECTION_START && id <= ID_POPUP_PCB_ITEM_SELECTION_END )
|
||||
{
|
||||
BOARD_ITEM* item = (*m_Collector)[itemNdx];
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
|
||||
#if 0 && defined (DEBUG)
|
||||
item->Show( 0, std::cout );
|
||||
|
@ -455,8 +455,8 @@ void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
|||
|
||||
// must do this after the tool has been set, otherwise pad::Draw() does
|
||||
// not show proper color when DisplayOpt.ContrastModeDisplay is true.
|
||||
if( redraw && DrawPanel)
|
||||
DrawPanel->Refresh();
|
||||
if( redraw && m_canvas)
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -121,15 +121,15 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title
|
|||
{
|
||||
wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition();
|
||||
|
||||
parent->DrawPanel->m_IgnoreMouseEvents = true;
|
||||
parent->GetCanvas()->m_IgnoreMouseEvents = true;
|
||||
DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title );
|
||||
|
||||
int cmd = dlg->ShowModal();
|
||||
dlg->Destroy();
|
||||
|
||||
parent->GetScreen()->SetCrossHairPosition( oldpos );
|
||||
parent->DrawPanel->MoveCursorToCrossHair();
|
||||
parent->DrawPanel->m_IgnoreMouseEvents = false;
|
||||
parent->GetCanvas()->MoveCursorToCrossHair();
|
||||
parent->GetCanvas()->m_IgnoreMouseEvents = false;
|
||||
|
||||
return cmd == wxID_OK;
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ int PCB_EDIT_FRAME::ReturnBlockCommand( int aKey )
|
|||
|
||||
void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
{
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||
}
|
||||
|
@ -234,16 +234,16 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
case BLOCK_DRAG: /* Drag */
|
||||
case BLOCK_MOVE: /* Move */
|
||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
Block_Move();
|
||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
break;
|
||||
|
||||
case BLOCK_COPY: /* Copy */
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
Block_Duplicate();
|
||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
|
@ -259,7 +259,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
|
||||
OnModify();
|
||||
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
|
||||
GetScreen()->ClearBlockCommand();
|
||||
|
||||
if( GetScreen()->m_BlockLocate.GetCount() )
|
||||
|
@ -278,7 +278,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
// If coming here after cancel block, clean up and exit
|
||||
if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK )
|
||||
{
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
GetScreen()->ClearBlockCommand();
|
||||
return false;
|
||||
|
@ -293,11 +293,11 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
cancelCmd = true;
|
||||
|
||||
// undraw block outline
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawAndSizingBlockOutlines( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
|
||||
Block_SelectItems();
|
||||
|
||||
// Exit if no items found
|
||||
|
@ -306,7 +306,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
}
|
||||
}
|
||||
|
||||
if( !cancelCmd && DrawPanel->IsMouseCaptured() )
|
||||
if( !cancelCmd && m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||
{
|
||||
|
@ -320,24 +320,24 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||
nextcmd = true;
|
||||
DrawPanel->m_mouseCaptureCallback = drawMovingBlock;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback = drawMovingBlock;
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
break;
|
||||
|
||||
case BLOCK_DELETE: /* Delete */
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||
Block_Delete();
|
||||
break;
|
||||
|
||||
case BLOCK_ROTATE: /* Rotation */
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||
Block_Rotate();
|
||||
break;
|
||||
|
||||
case BLOCK_FLIP: /* Flip */
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||
Block_Flip();
|
||||
break;
|
||||
|
@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
|
||||
// Turn off the redraw block routine now so it is not displayed
|
||||
// with one corner at the new center of the screen
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
Window_Zoom( GetScreen()->m_BlockLocate );
|
||||
break;
|
||||
|
||||
|
@ -369,7 +369,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
if( ! nextcmd )
|
||||
{
|
||||
GetScreen()->ClearBlockCommand();
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
}
|
||||
|
||||
|
@ -647,7 +647,7 @@ void PCB_EDIT_FRAME::Block_Delete()
|
|||
SaveCopyInUndoList( *itemsList, UR_DELETED );
|
||||
|
||||
Compile_Ratsnest( NULL, true );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -707,7 +707,7 @@ void PCB_EDIT_FRAME::Block_Rotate()
|
|||
SaveCopyInUndoList( *itemsList, UR_ROTATED, centre );
|
||||
|
||||
Compile_Ratsnest( NULL, true );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -768,7 +768,7 @@ void PCB_EDIT_FRAME::Block_Flip()
|
|||
|
||||
SaveCopyInUndoList( *itemsList, UR_FLIPPED, center );
|
||||
Compile_Ratsnest( NULL, true );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -822,7 +822,7 @@ void PCB_EDIT_FRAME::Block_Move()
|
|||
SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector );
|
||||
|
||||
Compile_Ratsnest( NULL, true );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -937,5 +937,5 @@ void PCB_EDIT_FRAME::Block_Duplicate()
|
|||
SaveCopyInUndoList( newList, UR_NEW );
|
||||
|
||||
Compile_Ratsnest( NULL, true );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
|
|
@ -122,13 +122,13 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
{
|
||||
BlockState state = GetScreen()->m_BlockLocate.m_State;
|
||||
CmdBlockType command = GetScreen()->m_BlockLocate.m_Command;
|
||||
DrawPanel->m_endMouseCaptureCallback( DrawPanel, DC );
|
||||
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
|
||||
GetScreen()->m_BlockLocate.m_State = state;
|
||||
GetScreen()->m_BlockLocate.m_Command = command;
|
||||
DrawPanel->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
|
||||
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
|
||||
GetScreen()->SetCrossHairPosition( wxPoint( GetScreen()->m_BlockLocate.GetRight(),
|
||||
GetScreen()->m_BlockLocate.GetBottom() ) );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
}
|
||||
|
||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||
|
@ -146,21 +146,21 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
{
|
||||
nextcmd = true;
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
}
|
||||
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
break;
|
||||
|
||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
nextcmd = true;
|
||||
DrawPanel->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||
break;
|
||||
|
||||
|
@ -218,9 +218,9 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
|||
|
||||
GetScreen()->ClearBlockCommand();
|
||||
SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
return nextcmd;
|
||||
|
@ -231,7 +231,7 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
{
|
||||
MODULE* currentModule = GetBoard()->m_Modules;
|
||||
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
|||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
SaveCopyInUndoList( currentModule, UR_MODEDIT );
|
||||
MoveMarkedItems( currentModule, GetScreen()->m_BlockLocate.m_MoveVector );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
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_Command = BLOCK_IDLE;
|
||||
SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -662,7 +662,7 @@ void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event )
|
|||
GetScreen()->PushCommandToRedoList( List );
|
||||
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -690,7 +690,7 @@ void PCB_EDIT_FRAME::GetBoardFromRedoList( wxCommandEvent& event )
|
|||
GetScreen()->PushCommandToUndoList( List );
|
||||
|
||||
OnModify();
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
|
|||
{
|
||||
myframe->GetBoard()->SetLayerColor( aLayer, aColor );
|
||||
myframe->ReCreateLayerBox( NULL );
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
||||
|
@ -311,7 +311,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
|||
myframe->setActiveLayer( aLayer, false );
|
||||
|
||||
if(DisplayOpt.ContrastModeDisplay)
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -330,13 +330,13 @@ void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal
|
|||
brd->SetVisibleLayers( visibleLayers );
|
||||
|
||||
if( isFinal )
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
|
||||
{
|
||||
myframe->GetBoard()->SetVisibleElementColor( aId, aColor );
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
myframe->DrawPanel->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
//-----</LAYER_WIDGET callbacks>------------------------------------------
|
||||
|
|
|
@ -451,7 +451,7 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
|
|||
if( GetBoard() && GetBoard()->m_PcbFrame )
|
||||
{
|
||||
// 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 ) );
|
||||
}
|
||||
#endif
|
||||
|
@ -497,7 +497,7 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
|
|||
if( GetBoard() && GetBoard()->m_PcbFrame )
|
||||
{
|
||||
// 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 ) );
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -68,7 +68,7 @@ void PCB_EDIT_FRAME::Clean_Pcb( wxDC* DC )
|
|||
CleanupTracks( this, dlg.cleanVias, dlg.mergeSegments,
|
||||
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 )
|
||||
return;
|
||||
|
||||
aFrame->DrawPanel->m_AbortRequest = false;
|
||||
aFrame->GetCanvas()->m_AbortRequest = false;
|
||||
|
||||
// correct via m_End defects
|
||||
for( segment = aFrame->GetBoard()->m_Track; segment; segment = next )
|
||||
|
@ -231,7 +231,7 @@ static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* aFrame )
|
|||
{
|
||||
next = segment->Next();
|
||||
|
||||
if( aFrame->DrawPanel->m_AbortRequest )
|
||||
if( aFrame->GetCanvas()->m_AbortRequest )
|
||||
break;
|
||||
|
||||
if( segment->GetNet() != oldnetcode )
|
||||
|
@ -412,7 +412,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame )
|
|||
int flag, no_inc;
|
||||
wxString msg;
|
||||
|
||||
aFrame->DrawPanel->m_AbortRequest = false;
|
||||
aFrame->GetCanvas()->m_AbortRequest = false;
|
||||
|
||||
// Delete null segments
|
||||
for( segment = aFrame->GetBoard()->m_Track; segment; segment = nextsegment )
|
||||
|
@ -475,7 +475,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame )
|
|||
|
||||
nextsegment = segment->Next();
|
||||
|
||||
if( aFrame->DrawPanel->m_AbortRequest )
|
||||
if( aFrame->GetCanvas()->m_AbortRequest )
|
||||
return;
|
||||
|
||||
if( segment->Type() != PCB_TRACE_T )
|
||||
|
@ -856,13 +856,13 @@ void ConnectDanglingEndToPad( PCB_EDIT_FRAME* aFrame )
|
|||
int nb_new_trace = 0;
|
||||
wxString msg;
|
||||
|
||||
aFrame->DrawPanel->m_AbortRequest = false;
|
||||
aFrame->GetCanvas()->m_AbortRequest = false;
|
||||
|
||||
for( segment = aFrame->GetBoard()->m_Track; segment; segment = segment->Next() )
|
||||
{
|
||||
D_PAD* pad;
|
||||
|
||||
if( aFrame->DrawPanel->m_AbortRequest )
|
||||
if( aFrame->GetCanvas()->m_AbortRequest )
|
||||
return;
|
||||
|
||||
pad = aFrame->GetBoard()->GetPad( segment, START );
|
||||
|
|
|
@ -234,18 +234,18 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
|
|||
* a m_IgnoreMouseEvents++ )
|
||||
* was not balanced with the -- (now m_IgnoreMouseEvents=false), so I had to revert.
|
||||
* 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()
|
||||
// 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 );
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
// 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;
|
||||
else
|
||||
item = GetCurItem();
|
||||
|
@ -270,25 +270,25 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -345,23 +345,25 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
|||
{
|
||||
pos = GetScreen()->GetCrossHairPosition();
|
||||
GetScreen()->SetCrossHairPosition( oldpos, false );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
GetScreen()->SetCrossHairPosition( pos, false );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
#ifdef USE_WX_OVERLAY
|
||||
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
|
||||
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
|
||||
oDC.Clear();
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
|
||||
#else
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
#endif
|
||||
}
|
||||
#ifdef USE_WX_OVERLAY
|
||||
else
|
||||
DrawPanel->m_overlay.Reset();
|
||||
{
|
||||
m_canvas->m_overlay.Reset();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
|
|||
D( g_CurrentTrackList.VerifyListIntegrity(); )
|
||||
|
||||
// Delete the current trace
|
||||
ShowNewTrackWhenMovingCursor( DrawPanel, DC, wxDefaultPosition, false );
|
||||
ShowNewTrackWhenMovingCursor( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
// delete the most recently entered
|
||||
delete g_CurrentTrackList.PopBack();
|
||||
|
@ -100,7 +100,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
|
|||
|
||||
if( g_CurrentTrackList.GetCount() == 0 )
|
||||
{
|
||||
DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
m_canvas->SetMouseCapture( NULL, NULL );
|
||||
|
||||
if( GetBoard()->IsHighLightNetON() )
|
||||
HighLight( DC );
|
||||
|
@ -110,8 +110,8 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
|
|||
}
|
||||
else
|
||||
{
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
return g_CurrentTrackSegment;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
|
|||
container->Remove( aTrack );
|
||||
|
||||
// redraw the area where the track was
|
||||
DrawPanel->RefreshDrawingRect( aTrack->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( aTrack->GetBoundingBox() );
|
||||
|
||||
SaveCopyInUndoList( aTrack, UR_DELETED );
|
||||
OnModify();
|
||||
|
@ -176,7 +176,7 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack )
|
|||
GetBoard()->m_Track.Remove( segm );
|
||||
|
||||
// redraw the area where the track was
|
||||
DrawPanel->RefreshDrawingRect( segm->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( segm->GetBoundingBox() );
|
||||
picker.m_PickedItem = segm;
|
||||
picker.m_PickedItemType = segm->Type();
|
||||
itemsList.PushItem( picker );
|
||||
|
@ -225,7 +225,7 @@ void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
|
|||
GetBoard()->m_Track.Remove( tracksegment );
|
||||
|
||||
// redraw the area where the track was
|
||||
DrawPanel->RefreshDrawingRect( tracksegment->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( tracksegment->GetBoundingBox() );
|
||||
picker.m_PickedItem = tracksegment;
|
||||
picker.m_PickedItemType = tracksegment->Type();
|
||||
itemsList.PushItem( picker );
|
||||
|
|
|
@ -245,7 +245,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
|
|||
screen->SetScalingFactor( 1.0 );
|
||||
float dpi = (float)m_Parent->GetInternalUnits();
|
||||
|
||||
EDA_DRAW_PANEL* panel = m_Parent->DrawPanel;
|
||||
EDA_DRAW_PANEL* panel = m_Parent->GetCanvas();
|
||||
|
||||
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
|
||||
// to print floating point numbers like 1.3)
|
||||
|
|
|
@ -165,7 +165,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick(wxCommandEvent& event)
|
|||
DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection();
|
||||
DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection();
|
||||
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
EndModal( 1 );
|
||||
}
|
||||
|
|
|
@ -556,13 +556,11 @@ void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
|
|||
|
||||
void DIALOG_DRC_CONTROL::RedrawDrawPanel()
|
||||
{
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************/
|
||||
void DIALOG_DRC_CONTROL::DelDRCMarkers()
|
||||
/*********************************************************/
|
||||
{
|
||||
m_Parent->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
|
||||
m_ClearanceListBox->DeleteAllItems();
|
||||
|
@ -611,6 +609,7 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
|
|||
if( curTab == 0 )
|
||||
{
|
||||
selectedIndex = m_ClearanceListBox->GetSelection();
|
||||
|
||||
if( selectedIndex != wxNOT_FOUND )
|
||||
{
|
||||
m_ClearanceListBox->DeleteItem( selectedIndex );
|
||||
|
@ -622,6 +621,7 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
|
|||
else if( curTab == 1 )
|
||||
{
|
||||
selectedIndex = m_UnconnectedListBox->GetSelection();
|
||||
|
||||
if( selectedIndex != wxNOT_FOUND )
|
||||
{
|
||||
m_UnconnectedListBox->DeleteItem( selectedIndex );
|
||||
|
|
|
@ -457,8 +457,8 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
|||
|
||||
if( m_DC )
|
||||
{
|
||||
m_Parent->DrawPanel->CrossHairOff( m_DC );
|
||||
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
|
||||
m_Parent->GetCanvas()->CrossHairOff( m_DC );
|
||||
m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR );
|
||||
}
|
||||
|
||||
// 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%
|
||||
if( dtmp < -50 )
|
||||
dtmp = -50;
|
||||
|
||||
if( dtmp > +100 )
|
||||
dtmp = +100;
|
||||
|
||||
m_CurrentModule->m_LocalSolderPasteMarginRatio = dtmp / 100;
|
||||
|
||||
// Set Module Position
|
||||
|
@ -518,6 +520,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
|||
long orient = 0;
|
||||
msg = m_OrientValue->GetValue();
|
||||
msg.ToLong( &orient );
|
||||
|
||||
if( m_CurrentModule->m_Orient != orient )
|
||||
m_CurrentModule->Rotate( m_CurrentModule->m_Pos,
|
||||
orient - m_CurrentModule->m_Orient );
|
||||
|
@ -537,14 +540,19 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
|||
|
||||
/* Update 3D shape list */
|
||||
int ii = m_3D_ShapeNameListBox->GetSelection();
|
||||
|
||||
if( ii >= 0 )
|
||||
TransfertDisplayTo3DValues( ii );
|
||||
|
||||
S3D_MASTER* draw3D = m_CurrentModule->m_3D_Drawings;
|
||||
|
||||
for( unsigned ii = 0; ii < m_Shapes3D_list.size(); ii++ )
|
||||
{
|
||||
S3D_MASTER* draw3DCopy = m_Shapes3D_list[ii];
|
||||
|
||||
if( draw3DCopy->m_Shape3DName.IsEmpty() )
|
||||
continue;
|
||||
|
||||
if( draw3D == NULL )
|
||||
{
|
||||
draw3D = new S3D_MASTER( draw3D );
|
||||
|
@ -561,6 +569,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
|||
|
||||
// Remove old extra 3D shapes
|
||||
S3D_MASTER* nextdraw3D;
|
||||
|
||||
for( ; draw3D != NULL; draw3D = nextdraw3D )
|
||||
{
|
||||
nextdraw3D = (S3D_MASTER*) draw3D->Next();
|
||||
|
@ -580,8 +589,8 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
|
|||
|
||||
if( m_DC )
|
||||
{
|
||||
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
|
||||
m_Parent->DrawPanel->CrossHairOn( m_DC );
|
||||
m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_OR );
|
||||
m_Parent->GetCanvas()->CrossHairOn( m_DC );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,14 +45,13 @@ private:
|
|||
void OnCancelClick( wxCommandEvent& event );
|
||||
};
|
||||
|
||||
/*************************************************************************************/
|
||||
|
||||
void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC )
|
||||
/**************************************************************************************/
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = TRUE;
|
||||
m_canvas->m_IgnoreMouseEvents = TRUE;
|
||||
DialogEditModuleText dialog( this, TextMod, DC );
|
||||
dialog.ShowModal();
|
||||
DrawPanel->m_IgnoreMouseEvents = FALSE;
|
||||
m_canvas->m_IgnoreMouseEvents = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -85,9 +84,7 @@ void DialogEditModuleText::OnCancelClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/********************************************************/
|
||||
void DialogEditModuleText::initDlg( )
|
||||
/********************************************************/
|
||||
{
|
||||
SetFocus();
|
||||
|
||||
|
@ -101,9 +98,10 @@ void DialogEditModuleText::initDlg( )
|
|||
GetChars( m_module->m_Value->m_Text ),
|
||||
(float) m_module->m_Orient / 10 );
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
msg.Empty();
|
||||
}
|
||||
|
||||
m_ModuleInfoText->SetLabel( msg );
|
||||
|
||||
|
@ -141,6 +139,7 @@ void DialogEditModuleText::initDlg( )
|
|||
|
||||
int text_orient = m_currentText->m_Orient;
|
||||
NORMALIZE_ANGLE_90(text_orient)
|
||||
|
||||
if( (text_orient != 0) )
|
||||
m_Orient->SetSelection( 1 );
|
||||
|
||||
|
@ -149,17 +148,16 @@ void DialogEditModuleText::initDlg( )
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
||||
/*********************************************************************************/
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
if ( m_module)
|
||||
m_parent->SaveCopyInUndoList( m_module, UR_CHANGED );
|
||||
|
||||
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->m_Text = m_Name->GetValue();
|
||||
|
@ -195,12 +193,16 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
|||
// Test for a reasonnable width:
|
||||
if( width <= 1 )
|
||||
width = 1;
|
||||
|
||||
int maxthickness = Clamp_Text_PenSize(width, m_currentText->m_Size );
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
m_currentText->SetThickness( width );
|
||||
|
||||
m_currentText->SetVisible( m_Show->GetSelection() == 0 );
|
||||
|
@ -209,9 +211,10 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
|
|||
m_currentText->m_Orient = text_orient;
|
||||
|
||||
m_currentText->SetDrawCoord();
|
||||
|
||||
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 ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void Dialog_GeneralOptions::init()
|
|||
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
|
||||
m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
|
||||
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_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() )
|
||||
{
|
||||
GetParent()->SetElementVisibility(RATSNEST_VISIBLE, m_ShowGlobalRatsnest->GetValue() );
|
||||
GetParent()->DrawPanel->Refresh( );
|
||||
GetParent()->GetCanvas()->Refresh( );
|
||||
}
|
||||
|
||||
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
|
||||
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
|
||||
Segments_45_Only = m_Segments_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_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection();
|
||||
|
@ -159,9 +159,9 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
if( GetToolId() == ID_TRACK_BUTT )
|
||||
{
|
||||
if( Drc_On )
|
||||
DrawPanel->SetCursor( wxCURSOR_PENCIL );
|
||||
m_canvas->SetCursor( wxCURSOR_PENCIL );
|
||||
else
|
||||
DrawPanel->SetCursor( wxCURSOR_QUESTION_ARROW );
|
||||
m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW );
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -174,7 +174,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
Compile_Ratsnest( NULL, true );
|
||||
}
|
||||
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_MODULE_RATSNEST:
|
||||
|
@ -187,32 +187,32 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
|||
|
||||
case ID_TB_OPTIONS_SHOW_ZONES:
|
||||
DisplayOpt.DisplayZonesMode = 0;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_ZONES_DISABLE:
|
||||
DisplayOpt.DisplayZonesMode = 1;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY:
|
||||
DisplayOpt.DisplayZonesMode = 2;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
|
||||
m_DisplayViaFill = DisplayOpt.DisplayViaFill = !state;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
|
||||
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !state;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
|
||||
DisplayOpt.ContrastModeDisplay = state;
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE:
|
||||
|
|
|
@ -145,7 +145,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
|
|||
m_Parent->Compile_Ratsnest( NULL, true );
|
||||
}
|
||||
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
m_Parent->OnModify();
|
||||
|
||||
EndModal( 1 );
|
||||
|
|
|
@ -200,8 +200,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
EndModal( 1 );
|
||||
|
||||
if( change )
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -70,12 +70,13 @@ void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxD
|
|||
DisplayError(this, wxT("InstallGraphicItemPropertiesDialog() error: NULL item"));
|
||||
return;
|
||||
}
|
||||
DrawPanel->m_IgnoreMouseEvents = TRUE;
|
||||
|
||||
m_canvas->m_IgnoreMouseEvents = TRUE;
|
||||
DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this,
|
||||
aItem, aDC );
|
||||
dialog->ShowModal(); dialog->Destroy();
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = FALSE;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = FALSE;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
@ -188,8 +189,9 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
|
|||
m_Parent->SaveCopyInUndoList( m_Item, UR_CHANGED );
|
||||
|
||||
wxString msg;
|
||||
|
||||
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();
|
||||
m_Item->SetStartX( ReturnValueFromString( g_UserUnit, msg, m_Parent->GetInternalUnits() ));
|
||||
|
@ -225,8 +227,10 @@ void DialogGraphicItemProperties::OnOkClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
m_Parent->OnModify();
|
||||
|
||||
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_Parent->GetBoard()->SetDesignSettings( m_BrdSettings );
|
||||
|
|
|
@ -102,9 +102,10 @@ void PCB_EDIT_FRAME::OnOrientFootprints( wxCommandEvent& event )
|
|||
return;
|
||||
|
||||
wxString text = dlg.GetFilter();
|
||||
|
||||
if( ReOrientModules( text, dlg.GetOrientation(), dlg.ApplyToLockedModules() ) )
|
||||
{
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
Compile_Ratsnest( NULL, true );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -600,7 +600,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
|
|||
|
||||
// redraw the area where the pad was, without pad (delete pad on screen)
|
||||
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 );
|
||||
|
||||
// Update values
|
||||
|
@ -673,7 +673,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
|
|||
m_CurrentPad->DisplayInfo( m_Parent );
|
||||
|
||||
// redraw the area where the pad was
|
||||
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentPad->GetBoundingBox() );
|
||||
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentPad->GetBoundingBox() );
|
||||
m_Parent->OnModify();
|
||||
}
|
||||
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
DrawPanel->m_IgnoreMouseEvents = TRUE;
|
||||
m_canvas->m_IgnoreMouseEvents = TRUE;
|
||||
DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC );
|
||||
dlg.ShowModal();
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = FALSE;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,6 +102,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
|
|||
m_Parent->GetInternalUnits() );
|
||||
|
||||
int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers();
|
||||
|
||||
for( int layer = 0; layer < NB_LAYERS; ++layer )
|
||||
{
|
||||
if( enabledLayers & (1 << layer) )
|
||||
|
@ -109,6 +110,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
|
|||
layerList.push_back( layer );
|
||||
int itemIndex =
|
||||
m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) );
|
||||
|
||||
if( m_SelectedPCBText->GetLayer() == layer )
|
||||
m_LayerSelectionCtrl->SetSelection( itemIndex );
|
||||
}
|
||||
|
@ -119,14 +121,17 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
|
|||
default:
|
||||
m_OrientationCtrl->SetSelection( 0 );
|
||||
break;
|
||||
|
||||
case 900:
|
||||
case -2700:
|
||||
m_OrientationCtrl->SetSelection( 1 );
|
||||
break;
|
||||
|
||||
case 1800:
|
||||
case -1800:
|
||||
m_OrientationCtrl->SetSelection( 2 );
|
||||
break;
|
||||
|
||||
case 2700:
|
||||
case -900:
|
||||
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
|
||||
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
|
||||
|
@ -195,32 +200,45 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
// Set PCB Text position
|
||||
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(), m_Parent->GetInternalUnits() );
|
||||
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(), m_Parent->GetInternalUnits() );
|
||||
newPosition.x = ReturnValueFromString( g_UserUnit, m_PositionXCtrl->GetValue(),
|
||||
m_Parent->GetInternalUnits() );
|
||||
newPosition.y = ReturnValueFromString( g_UserUnit, m_PositionYCtrl->GetValue(),
|
||||
m_Parent->GetInternalUnits() );
|
||||
m_SelectedPCBText->m_Pos = newPosition;
|
||||
|
||||
// Check constraints and set PCB Text size
|
||||
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(), m_Parent->GetInternalUnits() );
|
||||
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(), m_Parent->GetInternalUnits() );
|
||||
newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(),
|
||||
m_Parent->GetInternalUnits() );
|
||||
newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(),
|
||||
m_Parent->GetInternalUnits() );
|
||||
|
||||
if( newSize.x < TEXTS_MIN_SIZE )
|
||||
newSize.x = TEXTS_MIN_SIZE;
|
||||
|
||||
if( newSize.y < TEXTS_MIN_SIZE )
|
||||
newSize.y = TEXTS_MIN_SIZE;
|
||||
|
||||
if( newSize.x > TEXTS_MAX_WIDTH )
|
||||
newSize.x = TEXTS_MAX_WIDTH;
|
||||
|
||||
if( newSize.y > TEXTS_MAX_WIDTH )
|
||||
newSize.y = TEXTS_MAX_WIDTH;
|
||||
|
||||
m_SelectedPCBText->m_Size = newSize;
|
||||
|
||||
// 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
|
||||
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 )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -255,8 +273,9 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
|
|||
// Finally, display new text if there is a context to do so
|
||||
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();
|
||||
EndModal( 1 );
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue