mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 00:21:31 +00:00
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
common
block_commande.cppcopy_to_clipboard.cpp
dialogs
drawframe.cppdrawtxt.cppsch_item_struct.cppworksheet.cppzoom.cppcvpcb
eeschema
annotate.cppblock.cppblock_libedit.cppbus-wire-junction.cppbusentry.cppcontrole.cpp
dialogs
annotate_dialog.cppdialog_SVG_print.cppdialog_color_config.cppdialog_edit_component_in_schematic.cppdialog_edit_label.cppdialog_edit_libentry_fields_in_lib.cppdialog_erc.cppdialog_print_using_printer.cpp
edit_bitmap.cppedit_component_in_schematic.cppedit_label.cppeeredraw.cppeeschema.cppeeschema_config.cppevents_called_functions_for_edit.cppfiles-io.cppfind.cppgetpart.cpphierarch.cpplib_export.cpplibedit.cpplibedit_onleftclick.cpplibedit_onrightclick.cpplibedit_plot_component.cpplibedit_undo_redo.cpplibeditframe.cpplibfield.cpponleftclick.cpponrightclick.cppoperations_on_items_lists.cpppinedit.cppsch_field.cppsch_sheet.cppsch_sheet_pin.cppschedit.cppschematic_undo_redo.cppschframe.cppsheet.cppsheetlab.cppsymbdraw.cppsymbedit.cpptool_sch.cppviewlib_frame.cppviewlibs.cppgerbview
block.cppclass_gerbview_layer_widget.cppcontrole.cpp
dialogs
draw_gerber_screen.cppevents_called_functions.cppfiles.cppgerbview_frame.cpphotkeys.cppinitpcb.cpponrightclick.cppoptions.cppinclude
pcbnew
attribut.cppautomove.cppautoplac.cppautorout.cppbasepcbframe.cppblock.cppblock_module_editor.cppboard_undo_redo.cppclass_pcb_layer_widget.cppclass_zone.cppclean.cppcontrole.cppdeltrack.cpp
dialogs
dialog_SVG_print.cppdialog_display_options.cppdialog_drc.cppdialog_edit_module_for_BoardEditor.cppdialog_edit_module_text.cppdialog_general_options.cppdialog_global_deletion.cppdialog_global_edit_tracks_and_vias.cppdialog_graphic_item_properties.cppdialog_orient_footprints.cppdialog_pad_properties.cppdialog_pcb_text_properties.cpp
dimension.cppdrc.cppedgemod.cppedit.cppedit_pcb_text.cppedit_track_width.cppeditedge.cppeditmod.cppeditrack-part2.cppeditrack.cppedtxtmod.cppevent_handlers_tracks_vias_sizes.cppfiles.cppfind.cppglobaleditpad.cpphighlight.cpphotkeys_board_editor.cpplibrairi.cpploadcmp.cppmirepcb.cppmodedit.cppmodedit_onclick.cppmodedit_undo_redo.cppmodeditoptions.cppmoduleframe.cppmodules.cppmove-drag_pads.cppmove_or_drag_track.cppmuonde.cppmuwave_command.cppnetlist.cpponleftclick.cpponrightclick.cpppcbframe.cpppcbnew.cppprint_board_functions.cppprintout_controler.cppratsnest.cppsel_layer.cppset_grid.cppsolve.cppspecctra_import.cppswap_layers.cpptr_modif.cpptracepcb.cppxchgmod.cppzones_by_polygon.cppzones_by_polygon_fill_functions.cpp@ -228,11 +228,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
|
||||
case BLOCK_MIRROR_X:
|
||||
case BLOCK_MIRROR_Y: /* mirror */
|
||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
||||
Block->InitData( DrawPanel, startpos );
|
||||
Block->InitData( m_canvas, startpos );
|
||||
break;
|
||||
|
||||
case BLOCK_PASTE:
|
||||
Block->InitData( DrawPanel, startpos );
|
||||
Block->InitData( m_canvas, startpos );
|
||||
Block->m_BlockLastCursorPosition.x = 0;
|
||||
Block->m_BlockLastCursorPosition.y = 0;
|
||||
InitBlockPasteInfos();
|
||||
@ -241,11 +241,11 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
|
||||
{
|
||||
DisplayError( this, wxT( "No Block to paste" ), 20 );
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
Block->m_ItemsSelection.ClearItemsList();
|
||||
DisplayError( this,
|
||||
@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
|
||||
}
|
||||
|
||||
Block->m_State = STATE_BLOCK_MOVE;
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, startpos, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -25,9 +25,9 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
|
||||
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
|
||||
{
|
||||
if( GetScreen()->IsBlockActive() )
|
||||
DrawPanel->SetCursor( wxCursor( DrawPanel->GetDefaultCursor() ) );
|
||||
m_canvas->SetCursor( wxCursor( m_canvas->GetDefaultCursor() ) );
|
||||
|
||||
DrawPanel->EndMouseCapture();
|
||||
m_canvas->EndMouseCapture();
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
||||
int ClipboardSizeX, ClipboardSizeY;
|
||||
bool DrawBlock = false;
|
||||
wxRect DrawArea;
|
||||
BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen();
|
||||
BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
|
||||
|
||||
/* scale is the ratio resolution/internal units */
|
||||
float scale = 82.0 / aFrame->GetInternalUnits();
|
||||
@ -73,7 +73,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
||||
|
||||
wxMetafileDC dc;
|
||||
|
||||
EDA_RECT tmp = aFrame->DrawPanel->m_ClipBox;
|
||||
EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox;
|
||||
GRResetPenAndBrush( &dc );
|
||||
const bool plotBlackAndWhite = false;
|
||||
GRForceBlackPen( plotBlackAndWhite );
|
||||
@ -81,10 +81,10 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
||||
dc.SetUserScale( scale, scale );
|
||||
ClipboardSizeX = dc.MaxX() + 10;
|
||||
ClipboardSizeY = dc.MaxY() + 10;
|
||||
aFrame->DrawPanel->m_ClipBox.SetX( 0 );
|
||||
aFrame->DrawPanel->m_ClipBox.SetY( 0 );
|
||||
aFrame->DrawPanel->m_ClipBox.SetWidth( 0x7FFFFF0 );
|
||||
aFrame->DrawPanel->m_ClipBox.SetHeight( 0x7FFFFF0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetX( 0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetY( 0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 );
|
||||
aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 );
|
||||
|
||||
if( DrawBlock )
|
||||
{
|
||||
@ -94,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
|
||||
const int maskLayer = 0xFFFFFFFF;
|
||||
aFrame->PrintPage( &dc, maskLayer, false );
|
||||
screen->m_IsPrinting = false;
|
||||
aFrame->DrawPanel->m_ClipBox = tmp;
|
||||
aFrame->GetCanvas()->m_ClipBox = tmp;
|
||||
wxMetafile* mf = dc.Close();
|
||||
|
||||
if( mf )
|
||||
|
@ -37,8 +37,8 @@ void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
|
||||
DIALOG_PAGES_SETTINGS frame( this );
|
||||
int diag = frame.ShowModal();
|
||||
|
||||
if( DrawPanel && diag )
|
||||
DrawPanel->Refresh();
|
||||
if( m_canvas && diag )
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
|
||||
#endif
|
||||
|
||||
m_Screen->SetModify();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,7 +94,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
|
||||
m_zoomSelectBox = NULL;
|
||||
m_HotkeysZoomAndGridList = NULL;
|
||||
|
||||
DrawPanel = NULL;
|
||||
m_canvas = NULL;
|
||||
m_messagePanel = NULL;
|
||||
m_currentScreen = NULL;
|
||||
m_toolId = ID_NO_TOOL_SELECTED;
|
||||
@ -142,7 +142,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
|
||||
m_FramePos.x = m_FramePos.y = 0;
|
||||
m_FrameSize.y -= m_MsgFrameHeight;
|
||||
|
||||
DrawPanel = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
|
||||
m_canvas = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
|
||||
m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ),
|
||||
wxSize( m_FrameSize.x, m_MsgFrameHeight ) );
|
||||
|
||||
@ -182,8 +182,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
|
||||
{
|
||||
m_FrameIsActive = event.GetActive();
|
||||
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
if( m_canvas )
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
event.Skip(); // required under wxMAC
|
||||
}
|
||||
@ -191,8 +191,8 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
|
||||
|
||||
void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
|
||||
{
|
||||
if( DrawPanel )
|
||||
DrawPanel->m_CanStartBlock = -1;
|
||||
if( m_canvas )
|
||||
m_canvas->m_CanStartBlock = -1;
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
@ -201,7 +201,7 @@ void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
|
||||
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
|
||||
{
|
||||
SetGridVisibility( !IsGridVisible() );
|
||||
DrawPanel->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
@ -222,10 +222,10 @@ void EDA_DRAW_FRAME::OnSelectUnits( wxCommandEvent& aEvent )
|
||||
|
||||
void EDA_DRAW_FRAME::OnToggleCrossHairStyle( wxCommandEvent& aEvent )
|
||||
{
|
||||
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
|
||||
DrawPanel->CrossHairOff( &dc );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
m_canvas->CrossHairOff( &dc );
|
||||
m_cursorShape = !m_cursorShape;
|
||||
DrawPanel->CrossHairOn( &dc );
|
||||
m_canvas->CrossHairOn( &dc );
|
||||
}
|
||||
|
||||
|
||||
@ -445,9 +445,9 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
||||
// Keep default cursor in toolbars
|
||||
SetCursor( wxNullCursor );
|
||||
|
||||
// Change DrawPanel cursor if requested.
|
||||
if( DrawPanel && aCursor >= 0 )
|
||||
DrawPanel->SetCurrentCursor( aCursor );
|
||||
// Change m_canvas cursor if requested.
|
||||
if( m_canvas && aCursor >= 0 )
|
||||
m_canvas->SetCurrentCursor( aCursor );
|
||||
|
||||
DisplayToolMsg( aToolMsg );
|
||||
|
||||
@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
|
||||
void EDA_DRAW_FRAME::InitBlockPasteInfos()
|
||||
{
|
||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -508,7 +508,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
|
||||
BASE_SCREEN* screen = GetScreen();
|
||||
bool noRefresh = true;
|
||||
|
||||
if( screen == NULL || DrawPanel == NULL )
|
||||
if( screen == NULL || m_canvas == NULL )
|
||||
return;
|
||||
|
||||
double scalar = screen->GetScalingFactor();
|
||||
@ -518,7 +518,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPosition )
|
||||
|
||||
// Calculate the portion of the drawing that can be displayed in the
|
||||
// client area at the current zoom level.
|
||||
clientSize = DrawPanel->GetClientSize();
|
||||
clientSize = m_canvas->GetClientSize();
|
||||
|
||||
// The logical size of the client window.
|
||||
logicalClientSize.x = wxRound( (double) clientSize.x / scalar );
|
||||
@ -694,12 +694,12 @@ SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
|
||||
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
|
||||
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
|
||||
|
||||
DrawPanel->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
|
||||
screen->m_ScrollPixelsPerUnitY,
|
||||
screen->m_ScrollbarNumber.x,
|
||||
screen->m_ScrollbarNumber.y,
|
||||
screen->m_ScrollbarPos.x,
|
||||
screen->m_ScrollbarPos.y, noRefresh );
|
||||
m_canvas->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
|
||||
screen->m_ScrollPixelsPerUnitY,
|
||||
screen->m_ScrollbarNumber.x,
|
||||
screen->m_ScrollbarNumber.y,
|
||||
screen->m_ScrollbarPos.x,
|
||||
screen->m_ScrollbarPos.y, noRefresh );
|
||||
}
|
||||
|
||||
|
||||
|
@ -204,7 +204,7 @@ static int overbar_position( int size_v, int thickness )
|
||||
/**
|
||||
* Function DrawGraphicText
|
||||
* Draw a graphic text (like module texts)
|
||||
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
|
||||
* @param aPanel = the current m_canvas. NULL if draw within a 3D GL Canvas
|
||||
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
|
||||
* @param aPos = text position (according to h_justify, v_justify)
|
||||
* @param aColor (enum EDA_Colors) = text color
|
||||
|
@ -100,13 +100,13 @@ void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
|
||||
m_Flags = 0;
|
||||
screen->SetModify();
|
||||
screen->SetCurItem( NULL );
|
||||
aFrame->DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
aFrame->DrawPanel->EndMouseCapture();
|
||||
aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
|
||||
aFrame->GetCanvas()->EndMouseCapture();
|
||||
|
||||
if( aDC )
|
||||
{
|
||||
EDA_CROSS_HAIR_MANAGER( aFrame->DrawPanel, aDC ); // Erase schematic cursor
|
||||
Draw( aFrame->DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
EDA_CROSS_HAIR_MANAGER( aFrame->GetCanvas(), aDC ); // Erase schematic cursor
|
||||
Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
false );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString,
|
||||
false );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
return nextCmd;
|
||||
@ -218,7 +218,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
{
|
||||
wxPoint pt;
|
||||
|
||||
if( !DrawPanel->IsMouseCaptured() )
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||
}
|
||||
@ -244,7 +244,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
if ( m_component )
|
||||
m_component->MoveSelectedItems( pt );
|
||||
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case BLOCK_COPY: /* Copy */
|
||||
@ -302,8 +302,8 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
|
||||
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
|
||||
DrawPanel->Refresh( true );
|
||||
m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
|
||||
m_canvas->Refresh( true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -129,7 +129,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
||||
{
|
||||
s_ConnexionStartPoint = cursorpos;
|
||||
s_OldWiresList = GetScreen()->ExtractWires( true );
|
||||
GetScreen()->SchematicCleanUp( DrawPanel );
|
||||
GetScreen()->SchematicCleanUp( m_canvas );
|
||||
|
||||
switch( type )
|
||||
{
|
||||
@ -160,7 +160,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
||||
}
|
||||
|
||||
GetScreen()->SetCurItem( newsegment );
|
||||
DrawPanel->SetMouseCapture( DrawSegment, AbortCreateNewLine );
|
||||
m_canvas->SetMouseCapture( DrawSegment, AbortCreateNewLine );
|
||||
m_itemToRepeat = NULL;
|
||||
}
|
||||
else // A segment is in progress: terminates the current segment and add a new segment.
|
||||
@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
||||
return;
|
||||
}
|
||||
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
/* Creates the new segment, or terminates the command
|
||||
* if the end point is on a pin, junction or an other wire or bus */
|
||||
@ -193,9 +193,9 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
||||
|
||||
oldsegment->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( oldsegment );
|
||||
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor
|
||||
oldsegment->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( DC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOff( DC ); // Erase schematic cursor
|
||||
oldsegment->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( DC ); // Display schematic cursor
|
||||
|
||||
/* Create a new segment, and chain it after the current new segment */
|
||||
if( nextsegment )
|
||||
@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
||||
oldsegment->SetFlags( SELECTED );
|
||||
newsegment->SetFlags( IS_NEW );
|
||||
GetScreen()->SetCurItem( newsegment );
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
|
||||
|
||||
/* This is the first segment: Now we know the start segment position.
|
||||
* Create a junction if needed. Note: a junction can be needed later,
|
||||
@ -282,7 +282,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
||||
GetScreen()->SetDrawItems( lastsegment );
|
||||
}
|
||||
|
||||
DrawPanel->EndMouseCapture( -1, -1, wxEmptyString, false );
|
||||
m_canvas->EndMouseCapture( -1, -1, wxEmptyString, false );
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
|
||||
wxPoint end_point, alt_end_point;
|
||||
@ -298,7 +298,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
||||
alt_end_point = lastsegment->GetStartPoint();
|
||||
}
|
||||
|
||||
GetScreen()->SchematicCleanUp( DrawPanel );
|
||||
GetScreen()->SchematicCleanUp( m_canvas );
|
||||
|
||||
/* clear flags and find last segment entered, for repeat function */
|
||||
segment = (SCH_LINE*) GetScreen()->GetDrawItems();
|
||||
@ -329,10 +329,10 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
||||
if( GetScreen()->IsJunctionNeeded( s_ConnexionStartPoint ) )
|
||||
AddJunction( DC, s_ConnexionStartPoint );
|
||||
|
||||
GetScreen()->TestDanglingEnds( DrawPanel, DC );
|
||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||
|
||||
/* Redraw wires and junctions which can be changed by TestDanglingEnds() */
|
||||
DrawPanel->CrossHairOff( DC ); // Erase schematic cursor
|
||||
m_canvas->CrossHairOff( DC ); // Erase schematic cursor
|
||||
EDA_ITEM* item = GetScreen()->GetDrawItems();
|
||||
|
||||
while( item )
|
||||
@ -341,7 +341,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
||||
{
|
||||
case SCH_JUNCTION_T:
|
||||
case SCH_LINE_T:
|
||||
DrawPanel->RefreshDrawingRect( item->GetBoundingBox() );
|
||||
m_canvas->RefreshDrawingRect( item->GetBoundingBox() );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -351,7 +351,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
||||
item = item->Next();
|
||||
}
|
||||
|
||||
DrawPanel->CrossHairOn( DC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOn( DC ); // Display schematic cursor
|
||||
|
||||
SaveCopyInUndoList( s_OldWiresList, UR_WIRE_IMAGE );
|
||||
s_OldWiresList = NULL;
|
||||
@ -436,15 +436,15 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
|
||||
}
|
||||
|
||||
polyLine->SetPoint( idx, endpos );
|
||||
polyLine->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
polyLine->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSegment( DrawPanel, DC, wxDefaultPosition, false );
|
||||
DrawSegment( m_canvas, DC, wxDefaultPosition, false );
|
||||
}
|
||||
|
||||
screen->RemoveFromDrawList( screen->GetCurItem() );
|
||||
DrawPanel->m_mouseCaptureCallback = NULL;
|
||||
m_canvas->m_mouseCaptureCallback = NULL;
|
||||
screen->SetCurItem( NULL );
|
||||
}
|
||||
|
||||
@ -456,9 +456,9 @@ SCH_JUNCTION* SCH_EDIT_FRAME::AddJunction( wxDC* aDC, const wxPoint& aPosition,
|
||||
|
||||
m_itemToRepeat = junction;
|
||||
|
||||
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
junction->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
junction->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( aDC ); // Display schematic cursor
|
||||
|
||||
junction->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( junction );
|
||||
@ -478,9 +478,9 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( wxDC* aDC, const wxPoint& aPositio
|
||||
NewNoConnect = new SCH_NO_CONNECT( aPosition );
|
||||
m_itemToRepeat = NewNoConnect;
|
||||
|
||||
DrawPanel->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
NewNoConnect->Draw( DrawPanel, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CrossHairOn( aDC ); // Display schematic cursor
|
||||
m_canvas->CrossHairOff( aDC ); // Erase schematic cursor
|
||||
NewNoConnect->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_canvas->CrossHairOn( aDC ); // Display schematic cursor
|
||||
|
||||
NewNoConnect->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( NewNoConnect );
|
||||
@ -528,7 +528,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
|
||||
m_itemToRepeat->SetFlags( IS_NEW );
|
||||
( (SCH_COMPONENT*) m_itemToRepeat )->SetTimeStamp( GetNewTimeStamp() );
|
||||
m_itemToRepeat->Move( pos );
|
||||
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
MoveItem( m_itemToRepeat, DC );
|
||||
return;
|
||||
}
|
||||
@ -543,7 +543,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
|
||||
m_itemToRepeat->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( m_itemToRepeat );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
m_itemToRepeat->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_itemToRepeat->Draw( m_canvas, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
SaveCopyInUndoList( m_itemToRepeat, UR_NEW );
|
||||
m_itemToRepeat->ClearFlags();
|
||||
}
|
||||
|
@ -74,10 +74,10 @@ void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int en
|
||||
|
||||
s_LastShape = entry_shape == '/' ? '/' : '\\';
|
||||
|
||||
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
BusEntry->SetBusEntryShape( s_LastShape );
|
||||
GetScreen()->TestDanglingEnds();
|
||||
BusEntry->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
BusEntry->Draw( m_canvas, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
OnModify( );
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
|
||||
|
||||
// If the user aborted the clarification context menu, don't show it again at the
|
||||
// off grid position.
|
||||
if( !item && DrawPanel->m_AbortRequest )
|
||||
if( !item && m_canvas->m_AbortRequest )
|
||||
{
|
||||
DrawPanel->m_AbortRequest = false;
|
||||
m_canvas->m_AbortRequest = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
|
||||
|
||||
if( !item )
|
||||
{
|
||||
DrawPanel->m_AbortRequest = false; // Just in case the user aborted the context menu.
|
||||
m_canvas->m_AbortRequest = false; // Just in case the user aborted the context menu.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -171,9 +171,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
|
||||
|
||||
// Set to NULL in case user aborts the clarification context menu.
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
DrawPanel->m_AbortRequest = true; // Changed to false if an item is selected
|
||||
m_canvas->m_AbortRequest = true; // Changed to false if an item is selected
|
||||
PopupMenu( &selectMenu );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
item = GetScreen()->GetCurItem();
|
||||
}
|
||||
}
|
||||
@ -208,25 +208,25 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -240,23 +240,23 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
#ifdef USE_WX_OVERLAY
|
||||
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
|
||||
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
|
||||
oDC.Clear();
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
|
||||
#else
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
#endif
|
||||
}
|
||||
#ifdef USE_WX_OVERLAY
|
||||
else
|
||||
DrawPanel->m_overlay.Reset();
|
||||
m_canvas->m_overlay.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -291,25 +291,25 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -323,23 +323,23 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
#ifdef USE_WX_OVERLAY
|
||||
wxDCOverlay oDC( DrawPanel->m_overlay, (wxWindowDC*)aDC );
|
||||
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
|
||||
oDC.Clear();
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, false );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
|
||||
#else
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
#endif
|
||||
}
|
||||
#ifdef USE_WX_OVERLAY
|
||||
else
|
||||
DrawPanel->m_overlay.Reset();
|
||||
m_canvas->m_overlay.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -371,25 +371,25 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
pos.y -= wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
pos.y += wxRound( gridSize.y );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
pos.x -= wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
pos.x += wxRound( gridSize.x );
|
||||
DrawPanel->MoveCursor( pos );
|
||||
m_canvas->MoveCursor( pos );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -403,13 +403,13 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||
{
|
||||
pos = screen->GetCrossHairPosition();
|
||||
screen->SetCrossHairPosition( oldpos );
|
||||
DrawPanel->CrossHairOff( aDC );
|
||||
m_canvas->CrossHairOff( aDC );
|
||||
screen->SetCrossHairPosition( pos );
|
||||
DrawPanel->CrossHairOn( aDC );
|
||||
m_canvas->CrossHairOn( aDC );
|
||||
|
||||
if( DrawPanel->IsMouseCaptured() )
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, aDC, aPosition, true );
|
||||
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
||||
message = _( "Clear and annotate all of the components " );
|
||||
else
|
||||
message = _( "Annotate only the unannotated components " );
|
||||
|
||||
if( GetLevel() )
|
||||
message += _( "on the entire schematic?" );
|
||||
else
|
||||
@ -125,13 +126,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
||||
|
||||
message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
|
||||
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
|
||||
|
||||
if (response == wxCANCEL)
|
||||
return;
|
||||
|
||||
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
|
||||
(ANNOTATE_OPTION_T) GetAnnotateAlgo(),
|
||||
GetResetItems() , true );
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
m_btnClear->Enable();
|
||||
}
|
||||
@ -150,12 +152,13 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
|
||||
message += _( "the current sheet?" );
|
||||
|
||||
message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
|
||||
response = wxMessageBox( message, wxT( "" ),
|
||||
wxICON_EXCLAMATION | wxOK | wxCANCEL );
|
||||
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
|
||||
|
||||
if (response == wxCANCEL)
|
||||
return;
|
||||
|
||||
m_Parent->DeleteAnnotation( GetLevel() ? false : true );
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
m_btnClear->Enable(false);
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
|
||||
SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units
|
||||
|
||||
screen->SetScalingFactor( 1.0 );
|
||||
EDA_DRAW_PANEL* panel = frame->DrawPanel;
|
||||
EDA_DRAW_PANEL* panel = frame->GetCanvas();
|
||||
|
||||
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
|
||||
// to print floating point numbers like 1.3)
|
||||
|
@ -289,14 +289,17 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
|
||||
g_DrawBgColor = BLACK;
|
||||
|
||||
bool warning = false;
|
||||
|
||||
for( int ii = 0; ii < MAX_LAYERS; ii++ )
|
||||
{
|
||||
g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ];
|
||||
|
||||
if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] )
|
||||
warning = true;
|
||||
}
|
||||
|
||||
m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] );
|
||||
|
||||
if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] )
|
||||
warning = true;
|
||||
|
||||
@ -311,11 +314,9 @@ void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event )
|
||||
// Prompt the user if an item has the same color as the background
|
||||
// because this item cannot be seen:
|
||||
if( warning )
|
||||
wxMessageBox(
|
||||
_("Warning:\nSome items have the same color as the background\nand they will not be seen on screen")
|
||||
);
|
||||
wxMessageBox( _("Warning:\nSome items have the same color as the background\nand they will not be seen on screen") );
|
||||
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
EndModal( 1 );
|
||||
}
|
||||
@ -330,7 +331,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event )
|
||||
void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event )
|
||||
{
|
||||
UpdateColorsSettings();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
|
||||
wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T,
|
||||
wxT( "Invalid component object pointer. Bad Programmer!" ) );
|
||||
|
||||
DrawPanel->m_IgnoreMouseEvents = true;
|
||||
m_canvas->m_IgnoreMouseEvents = true;
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this );
|
||||
|
||||
@ -54,8 +54,8 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
|
||||
// so it comes up wide enough next time.
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
|
||||
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
DrawPanel->m_IgnoreMouseEvents = false;
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
m_canvas->m_IgnoreMouseEvents = false;
|
||||
dlg->Destroy();
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
|
||||
|
||||
m_Parent->OnModify();
|
||||
m_Parent->GetScreen()->TestDanglingEnds();
|
||||
m_Parent->DrawPanel->Refresh( true );
|
||||
m_Parent->GetCanvas()->Refresh( true );
|
||||
|
||||
EndModal( 0 );
|
||||
}
|
||||
@ -834,8 +834,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
||||
if( m_Cmp->m_Flags == 0 )
|
||||
m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED );
|
||||
|
||||
INSTALL_UNBUFFERED_DC( dc, m_Parent->DrawPanel );
|
||||
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() );
|
||||
m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
// Initialize field values to default values found in library:
|
||||
LIB_FIELD& refField = entry->GetReferenceField();
|
||||
@ -850,6 +850,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
||||
|
||||
m_Parent->OnModify();
|
||||
|
||||
m_Cmp->Draw( m_Parent->DrawPanel, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
EndModal( 1 );
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ void DialogLabelEditor::OnOkClick( wxCommandEvent& aEvent )
|
||||
|
||||
void DialogLabelEditor::OnCancelClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_Parent->DrawPanel->MoveCursorToCrossHair();
|
||||
m_Parent->GetCanvas()->MoveCursorToCrossHair();
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
|
||||
if( m_CurrentText->GetFlags() == 0 )
|
||||
m_Parent->SaveCopyInUndoList( m_CurrentText, UR_CHANGED );
|
||||
|
||||
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
|
||||
text = m_textLabel->GetValue();
|
||||
|
||||
@ -269,7 +269,7 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& aEvent )
|
||||
if( m_CurrentText->IsNew() )
|
||||
g_DefaultTextLabelSize = m_CurrentText->m_Size.x;
|
||||
|
||||
m_Parent->DrawPanel->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
m_Parent->DrawPanel->MoveCursorToCrossHair();
|
||||
m_Parent->GetCanvas()->RefreshDrawingRect( m_CurrentText->GetBoundingBox() );
|
||||
m_Parent->GetCanvas()->MoveCursorToCrossHair();
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
|
||||
if( m_component == NULL )
|
||||
return;
|
||||
|
||||
DrawPanel->EndMouseCapture( ID_NO_TOOL_SELECTED, DrawPanel->GetDefaultCursor() );
|
||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
|
||||
|
||||
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, m_component );
|
||||
|
||||
|
@ -113,7 +113,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
|
||||
|
||||
ScreenList.DeleteAllMarkers( MARK_ERC );
|
||||
m_MarkersList->ClearList();
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
@ -563,7 +563,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
||||
DisplayERC_MarkersList();
|
||||
|
||||
// Display new markers:
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
if( m_writeErcFile )
|
||||
{
|
||||
|
@ -316,7 +316,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
|
||||
wxRect fitRect;
|
||||
wxDC* dc = GetDC();
|
||||
SCH_EDIT_FRAME* parent = m_Parent->GetParent();
|
||||
EDA_DRAW_PANEL* panel = parent->DrawPanel;
|
||||
EDA_DRAW_PANEL* panel = parent->GetCanvas();
|
||||
|
||||
wxBusyCursor dummy;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user