From 750dd6eeaccc2ba5cf291213822c375a0d0d9ee2 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 23 Dec 2011 09:16:36 +0100 Subject: [PATCH 01/12] Eeschema: fix bug that creates duplicate segments instead of breaking them at junctions points. Duplicate segments where created in drag command and netlist calculations. --- eeschema/sch_screen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 797da93e32..069779328e 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -970,8 +970,8 @@ bool SCH_SCREEN::BreakSegment( const wxPoint& aPoint ) // Break the segment at aPoint and create a new segment. newSegment = new SCH_LINE( *segment ); - newSegment->GetStartPoint() = aPoint; - segment->GetEndPoint() = newSegment->GetStartPoint(); + newSegment->SetStartPoint( aPoint ); + segment->SetEndPoint( aPoint ); newSegment->SetNext( segment->Next() ); segment->SetNext( newSegment ); item = newSegment; From 375310f2ab642cff29d3ca098bf7f576e400200b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 27 Dec 2011 19:08:50 +0100 Subject: [PATCH 02/12] 3D view: Fix Bug #908871 Eeschema: fix a minor issue. --- 3d-viewer/3d_read_mesh.cpp | 13 ++++++++++--- eeschema/libedit.cpp | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/3d-viewer/3d_read_mesh.cpp b/3d-viewer/3d_read_mesh.cpp index bed2b50104..e98d398574 100644 --- a/3d-viewer/3d_read_mesh.cpp +++ b/3d-viewer/3d_read_mesh.cpp @@ -49,13 +49,20 @@ int S3D_MASTER::ReadData() return 1; } - if( wxFileName::FileExists( m_Shape3DName ) ) + wxString shape3DNname = m_Shape3DName; +#ifdef __WINDOWS__ + shape3DNname.Replace( wxT("/"), wxT("\\") ); +#else + shape3DNname.Replace( wxT("\\"), wxT("/") ); +#endif + + if( wxFileName::FileExists( shape3DNname ) ) { - FullFilename = m_Shape3DName; + FullFilename = shape3DNname; } else { - fn = m_Shape3DName; + fn = shape3DNname; FullFilename = wxGetApp().FindLibraryPath( fn ); if( FullFilename.IsEmpty() ) diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 2fe713d023..d73356e0d7 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -322,7 +322,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) if( libFileName.FileExists() ) { backupFileName.SetExt( wxT( "bak" ) ); - wxRemoveFile( backupFileName.GetFullPath() ); + if( backupFileName.FileExists() ) + wxRemoveFile( backupFileName.GetFullPath() ); if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) ) { @@ -361,7 +362,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) if( docFileName.FileExists() ) { backupFileName.SetExt( wxT( "bck" ) ); - wxRemoveFile( backupFileName.GetFullPath() ); + if( backupFileName.FileExists() ) + wxRemoveFile( backupFileName.GetFullPath() ); if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) ) { From 1cb1e88ef4963839e18e8e5335db49e0c2d6be6f Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 28 Dec 2011 09:15:00 -0500 Subject: [PATCH 03/12] Fix wxWidgets 2.8 build error. --- pcbnew/files.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index a5e32a6a3d..71764e7ac3 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -299,9 +299,10 @@ this file again." ) ); } } catch( IO_ERROR ioe ) - {wxMessageBox("catch"); - wxString msg = wxString::Format( _( "Error loading board.\n%s" ), - ioe.errorText.GetData() ); + { + wxMessageBox( _( "catch" ) ); + wxString msg = wxString::Format( _( "Error loading board.\n%s" ), + ioe.errorText.GetData() ); wxMessageBox( msg, _( "Open Board File" ), wxOK | wxICON_ERROR ); } From b7db108cd7e613b712f19445a205b0d36d05dd66 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 28 Dec 2011 16:14:46 +0100 Subject: [PATCH 04/12] Pcbnew: fix potential bug in connections calculations (see Bug #909298 ). --- pcbnew/class_board.cpp | 8 ++++---- pcbnew/connect.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 651224eafc..72c5b74e57 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -1583,12 +1583,12 @@ D_PAD* BOARD::GetPad( std::vector& aPadList, const wxPoint& aPosition, i int idxmax = aPadList.size()-1; int delta = aPadList.size(); - if( delta & 1 && delta > 1 ) - delta += 1; - delta /= 2; - int idx = delta; // Starting index is the middle of list + + int idx = 0; // Starting index is the beginning of list while( delta ) { + // Calculate half size of remaining interval to test. + // Ensure the computed value is not truncated (too small) if( (delta & 1) && ( delta > 1 ) ) delta++; delta /= 2; diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp index 5d44c7b19e..2439bd5d58 100644 --- a/pcbnew/connect.cpp +++ b/pcbnew/connect.cpp @@ -342,12 +342,12 @@ void CONNECTIONS::CollectItemsNearTo( std::vector& aList, int idxmax = m_candidates.size()-1; int delta = m_candidates.size(); - if( delta & 1 && delta > 1 ) - delta += 1; - delta /= 2; - int idx = delta; // Starting index is the middle of list + + int idx = 0; // Starting index is the beginning of list while( delta ) { + // Calculate half size of remaining interval to test. + // Ensure the computed value is not truncated (too small) if( (delta & 1) && ( delta > 1 ) ) delta++; delta /= 2; @@ -530,12 +530,12 @@ int CONNECTIONS::searchEntryPointInCandidatesList( const wxPoint & aPoint) int idxmax = m_candidates.size()-1; int delta = m_candidates.size(); - if( delta & 1 && delta > 1 ) - delta += 1; - delta /= 2; - int idx = delta; // Starting index is the middle of list + + int idx = 0; // Starting index is the beginning of list while( delta ) { + // Calculate half size of remaining interval to test. + // Ensure the computed value is not truncated (too small) if( (delta & 1) && ( delta > 1 ) ) delta++; delta /= 2; From 8985a1807bc438b0eb151e4ac4cf145970b3035d Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 29 Dec 2011 15:11:42 -0500 Subject: [PATCH 05/12] Encapsulation and other minor improvements. * EDA_DRAW_PANEL completely encapsulated. * Moved OSX m_overlay member from EDA_DRAW_PANEL to EDA_DRAW_FRAME where it is used. * Doxygen comment warning fixes. --- common/base_struct.cpp | 4 +- common/block_commande.cpp | 10 +- common/class_marker_base.cpp | 2 +- common/copy_to_clipboard.cpp | 42 +++++-- common/dialogs/dialog_image_editor.cpp | 3 - common/drawframe.cpp | 6 +- common/drawpanel.cpp | 78 ++++++++----- common/drawtxt.cpp | 12 +- common/edaappl.cpp | 2 +- common/worksheet.cpp | 27 +++-- cvpcb/class_DisplayFootprintsFrame.cpp | 2 +- eeschema/block.cpp | 35 +++--- eeschema/block_libedit.cpp | 10 +- eeschema/bus-wire-junction.cpp | 6 +- eeschema/class_libentry.cpp | 6 +- eeschema/controle.cpp | 30 ++--- eeschema/dialogs/dialog_SVG_print.cpp | 10 +- .../dialog_edit_component_in_schematic.cpp | 4 +- .../dialogs/dialog_print_using_printer.cpp | 7 +- eeschema/edit_component_in_schematic.cpp | 4 +- eeschema/eeredraw.cpp | 29 ++++- eeschema/eeschema_config.cpp | 4 +- eeschema/getpart.cpp | 16 +-- eeschema/hierarch.cpp | 2 +- eeschema/lib_arc.cpp | 16 ++- eeschema/lib_bezier.cpp | 8 +- eeschema/lib_circle.cpp | 8 +- eeschema/lib_draw_item.cpp | 4 +- eeschema/lib_field.cpp | 2 +- eeschema/lib_pin.cpp | 4 +- eeschema/lib_polyline.cpp | 8 +- eeschema/lib_rectangle.cpp | 8 +- eeschema/lib_text.cpp | 2 +- eeschema/libedit.cpp | 2 +- eeschema/libedit_onleftclick.cpp | 36 +++++- eeschema/libedit_onrightclick.cpp | 4 +- eeschema/libeditframe.cpp | 30 ++--- eeschema/onleftclick.cpp | 48 ++++---- eeschema/onrightclick.cpp | 8 +- eeschema/pinedit.cpp | 8 +- eeschema/sch_bitmap.cpp | 2 +- eeschema/sch_bus_entry.cpp | 2 +- eeschema/sch_component.cpp | 6 +- eeschema/sch_field.cpp | 6 +- eeschema/sch_junction.cpp | 2 +- eeschema/sch_line.cpp | 5 +- eeschema/sch_no_connect.cpp | 6 +- eeschema/sch_polyline.cpp | 4 +- eeschema/sch_screen.cpp | 2 +- eeschema/sch_sheet.cpp | 2 +- eeschema/sch_text.cpp | 10 +- eeschema/schedit.cpp | 2 +- eeschema/schframe.cpp | 8 +- eeschema/sheet.cpp | 10 +- eeschema/symbdraw.cpp | 37 ++++++- eeschema/symbedit.cpp | 4 +- gerbview/block.cpp | 16 +-- gerbview/class_gerber_draw_item.cpp | 24 ++-- gerbview/controle.cpp | 32 +++++- gerbview/draw_gerber_screen.cpp | 10 +- gerbview/events_called_functions.cpp | 2 +- gerbview/gerbview_frame.cpp | 2 +- gerbview/onrightclick.cpp | 2 +- include/class_drawpanel.h | 103 +++++++++++++----- include/common.h | 3 - include/dialog_helpers.h | 4 + include/wxstruct.h | 13 ++- pcbnew/automove.cpp | 2 +- pcbnew/autoplac.cpp | 12 +- pcbnew/autorout.cpp | 2 +- pcbnew/basepcbframe.cpp | 2 +- pcbnew/block.cpp | 22 ++-- pcbnew/block_module_editor.cpp | 10 +- pcbnew/class_dimension.cpp | 28 ++--- pcbnew/class_drawsegment.cpp | 36 +++--- pcbnew/class_edge_mod.cpp | 24 ++-- pcbnew/class_mire.cpp | 14 +-- pcbnew/class_module.cpp | 6 +- pcbnew/class_netinfo_item.cpp | 2 +- pcbnew/class_pad_draw_functions.cpp | 2 +- pcbnew/class_text_mod.cpp | 7 +- pcbnew/class_track.cpp | 44 ++++---- pcbnew/class_track.h | 4 +- pcbnew/class_zone.cpp | 18 +-- pcbnew/clean.cpp | 12 +- pcbnew/controle.cpp | 14 +-- pcbnew/deltrack.cpp | 2 +- pcbnew/dialogs/dialog_SVG_print.cpp | 9 +- pcbnew/dialogs/dialog_edit_module_text.cpp | 4 +- pcbnew/dialogs/dialog_general_options.cpp | 5 +- .../dialog_graphic_item_properties.cpp | 7 +- pcbnew/dialogs/dialog_pcb_text_properties.cpp | 4 +- pcbnew/dimension.cpp | 2 +- pcbnew/edgemod.cpp | 32 +++++- pcbnew/edit.cpp | 34 +++--- pcbnew/edit_pcb_text.cpp | 33 +++++- pcbnew/editedge.cpp | 37 ++++++- pcbnew/editrack-part2.cpp | 6 +- pcbnew/editrack.cpp | 6 +- pcbnew/edtxtmod.cpp | 26 ++++- pcbnew/hotkeys_board_editor.cpp | 26 ++--- pcbnew/librairi.cpp | 4 +- pcbnew/modedit.cpp | 13 +-- pcbnew/moduleframe.cpp | 10 +- pcbnew/modules.cpp | 29 ++++- pcbnew/move_or_drag_track.cpp | 6 +- pcbnew/muonde.cpp | 10 +- pcbnew/onleftclick.cpp | 42 +++---- pcbnew/onrightclick.cpp | 6 +- pcbnew/pcbframe.cpp | 4 +- pcbnew/print_board_functions.cpp | 12 +- pcbnew/printout_controler.cpp | 12 +- pcbnew/protos.h | 4 +- pcbnew/ratsnest.cpp | 2 +- pcbnew/solve.cpp | 16 ++- pcbnew/tracepcb.cpp | 12 +- pcbnew/zones_by_polygon.cpp | 10 +- 117 files changed, 933 insertions(+), 619 deletions(-) diff --git a/common/base_struct.cpp b/common/base_struct.cpp index 6cd24b5f64..cf09a6d4c2 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -494,10 +494,10 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int cX = aPos.x + aOffset.x; int cY = aPos.y + aOffset.y; - GRLine( &aPanel->m_ClipBox, aDC, cX - anchor_size, cY, + GRLine( aPanel->GetClipBox(), aDC, cX - anchor_size, cY, cX + anchor_size, cY, 0, aAnchor_color ); - GRLine( &aPanel->m_ClipBox, aDC, cX, cY - anchor_size, + GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size, cX, cY + anchor_size, 0, aAnchor_color ); } diff --git a/common/block_commande.cpp b/common/block_commande.cpp index 48a012d559..fa605248a5 100644 --- a/common/block_commande.cpp +++ b/common/block_commande.cpp @@ -131,10 +131,10 @@ void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf GRSetDrawMode( aDC, aDrawMode ); if( w == 0 || h == 0 ) - GRLine( &aPanel->m_ClipBox, aDC, GetX() + aOffset.x, GetY() + aOffset.y, + GRLine( aPanel->GetClipBox(), aDC, GetX() + aOffset.x, GetY() + aOffset.y, GetRight() + aOffset.x, GetBottom() + aOffset.y, 0, aColor ); else - GRRect( &aPanel->m_ClipBox, aDC, GetX() + aOffset.x, GetY() + aOffset.y, + GRRect( aPanel->GetClipBox(), aDC, GetX() + aOffset.x, GetY() + aOffset.y, GetRight() + aOffset.x, GetBottom() + aOffset.y, 0, aColor ); } @@ -241,7 +241,7 @@ 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; - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); return true; } @@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo } Block->m_State = STATE_BLOCK_MOVE; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false ); + m_canvas->CallMouseCapture( DC, startpos, false ); break; default: @@ -314,7 +314,7 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC ) if( Panel->IsMouseCaptured() ) /* Erase current drawing on screen */ { /* Clear block outline. */ - Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, false ); + Panel->CallMouseCapture( DC, wxDefaultPosition, false ); Panel->SetMouseCapture( NULL, NULL ); screen->SetCurItem( NULL ); diff --git a/common/class_marker_base.cpp b/common/class_marker_base.cpp index 9de65efc59..c15a7f1beb 100644 --- a/common/class_marker_base.cpp +++ b/common/class_marker_base.cpp @@ -162,7 +162,7 @@ void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, corners[ii] += m_Pos + aOffset; } - GRClosedPoly( &aPanel->m_ClipBox, aDC, CORNERS_COUNT, corners, + GRClosedPoly( aPanel->GetClipBox(), aDC, CORNERS_COUNT, corners, true, // = Filled 0, // outline width m_Color, // outline color diff --git a/common/copy_to_clipboard.cpp b/common/copy_to_clipboard.cpp index 2a28c30390..31507a068a 100644 --- a/common/copy_to_clipboard.cpp +++ b/common/copy_to_clipboard.cpp @@ -1,9 +1,30 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: copy_to_clipboard.cpp -// Author: jean-pierre Charras -// Created: 18 aug 2006 -// Licence: License GNU -///////////////////////////////////////////////////////////////////////////// +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * 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 copy_to_clipboard.cpp + */ #include "wx/metafile.h" #include "fctsys.h" @@ -73,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) wxMetafileDC dc; - EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox; + EDA_RECT tmp = *aFrame->GetCanvas()->GetClipBox(); GRResetPenAndBrush( &dc ); const bool plotBlackAndWhite = false; GRForceBlackPen( plotBlackAndWhite ); @@ -81,10 +102,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) dc.SetUserScale( scale, scale ); ClipboardSizeX = dc.MaxX() + 10; ClipboardSizeY = dc.MaxY() + 10; - aFrame->GetCanvas()->m_ClipBox.SetX( 0 ); - aFrame->GetCanvas()->m_ClipBox.SetY( 0 ); - aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 ); - aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 ); + aFrame->GetCanvas()->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) ); if( DrawBlock ) { @@ -94,7 +112,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) const int maskLayer = 0xFFFFFFFF; aFrame->PrintPage( &dc, maskLayer, false ); screen->m_IsPrinting = false; - aFrame->GetCanvas()->m_ClipBox = tmp; + aFrame->GetCanvas()->SetClipBox( tmp ); wxMetafile* mf = dc.Close(); if( mf ) diff --git a/common/dialogs/dialog_image_editor.cpp b/common/dialogs/dialog_image_editor.cpp index 48b81ec3f2..b1ca03675a 100644 --- a/common/dialogs/dialog_image_editor.cpp +++ b/common/dialogs/dialog_image_editor.cpp @@ -28,10 +28,7 @@ #include "fctsys.h" #include "gr_basic.h" - #include "common.h" -#include "class_drawpanel.h" - #include "class_bitmap_base.h" #include "dialog_image_editor.h" diff --git a/common/drawframe.cpp b/common/drawframe.cpp index a92b9c12cc..361ae0be0b 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -183,7 +183,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event ) m_FrameIsActive = event.GetActive(); if( m_canvas ) - m_canvas->m_CanStartBlock = -1; + m_canvas->SetCanStartBlock( -1 ); event.Skip(); // required under wxMAC } @@ -192,7 +192,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event ) void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event ) { if( m_canvas ) - m_canvas->m_CanStartBlock = -1; + m_canvas->SetCanStartBlock( -1 ); event.Skip(); } @@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key ) void EDA_DRAW_FRAME::InitBlockPasteInfos() { GetScreen()->m_BlockLocate.ClearItemsList(); - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); } diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp index b7698705f0..c682d18818 100644 --- a/common/drawpanel.cpp +++ b/common/drawpanel.cpp @@ -94,19 +94,19 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, m_ClipBox.SetSize( size ); m_ClipBox.SetX( 0 ); m_ClipBox.SetY( 0 ); - m_CanStartBlock = -1; // Command block can start if >= 0 - m_AbortEnable = m_AbortRequest = false; - m_AutoPAN_Enable = true; - m_IgnoreMouseEvents = 0; + m_canStartBlock = -1; // Command block can start if >= 0 + m_abortRequest = false; + m_enableAutoPan = true; + m_ignoreMouseEvents = false; m_mouseCaptureCallback = NULL; m_endMouseCaptureCallback = NULL; if( wxGetApp().GetSettings() ) - wxGetApp().GetSettings()->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable, true ); + wxGetApp().GetSettings()->Read( wxT( "AutoPAN" ), &m_enableAutoPan, true ); - m_AutoPAN_Request = false; - m_Block_Enable = false; + m_requestAutoPan = false; + m_enableBlockCommands = false; #ifdef __WXMAC__ m_defaultCursor = m_currentCursor = wxCURSOR_CROSS; @@ -116,14 +116,14 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, m_showCrossHair = true; #endif - m_cursorLevel = 0; + m_cursorLevel = 0; m_PrintIsMirrored = false; } EDA_DRAW_PANEL::~EDA_DRAW_PANEL() { - wxGetApp().GetSettings()->Write( wxT( "AutoPAN" ), m_AutoPAN_Enable ); + wxGetApp().GetSettings()->Write( wxT( "AutoPAN" ), m_enableAutoPan ); } @@ -306,7 +306,7 @@ void EDA_DRAW_PANEL::MoveCursor( const wxPoint& aPosition ) void EDA_DRAW_PANEL::OnActivate( wxActivateEvent& event ) { - m_CanStartBlock = -1; // Block Command can't start + m_canStartBlock = -1; // Block Command can't start event.Skip(); } @@ -747,10 +747,10 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event ) GetParent()->AddMenuZoomAndGrid( &MasterMenu ); pos = event.GetPosition(); - m_IgnoreMouseEvents = true; + m_ignoreMouseEvents = true; PopupMenu( &MasterMenu, pos ); MoveCursorToCrossHair(); - m_IgnoreMouseEvents = false; + m_ignoreMouseEvents = false; return true; } @@ -759,9 +759,9 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event ) void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event ) { if( m_mouseCaptureCallback == NULL ) // No command in progress. - m_AutoPAN_Request = false; + m_requestAutoPan = false; - if( !m_AutoPAN_Enable || !m_AutoPAN_Request || m_IgnoreMouseEvents ) + if( !m_enableAutoPan || !m_requestAutoPan || m_ignoreMouseEvents ) return; // Auto pan if mouse is leave working area: @@ -781,7 +781,7 @@ void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event ) void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) { - if( m_IgnoreMouseEvents ) + if( m_ignoreMouseEvents ) return; wxRect rect = wxRect( wxPoint( 0, 0 ), GetClientSize() ); @@ -853,18 +853,18 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) /* Count the drag events. Used to filter mouse moves before starting a * block command. A block command can be started only if * MinDragEventCount > MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND - * and m_CanStartBlock >= 0 + * and m_canStartBlock >= 0 * in order to avoid spurious block commands. */ static int MinDragEventCount; if( event.Leaving() ) { - m_CanStartBlock = -1; + m_canStartBlock = -1; } if( !IsMouseCaptured() ) // No mouse capture in progress. - m_AutoPAN_Request = false; + m_requestAutoPan = false; if( GetParent()->IsActive() ) SetFocus(); @@ -882,7 +882,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) return; } - if( m_IgnoreMouseEvents ) + if( m_ignoreMouseEvents ) return; if( event.LeftIsDown() ) @@ -969,7 +969,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) if( LastPanel != this ) { MinDragEventCount = 0; - m_CanStartBlock = -1; + m_canStartBlock = -1; } /* A new command block can start after a release buttons @@ -981,7 +981,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) if( !event.LeftIsDown() && !event.MiddleIsDown() ) { MinDragEventCount = 0; - m_CanStartBlock = 0; + m_canStartBlock = 0; /* Remember the last cursor position when a drag mouse starts * this is the last position ** before ** clicking a button @@ -993,7 +993,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) m_CursorStartPos = screen->GetCrossHairPosition(); } - if( m_Block_Enable && !(localbutt & GR_M_DCLICK) ) + if( m_enableBlockCommands && !(localbutt & GR_M_DCLICK) ) { if( !screen->IsBlockActive() ) { @@ -1004,12 +1004,12 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) { if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE ) { - m_AutoPAN_Request = false; + m_requestAutoPan = false; GetParent()->HandleBlockPlace( &DC ); ignoreNextLeftButtonRelease = true; } } - else if( ( m_CanStartBlock >= 0 ) + else if( ( m_canStartBlock >= 0 ) && ( event.LeftIsDown() || event.MiddleIsDown() ) && !IsMouseCaptured() ) { @@ -1038,7 +1038,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) } else { - m_AutoPAN_Request = true; + m_requestAutoPan = true; SetCursor( wxCURSOR_SIZING ); } } @@ -1064,19 +1064,19 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) if( m_endMouseCaptureCallback ) { m_endMouseCaptureCallback( this, &DC ); - m_AutoPAN_Request = false; + m_requestAutoPan = false; } SetCursor( m_currentCursor ); } else if( screen->m_BlockLocate.m_State == STATE_BLOCK_END ) { - m_AutoPAN_Request = false; + m_requestAutoPan = false; GetParent()->HandleBlockEnd( &DC ); SetCursor( m_currentCursor ); if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE ) { - m_AutoPAN_Request = true; + m_requestAutoPan = true; SetCursor( wxCURSOR_HAND ); } } @@ -1124,7 +1124,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) break; case WXK_ESCAPE: - m_AbortRequest = true; + m_abortRequest = true; if( IsMouseCaptured() ) EndMouseCapture(); @@ -1227,7 +1227,7 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title, m_mouseCaptureCallback = NULL; m_endMouseCaptureCallback = NULL; - m_AutoPAN_Request = false; + m_requestAutoPan = false; if( id != -1 && cursor != -1 ) { @@ -1235,3 +1235,21 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title, GetParent()->SetToolID( id, cursor, title ); } } + + +void EDA_DRAW_PANEL::CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase ) +{ + wxCHECK_RET( aDC != NULL, wxT( "Invalid device context." ) ); + wxCHECK_RET( m_mouseCaptureCallback != NULL, wxT( "Mouse capture callback not set." ) ); + + m_mouseCaptureCallback( this, aDC, aPosition, aErase ); +} + + +void EDA_DRAW_PANEL::CallEndMouseCapture( wxDC* aDC ) +{ + wxCHECK_RET( aDC != NULL, wxT( "Invalid device context." ) ); + wxCHECK_RET( m_endMouseCaptureCallback != NULL, wxT( "End mouse capture callback not set." ) ); + + m_endMouseCaptureCallback( this, aDC ); +} diff --git a/common/drawtxt.cpp b/common/drawtxt.cpp index 46c34a8ef8..90991306b9 100644 --- a/common/drawtxt.cpp +++ b/common/drawtxt.cpp @@ -249,7 +249,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, int overbar_italic_comp; // Italic compensation for overbar EDA_RECT* clipBox; // Clip box used in basic draw functions - clipBox = aPanel ? &aPanel->m_ClipBox : NULL; + clipBox = aPanel ? aPanel->GetClipBox() : NULL; #define BUF_SIZE 100 wxPoint coord[BUF_SIZE + 1]; // Buffer coordinate used to draw polylines (one char shape) bool sketch_mode = false; @@ -292,10 +292,10 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, xc = current_char_pos.x; yc = current_char_pos.y; - x0 = aPanel->m_ClipBox.GetX() - ll; - y0 = aPanel->m_ClipBox.GetY() - ll; - xm = aPanel->m_ClipBox.GetRight() + ll; - ym = aPanel->m_ClipBox.GetBottom() + ll; + x0 = aPanel->GetClipBox()->GetX() - ll; + y0 = aPanel->GetClipBox()->GetY() - ll; + xm = aPanel->GetClipBox()->GetRight() + ll; + ym = aPanel->GetClipBox()->GetBottom() + ll; if( xc < x0 ) return; @@ -366,7 +366,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, aCallback( current_char_pos.x, current_char_pos.y, end.x, end.y ); } else - GRLine( &aPanel->m_ClipBox, aDC, + GRLine( aPanel->GetClipBox(), aDC, current_char_pos.x, current_char_pos.y, end.x, end.y, aWidth, aColor ); return; diff --git a/common/edaappl.cpp b/common/edaappl.cpp index df2136d9cc..f888a3f390 100644 --- a/common/edaappl.cpp +++ b/common/edaappl.cpp @@ -24,7 +24,7 @@ */ /** - * @file edaapl.cpp + * @file edaappl.cpp * * @brief For the main application: init functions, and language selection * (locale handling) diff --git a/common/worksheet.cpp b/common/worksheet.cpp index 9ea4736678..23009eff34 100644 --- a/common/worksheet.cpp +++ b/common/worksheet.cpp @@ -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( &m_canvas->m_ClipBox, DC, 0, 0, + GRRect( m_canvas->GetClipBox(), 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( &m_canvas->m_ClipBox, DC, refx * scale, refy * scale, + GRRect( m_canvas->GetClipBox(), DC, refx * scale, refy * scale, xg * scale, yg * scale, width, Color ); #else for( ii = 0; ii < 2; ii++ ) { - GRRect( &m_canvas->m_ClipBox, DC, refx * scale, refy * scale, + GRRect( m_canvas->GetClipBox(), DC, refx * scale, refy * scale, xg * scale, yg * scale, width, Color ); refx += GRID_REF_W; refy += GRID_REF_W; @@ -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( &m_canvas->m_ClipBox, DC, pos.x, pos.y, + GRLine( m_canvas->GetClipBox(), 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( &m_canvas->m_ClipBox, DC, pos.x, pos.y, + GRLine( m_canvas->GetClipBox(), DC, pos.x, pos.y, xg * scale, yg * scale, width, Color ); break; } @@ -1117,7 +1117,7 @@ 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( &m_canvas->m_ClipBox, DC, ii * scale, refy * scale, + GRLine( m_canvas->GetClipBox(), DC, ii * scale, refy * scale, ii * scale, ( refy + GRID_REF_W ) * scale, width, Color ); } DrawGraphicText( m_canvas, DC, @@ -1128,7 +1128,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid width, false, false ); if( ii < xg - PAS_REF / 2 ) { - GRLine( &m_canvas->m_ClipBox, DC, ii * scale, yg * scale, + GRLine( m_canvas->GetClipBox(), DC, ii * scale, yg * scale, ii * scale, ( yg - GRID_REF_W ) * scale, width, Color ); } DrawGraphicText( m_canvas, DC, @@ -1141,17 +1141,20 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ipas = ( yg - refy ) / PAS_REF; gypas = ( yg - refy ) / ipas; + for( ii = refy + gypas, jj = 0; ipas > 0; ii += gypas, jj++, ipas-- ) { if( jj < 26 ) Line.Printf( wxT( "%c" ), jj + 'A' ); else // I hope 52 identifiers are enought... Line.Printf( wxT( "%c" ), 'a' + jj - 26 ); + if( ii < yg - PAS_REF / 2 ) { - GRLine( &m_canvas->m_ClipBox, DC, refx * scale, ii * scale, + GRLine( m_canvas->GetClipBox(), DC, refx * scale, ii * scale, ( refx + GRID_REF_W ) * scale, ii * scale, width, Color ); } + DrawGraphicText( m_canvas, DC, wxPoint( ( refx + GRID_REF_W / 2 ) * scale, ( ii - gypas / 2 ) * scale ), @@ -1160,7 +1163,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid width, false, false ); if( ii < yg - PAS_REF / 2 ) { - GRLine( &m_canvas->m_ClipBox, DC, xg * scale, ii * scale, + GRLine( m_canvas->GetClipBox(), DC, xg * scale, ii * scale, ( xg - GRID_REF_W ) * scale, ii * scale, width, Color ); } DrawGraphicText( m_canvas, DC, @@ -1312,7 +1315,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( &m_canvas->m_ClipBox, DC, pos.x, pos.y, + GRLine( m_canvas->GetClipBox(), DC, pos.x, pos.y, xg * scale, yg * scale, width, Color ); break; } @@ -1375,7 +1378,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( &m_canvas->m_ClipBox, DC, pos.x, pos.y, + GRLine( m_canvas->GetClipBox(), DC, pos.x, pos.y, xg * scale, yg * scale, width, Color ); break; } @@ -1570,7 +1573,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( &m_canvas->m_ClipBox, DC, pos.x, pos.y, + GRLine( m_canvas->GetClipBox(), DC, pos.x, pos.y, xg * scale, yg * scale, width, Color ); break; } diff --git a/cvpcb/class_DisplayFootprintsFrame.cpp b/cvpcb/class_DisplayFootprintsFrame.cpp index 63d77aee33..66cea3c30a 100644 --- a/cvpcb/class_DisplayFootprintsFrame.cpp +++ b/cvpcb/class_DisplayFootprintsFrame.cpp @@ -415,7 +415,7 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, 0 ); + m_canvas->CallMouseCapture( aDC, aPosition, 0 ); } } diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 0b7f5f42ff..16f80961ce 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -105,7 +105,7 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos() BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; block->m_ItemsSelection.CopyList( m_blockItems.m_ItemsSelection ); - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); } @@ -139,7 +139,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector ); MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector ); @@ -149,7 +149,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_COPY: /* Copy */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector ); @@ -161,7 +161,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_PASTE: if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); PasteListOfItems( DC ); block->ClearItemsList(); @@ -206,8 +206,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) BlockState state = block->m_State; CmdBlockType command = block->m_Command; - if( m_canvas->m_endMouseCaptureCallback ) - m_canvas->m_endMouseCaptureCallback( m_canvas, DC ); + m_canvas->CallEndMouseCapture( DC ); block->m_State = state; block->m_Command = command; @@ -243,14 +242,14 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) { nextcmd = true; GetScreen()->SelectBlockItems(); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); block->m_State = STATE_BLOCK_MOVE; } else { - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); m_canvas->SetMouseCapture( NULL, NULL ); } break; @@ -352,7 +351,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_DRAG: /* move to Drag */ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); // Clear list of items to move, and rebuild it with items to drag: block->ClearItemsList(); @@ -366,7 +365,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) GetScreen()->SelectBlockItems(); if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); block->m_State = STATE_BLOCK_MOVE; } @@ -374,7 +373,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_DELETE: /* move to Delete */ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); if( block->GetCount() ) { @@ -388,7 +387,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_SAVE: /* Save list in paste buffer*/ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); if( block->GetCount() ) { @@ -399,7 +398,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) break; case BLOCK_ZOOM: /* Window Zoom */ - m_canvas->m_endMouseCaptureCallback( m_canvas, DC ); + m_canvas->CallEndMouseCapture( DC ); m_canvas->SetCursor( m_canvas->GetDefaultCursor() ); Window_Zoom( GetScreen()->m_BlockLocate ); break; @@ -407,7 +406,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_ROTATE: if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); if( block->GetCount() ) { @@ -426,7 +425,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_MIRROR_X: if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); if( block->GetCount() ) { @@ -444,7 +443,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_MIRROR_Y: if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); if( block->GetCount() ) { diff --git a/eeschema/block_libedit.cpp b/eeschema/block_libedit.cpp index 35cc237d0f..1d8b8f9c7b 100644 --- a/eeschema/block_libedit.cpp +++ b/eeschema/block_libedit.cpp @@ -92,7 +92,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) { BlockState state = GetScreen()->m_BlockLocate.m_State; CmdBlockType command = GetScreen()->m_BlockLocate.m_Command; - m_canvas->m_endMouseCaptureCallback( m_canvas, DC ); + m_canvas->CallEndMouseCapture( DC ); GetScreen()->m_BlockLocate.m_State = state; GetScreen()->m_BlockLocate.m_Command = command; m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); @@ -120,9 +120,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; @@ -132,7 +132,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ nextCmd = true; - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; break; diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 8ec0692152..02b034f9fb 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) return; } - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( 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 */ @@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) oldsegment->SetFlags( SELECTED ); newsegment->SetFlags( IS_NEW ); GetScreen()->SetCurItem( newsegment ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( 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, @@ -444,7 +444,7 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC ) } screen->RemoveFromDrawList( screen->GetCurItem() ); - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); screen->SetCurItem( NULL ); } diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 165181ba50..b06350f400 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -362,9 +362,9 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff #if 0 int len = aDc->DeviceToLogicalXRel( 3 ); - GRLine( &aPanel->m_ClipBox, aDc, aOffset.x, aOffset.y - len, aOffset.x, + GRLine( aPanel->GetClipBox(), aDc, aOffset.x, aOffset.y - len, aOffset.x, aOffset.y + len, 0, aColor ); - GRLine( &aPanel->m_ClipBox, aDc, aOffset.x - len, aOffset.y, aOffset.x + len, + GRLine( aPanel->GetClipBox(), aDc, aOffset.x - len, aOffset.y, aOffset.x + len, aOffset.y, 0, aColor ); #endif @@ -372,7 +372,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff * the bounding box calculations. */ #if 0 EDA_RECT bBox = GetBoundingBox( aMulti, aConvert ); - GRRect( &aPanel->m_ClipBox, aDc, bBox.GetOrigin().x, bBox.GetOrigin().y, + GRRect( aPanel->GetClipBox(), aDc, bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index e1e77748b0..0fddf914a1 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -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 && m_canvas->m_AbortRequest ) + if( !item && m_canvas->GetAbortRequest() ) { - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); return NULL; } @@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC if( !item ) { - m_canvas->m_AbortRequest = false; // Just in case the user aborted the context menu. + m_canvas->SetAbortRequest( false ); // Just in case the user aborted the context menu. return NULL; } @@ -171,7 +171,7 @@ 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 ); - m_canvas->m_AbortRequest = true; // Changed to false if an item is selected + m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected PopupMenu( &selectMenu ); m_canvas->MoveCursorToCrossHair(); item = GetScreen()->GetCurItem(); @@ -247,16 +247,18 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH if( m_canvas->IsMouseCaptured() ) { #ifdef USE_WX_OVERLAY - wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC ); + wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC ); oDC.Clear(); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false ); + m_canvas->CallMouseCapture( aDC, aPosition, false ); #else - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); + m_canvas->CallMouseCapture( aDC, aPosition, true ); #endif } #ifdef USE_WX_OVERLAY else - m_canvas->m_overlay.Reset(); + { + m_overlay.Reset(); + } #endif } @@ -330,16 +332,18 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH if( m_canvas->IsMouseCaptured() ) { #ifdef USE_WX_OVERLAY - wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC ); + wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC ); oDC.Clear(); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false ); + m_canvas->CallMouseCapture( aDC, aPosition, false ); #else - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); + m_canvas->CallMouseCapture( aDC, aPosition, true ); #endif } #ifdef USE_WX_OVERLAY else - m_canvas->m_overlay.Reset(); + { + m_overlay.Reset(); + } #endif } @@ -409,7 +413,7 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); + m_canvas->CallMouseCapture( aDC, aPosition, true ); } } diff --git a/eeschema/dialogs/dialog_SVG_print.cpp b/eeschema/dialogs/dialog_SVG_print.cpp index d1d3def2d6..85739100cc 100644 --- a/eeschema/dialogs/dialog_SVG_print.cpp +++ b/eeschema/dialogs/dialog_SVG_print.cpp @@ -220,15 +220,13 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, float dpi = (float) frame->GetInternalUnits(); wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi ); - EDA_RECT tmp = panel->m_ClipBox; + EDA_RECT tmp = *panel->GetClipBox(); GRResetPenAndBrush( &dc ); GRForceBlackPen( aPrintBlackAndWhite ); - panel->m_ClipBox.SetX( -0x3FFFFF0 ); - panel->m_ClipBox.SetY( -0x3FFFFF0 ); - panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); - panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); + panel->SetClipBox( EDA_RECT( wxPoint( -0x3FFFFF0, -0x3FFFFF0 ), + wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) ); screen->m_IsPrinting = true; screen->Draw( panel, &dc, GR_COPY ); @@ -238,7 +236,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, SetLocaleTo_Default(); // revert to the current locale screen->m_IsPrinting = false; - panel->m_ClipBox = tmp; + panel->SetClipBox( tmp ); GRForceBlackPen( false ); diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index f1da61fd4a..ba310c121d 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -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!" ) ); - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this ); @@ -55,7 +55,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize(); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); dlg->Destroy(); } diff --git a/eeschema/dialogs/dialog_print_using_printer.cpp b/eeschema/dialogs/dialog_print_using_printer.cpp index 181d8bf89d..d77fe74f07 100644 --- a/eeschema/dialogs/dialog_print_using_printer.cpp +++ b/eeschema/dialogs/dialog_print_using_printer.cpp @@ -324,11 +324,10 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) tmp_startvisu = aScreen->m_StartVisu; oldZoom = aScreen->GetZoom(); old_org = aScreen->m_DrawOrg; - oldClipBox = panel->m_ClipBox; + oldClipBox = *panel->GetClipBox(); /* Change scale factor, offsets, and clip box to print the whole page. */ - panel->m_ClipBox.SetOrigin( wxPoint( 0, 0 ) ); - panel->m_ClipBox.SetSize( wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ); + panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) ); bool printReference = parent->GetPrintSheetReference(); @@ -378,7 +377,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) g_DrawBgColor = bg_color; aScreen->m_IsPrinting = false; - panel->m_ClipBox = oldClipBox; + panel->SetClipBox( oldClipBox ); GRForceBlackPen( false ); diff --git a/eeschema/edit_component_in_schematic.cpp b/eeschema/edit_component_in_schematic.cpp index 04f3c6c3fc..77d99bad0d 100644 --- a/eeschema/edit_component_in_schematic.cpp +++ b/eeschema/edit_component_in_schematic.cpp @@ -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; - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); wxString title; title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) ); @@ -83,7 +83,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() int response = dlg.ShowModal(); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); newtext = dlg.GetValue( ); newtext.Trim( true ); newtext.Trim( false ); diff --git a/eeschema/eeredraw.cpp b/eeschema/eeredraw.cpp index 6de40ff459..c4c4fb7001 100644 --- a/eeschema/eeredraw.cpp +++ b/eeschema/eeredraw.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2009-2011 Wayne Stambaugh + * Copyright (C) 2004-2011 KiCad Developers, see change_log.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 eeredraw.cpp */ @@ -29,7 +54,7 @@ void DrawDanglingSymbol( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& pos, in if( !screen->m_IsPrinting ) /* Draw but do not print the Dangling Symbol */ { - GRRect( &panel->m_ClipBox, DC, + GRRect( panel->GetClipBox(), DC, pos.x - DANGLING_SYMBOL_SIZE, pos.y - DANGLING_SYMBOL_SIZE, pos.x + DANGLING_SYMBOL_SIZE, pos.y + DANGLING_SYMBOL_SIZE, 0, Color ); @@ -54,7 +79,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness ); if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, FALSE ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, FALSE ); m_canvas->DrawCrossHair( DC ); diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index bbc57da4b0..f05963100f 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowHiddenPins( m_showAllPins ); - dlg.SetEnableAutoPan( m_canvas->m_AutoPAN_Enable ); + dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() ); 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(); - m_canvas->m_AutoPAN_Enable = dlg.GetEnableAutoPan(); + m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() ); g_HVLines = dlg.GetEnableHVBusOrientation(); g_ShowPageLimits = dlg.GetShowPageLimits(); diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index f347c983c7..a8c362d8cf 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, static wxString lastCommponentName; m_itemToRepeat = NULL; - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); if( !libname.IsEmpty() ) { @@ -122,7 +122,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, if ( dlg.ShowModal() == wxID_CANCEL ) { - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); return NULL; } @@ -140,7 +140,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, if( Name.IsEmpty() ) { - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); return NULL; } @@ -157,7 +157,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, if( Name.IsEmpty() ) { - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); return NULL; } @@ -168,7 +168,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, if( GetNameOfPartToLoad( this, Library, Name ) == 0 ) { - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); return NULL; } @@ -180,7 +180,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, if( Name.IsEmpty() ) { - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); return NULL; } @@ -200,13 +200,13 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, if( Entry == NULL ) { - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); return NULL; } } - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); if( Entry == NULL ) diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 20a98cbb09..579a88e96a 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -280,7 +280,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() // update the References m_CurrentSheet->UpdateAllScreenReferences(); SetSheetNumberAndCount(); - m_canvas->m_CanStartBlock = -1; + m_canvas->SetCanStartBlock( -1 ); if( screen->m_FirstRedraw ) { diff --git a/eeschema/lib_arc.cpp b/eeschema/lib_arc.cpp index 3d71b8ed0f..5c0c16b055 100644 --- a/eeschema/lib_arc.cpp +++ b/eeschema/lib_arc.cpp @@ -416,21 +416,27 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf fill = NO_FILL; if( fill == FILLED_WITH_BG_BODYCOLOR ) - GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, + { + GRFilledArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius, GetPenSize( ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); + } else if( fill == FILLED_SHAPE && !aData ) - GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, m_Radius, color, color ); + { + GRFilledArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius, + color, color ); + } else { #ifdef DRAW_ARC_WITH_ANGLE - GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, m_Radius, GetPenSize(), color ); + GRArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius, + GetPenSize(), color ); #else - GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, + GRArc1( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, posc.x, posc.y, GetPenSize(), color ); #endif } @@ -439,7 +445,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf * calculation. */ #if 0 EDA_RECT bBox = GetBoundingBox(); - GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, + GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/lib_bezier.cpp b/eeschema/lib_bezier.cpp index 2c3888ad66..330aa0bc93 100644 --- a/eeschema/lib_bezier.cpp +++ b/eeschema/lib_bezier.cpp @@ -332,15 +332,15 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& GRSetDrawMode( aDC, aDrawMode ); if( fill == FILLED_WITH_BG_BODYCOLOR ) - GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), + GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), &PolyPointsTraslated[0], 1, GetPenSize(), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( fill == FILLED_SHAPE ) - GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), + GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), &PolyPointsTraslated[0], 1, GetPenSize(), color, color ); else - GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), + GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), &PolyPointsTraslated[0], 0, GetPenSize(), color, color ); /* Set to one (1) to draw bounding box around bezier curve to validate @@ -348,7 +348,7 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& #if 0 EDA_RECT bBox = GetBoundingBox(); bBox.Inflate( m_Thickness + 1, m_Thickness + 1 ); - GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, + GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp index bd8a78e0c3..391583655b 100644 --- a/eeschema/lib_circle.cpp +++ b/eeschema/lib_circle.cpp @@ -244,19 +244,19 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& fill = NO_FILL; if( fill == FILLED_WITH_BG_BODYCOLOR ) - GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), + GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( fill == FILLED_SHAPE ) - GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, m_Radius, 0, color, color ); + GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, 0, color, color ); else - GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color ); + GRCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color ); /* Set to one (1) to draw bounding box around circle to validate bounding * box calculation. */ #if 0 EDA_RECT bBox = GetBoundingBox(); - GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, + GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/lib_draw_item.cpp b/eeschema/lib_draw_item.cpp index 801fc7fe59..32293af452 100644 --- a/eeschema/lib_draw_item.cpp +++ b/eeschema/lib_draw_item.cpp @@ -140,7 +140,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, if( m_eraseLastDrawItem ) { GRSetDrawMode( aDC, g_XorMode ); - drawEditGraphics( &aPanel->m_ClipBox, aDC, color ); + drawEditGraphics( aPanel->GetClipBox(), aDC, color ); drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform ); } @@ -148,7 +148,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, calcEdit( aOffset ); // Draw the items using the new attributes. - drawEditGraphics( &aPanel->m_ClipBox, aDC, color ); + drawEditGraphics( aPanel->GetClipBox(), aDC, color ); drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform ); m_Fill = fillMode; diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index d41188faa4..b5cad9f212 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -325,7 +325,7 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); grBox.Move( aOffset ); - GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA ); + GRRect( aPanel->GetClipBox(), aDC, grBox, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index cd2ea8cc53..ffc9c7aadb 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -853,7 +853,7 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel, /* Set to one (1) to draw bounding box around pin to validate bounding * box calculation. */ #if 0 - EDA_RECT* clipbox = aPanel ? &aPanel->m_ClipBox : NULL; + EDA_RECT* clipbox = aPanel ? aPanel->GetClipBox() : NULL; TRANSFORM transform = DefaultTransform; DefaultTransform = aTransform; EDA_RECT bBox = GetBoundingBox(); @@ -876,7 +876,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, int color; int width = GetPenSize(); int posX = aPinPos.x, posY = aPinPos.y, len = m_length; - EDA_RECT* clipbox = aPanel ? &aPanel->m_ClipBox : NULL; + EDA_RECT* clipbox = aPanel ? aPanel->GetClipBox() : NULL; color = ReturnLayerColor( LAYER_PIN ); diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp index acb2290908..40fcd1b88f 100644 --- a/eeschema/lib_polyline.cpp +++ b/eeschema/lib_polyline.cpp @@ -305,14 +305,14 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint GRSetDrawMode( aDC, aDrawMode ); if( fill == FILLED_WITH_BG_BODYCOLOR ) - GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), + GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( fill == FILLED_SHAPE ) - GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), + GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), color, color ); else - GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(), + GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(), color, color ); delete[] buffer; @@ -322,7 +322,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint #if 0 EDA_RECT bBox = GetBoundingBox(); bBox.Inflate( m_Thickness + 1, m_Thickness + 1 ); - GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, + GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/lib_rectangle.cpp b/eeschema/lib_rectangle.cpp index 765a115fb7..438552324e 100644 --- a/eeschema/lib_rectangle.cpp +++ b/eeschema/lib_rectangle.cpp @@ -233,21 +233,21 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GRSetDrawMode( aDC, aDrawMode ); if( fill == FILLED_WITH_BG_BODYCOLOR && !aData ) - GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ), + GRFilledRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); else if( m_Fill == FILLED_SHAPE && !aData ) - GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, + GRFilledRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color, color ); else - GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color ); + GRRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color ); /* Set to one (1) to draw bounding box around rectangle to validate * bounding box calculation. */ #if 0 EDA_RECT bBox = GetBoundingBox(); bBox.Inflate( m_Thickness + 1, m_Thickness + 1 ); - GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, + GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 4e6e4d9a06..391d472033 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -403,7 +403,7 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); grBox.Move( aOffset ); - GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA ); + GRRect( aPanel->GetClipBox(), aDC, grBox, 0, LIGHTMAGENTA ); #endif } diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index d73356e0d7..38909883a5 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -252,7 +252,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) } if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); m_canvas->DrawCrossHair( DC ); diff --git a/eeschema/libedit_onleftclick.cpp b/eeschema/libedit_onleftclick.cpp index 2c94e78a22..fee4a66616 100644 --- a/eeschema/libedit_onleftclick.cpp +++ b/eeschema/libedit_onleftclick.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2010 Wayne Stambaugh + * 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 libedit_onleftclick.cpp * @brief Eeschema library editor event handler for a mouse left button single or double click. @@ -27,13 +52,16 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition ) item = LocateItemUsingCursor( aPosition ); if( item ) + + { item->DisplayInfo( this ); + } else { DisplayCmpDoc(); - if( m_canvas->m_AbortRequest ) - m_canvas->m_AbortRequest = false; + if( m_canvas->GetAbortRequest() ) + m_canvas->SetAbortRequest( false ); } } @@ -135,7 +163,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition ) else return; - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); switch( m_drawItem->Type() ) { @@ -188,5 +216,5 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition ) } m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); } diff --git a/eeschema/libedit_onrightclick.cpp b/eeschema/libedit_onrightclick.cpp index a4931a42c4..241cecd42b 100644 --- a/eeschema/libedit_onrightclick.cpp +++ b/eeschema/libedit_onrightclick.cpp @@ -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 && m_canvas->m_AbortRequest ) + if( item == NULL && m_canvas->GetAbortRequest() ) { - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); return false; } diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index 0e23437c26..12afe1036c 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -224,7 +224,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); if( m_canvas ) - m_canvas->m_Block_Enable = true; + m_canvas->SetEnableBlockCommands( true ); EnsureActiveLibExists(); ReCreateMenuBar(); @@ -616,7 +616,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) int id = event.GetId(); wxPoint pos; - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); wxGetMousePosition( &pos.x, &pos.y ); pos.y += 20; @@ -788,55 +788,55 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) break; case ID_POPUP_ZOOM_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM; HandleBlockEnd( &dc ); break; case ID_POPUP_DELETE_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE; m_canvas->MoveCursorToCrossHair(); HandleBlockEnd( &dc ); break; case ID_POPUP_COPY_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY; m_canvas->MoveCursorToCrossHair(); HandleBlockPlace( &dc ); break; case ID_POPUP_SELECT_ITEMS_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_SELECT_ITEMS_ONLY; m_canvas->MoveCursorToCrossHair(); HandleBlockEnd( &dc ); break; case ID_POPUP_MIRROR_Y_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_Y; m_canvas->MoveCursorToCrossHair(); HandleBlockPlace( &dc ); break; case ID_POPUP_MIRROR_X_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_X; m_canvas->MoveCursorToCrossHair(); HandleBlockPlace( &dc ); break; case ID_POPUP_ROTATE_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->m_BlockLocate.m_Command = BLOCK_ROTATE; m_canvas->MoveCursorToCrossHair(); HandleBlockPlace( &dc ); break; case ID_POPUP_PLACE_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); m_canvas->MoveCursorToCrossHair(); HandleBlockPlace( &dc ); break; @@ -846,7 +846,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) break; } - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); if( GetToolId() == ID_NO_TOOL_SELECTED ) m_lastDrawItem = NULL; @@ -1072,7 +1072,7 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) break; } - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); } @@ -1160,7 +1160,7 @@ 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; - m_canvas->m_AbortRequest = true; // Changed to false if an item is selected + m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected PopupMenu( &selectMenu ); m_canvas->MoveCursorToCrossHair(); item = m_drawItem; @@ -1212,7 +1212,7 @@ void LIB_EDIT_FRAME::deleteItem( wxDC* aDC ) { if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_endMouseCaptureCallback( m_canvas, aDC ); + m_canvas->CallEndMouseCapture( aDC ); } else { @@ -1237,7 +1237,7 @@ void LIB_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent ) && (index >= 0 && index < m_collectedItems.GetCount()) ) { LIB_ITEM* item = m_collectedItems[index]; - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); m_drawItem = item; } } diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index 6c16457224..d6618e046c 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -57,7 +57,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) ) { - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); m_itemToRepeat = NULL; if( item && item->GetFlags() ) @@ -129,12 +129,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { m_itemToRepeat = AddNoConnect( aDC, gridPosition ); GetScreen()->SetCurItem( m_itemToRepeat ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } GetScreen()->TestDanglingEnds(); @@ -146,12 +146,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { m_itemToRepeat = AddJunction( aDC, gridPosition, true ); GetScreen()->SetCurItem( m_itemToRepeat ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } GetScreen()->TestDanglingEnds(); @@ -165,7 +165,7 @@ 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 ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { @@ -173,7 +173,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) GetScreen()->SetCurItem( NULL ); GetScreen()->TestDanglingEnds(); m_canvas->Refresh( true ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } break; @@ -183,29 +183,29 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) case ID_WIRE_BUTT: BeginSegment( aDC, LAYER_WIRE ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); break; case ID_BUS_BUTT: BeginSegment( aDC, LAYER_BUS ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); break; case ID_LINE_COMMENT_BUTT: BeginSegment( aDC, LAYER_NOTES ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); break; case ID_TEXT_COMMENT_BUTT: if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) { GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( 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 ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } break; @@ -226,12 +226,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) { GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->TestDanglingEnds(); m_canvas->Refresh( true ); } @@ -247,12 +247,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( GetToolId() == ID_HIERLABEL_BUTT ) GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->TestDanglingEnds(); m_canvas->Refresh( true ); } @@ -262,12 +262,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) { GetScreen()->SetCurItem( CreateSheet( aDC ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->TestDanglingEnds(); m_canvas->Refresh( true ); } @@ -300,12 +300,12 @@ 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 ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->TestDanglingEnds(); m_canvas->Refresh( true ); } @@ -316,12 +316,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ), s_PowerNameList, false ) ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { item->Place( this, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); GetScreen()->TestDanglingEnds(); m_canvas->Refresh( true ); } diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index fd10526209..270897f7c8 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -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. - m_canvas->m_CanStartBlock = -1; + m_canvas->SetCanStartBlock( -1 ); if( BlockActive ) { @@ -91,15 +91,15 @@ 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 && m_canvas->m_AbortRequest ) + if( item == NULL && m_canvas->GetAbortRequest() ) { - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); return false; } } // If Command in progress: add "cancel" and "end tool" menu - if( GetToolId() != ID_NO_TOOL_SELECTED ) + if( GetToolId() != ID_NO_TOOL_SELECTED ) { if( item && item->GetFlags() ) { diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 9cf7ec365a..719b39bdda 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC ) if( ask_for_pin && SynchronizePins() ) { - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); status = IsOK( this, _( "This position is already occupied by \ another pin. Continue?" ) ); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); if( !status ) return; @@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC ) pin->SetUnit( LastPinCommonUnit ? 0 : m_unit ); pin->SetVisible( LastPinVisible ); PinPreviousPos = pin->GetPosition(); - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); cmd.SetId( ID_LIBEDIT_EDIT_PIN ); GetEventHandler()->ProcessEvent( cmd ); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); if( pin->GetFlags() & IS_CANCELLED ) { diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index a3ef919b93..2007bde7f7 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -190,7 +190,7 @@ void SCH_BITMAP::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset wxSize size = m_Image->GetSize(); pos.x -= size.x / 2; pos.y -= size.y / 2; - GRRect( &aPanel->m_ClipBox, aDC, pos.x, pos.y, + GRRect( aPanel->GetClipBox(), aDC, pos.x, pos.y, pos.x + size.x, pos.y + size.y, 0, aColor ); } } diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 1d676d8d48..63db57e180 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -199,7 +199,7 @@ void SCH_BUS_ENTRY::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOff GRSetDrawMode( aDC, aDrawMode ); - GRLine( &aPanel->m_ClipBox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, + GRLine( aPanel->GetClipBox(), aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, m_End().x + aOffset.x, m_End().y + aOffset.y, GetPenSize(), color ); } diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index d6f935c7a2..d812bcec20 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -334,18 +334,18 @@ void SCH_COMPONENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset { EDA_RECT BoundaryBox; BoundaryBox = GetBoundingBox(); - GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); #if 1 if( GetField( REFERENCE )->IsVisible() ) { BoundaryBox = GetField( REFERENCE )->GetBoundingBox(); - GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); } if( GetField( VALUE )->IsVisible() ) { BoundaryBox = GetField( VALUE )->GetBoundingBox(); - GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); } #endif } diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 2d1d245108..c4a8dd0671 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -201,7 +201,7 @@ void SCH_FIELD::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, #if 0 // Draw boundary box: - GRRect( &panel->m_ClipBox, DC, boundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, boundaryBox, 0, BROWN ); // Draw the text anchor point @@ -211,9 +211,9 @@ void SCH_FIELD::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, textpos = parentComponent->GetScreenCoord( textpos ); textpos += parentComponent->GetPosition(); const int len = 10; - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, textpos.x - len, textpos.y, textpos.x + len, textpos.y, 0, BLUE ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, textpos.x, textpos.y - len, textpos.x, textpos.y + len, 0, BLUE ); #endif } diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp index e39c97bc63..8c2f1f0fa6 100644 --- a/eeschema/sch_junction.cpp +++ b/eeschema/sch_junction.cpp @@ -134,7 +134,7 @@ void SCH_JUNCTION::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs GRSetDrawMode( aDC, aDrawMode ); - GRFilledCircle( &aPanel->m_ClipBox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, + GRFilledCircle( aPanel->GetClipBox(), aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, ( m_size.x / 2 ), 0, color, color ); } diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 5638f74788..a495e2c2f9 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -240,13 +240,14 @@ void SCH_LINE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset, if( ( m_Flags & STARTPOINT ) == 0 ) start += offset; + if( ( m_Flags & ENDPOINT ) == 0 ) end += offset; if( m_Layer == LAYER_NOTES ) - GRDashedLine( &panel->m_ClipBox, DC, start.x, start.y, end.x, end.y, width, color ); + GRDashedLine( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y, width, color ); else - GRLine( &panel->m_ClipBox, DC, start, end, width, color ); + GRLine( panel->GetClipBox(), DC, start, end, width, color ); if( m_startIsDangling ) DrawDanglingSymbol( panel, DC, start, color ); diff --git a/eeschema/sch_no_connect.cpp b/eeschema/sch_no_connect.cpp index edc7204512..3b24b32c96 100644 --- a/eeschema/sch_no_connect.cpp +++ b/eeschema/sch_no_connect.cpp @@ -148,8 +148,10 @@ void SCH_NO_CONNECT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf GRSetDrawMode( aDC, aDrawMode ); - GRLine( &aPanel->m_ClipBox, aDC, pX - delta, pY - delta, pX + delta, pY + delta, width, color ); - GRLine( &aPanel->m_ClipBox, aDC, pX + delta, pY - delta, pX - delta, pY + delta, width, color ); + GRLine( aPanel->GetClipBox(), aDC, pX - delta, pY - delta, pX + delta, pY + delta, + width, color ); + GRLine( aPanel->GetClipBox(), aDC, pX + delta, pY - delta, pX - delta, pY + delta, + width, color ); } diff --git a/eeschema/sch_polyline.cpp b/eeschema/sch_polyline.cpp index 7e131b1f68..9d7e129690 100644 --- a/eeschema/sch_polyline.cpp +++ b/eeschema/sch_polyline.cpp @@ -187,13 +187,13 @@ void SCH_POLYLINE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs if( m_Layer == LAYER_NOTES ) { for( unsigned i = 1; i < GetCornerCount(); i++ ) - GRDashedLineTo( &aPanel->m_ClipBox, aDC, m_points[i].x + aOffset.x, + GRDashedLineTo( aPanel->GetClipBox(), aDC, m_points[i].x + aOffset.x, m_points[i].y + aOffset.y, width, color ); } else { for( unsigned i = 1; i < GetCornerCount(); i++ ) - GRLineTo( &aPanel->m_ClipBox, aDC, m_points[i].x + aOffset.x, + GRLineTo( aPanel->GetClipBox(), aDC, m_points[i].x + aOffset.x, m_points[i].y + aOffset.y, width, color ); } } diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 069779328e..b32289f946 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -608,7 +608,7 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aC // uncomment line below when there is a virtual // EDA_ITEM::GetBoundingBox() - // if( panel->m_ClipBox.Intersects( Structs->GetBoundingBox() + // if( panel->GetClipBox().Intersects( Structs->GetBoundingBox() // ) ) item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), aDrawMode, aColor ); } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 91169bd542..4ead3f3bf7 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -608,7 +608,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GRSetDrawMode( aDC, aDrawMode ); - GRRect( &aPanel->m_ClipBox, aDC, pos.x, pos.y, + GRRect( aPanel->GetClipBox(), aDC, pos.x, pos.y, pos.x + m_size.x, pos.y + m_size.y, lineWidth, color ); pos_sheetname = GetSheetNamePosition() + aOffset; diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 1e45f9a6b3..2f3efa46b2 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -397,7 +397,7 @@ void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset, #if 0 { EDA_RECT BoundaryBox = GetBoundingBox(); - GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); } #endif } @@ -1225,7 +1225,7 @@ void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel, EXCHG( linewidth, m_Thickness ); // set initial value CreateGraphicShape( Poly, m_Pos + aOffset ); - GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color ); + GRPoly( panel->GetClipBox(), DC, Poly.size(), &Poly[0], 0, linewidth, color, color ); if( m_isDangling ) DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color ); @@ -1234,7 +1234,7 @@ void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel, #if 0 { EDA_RECT BoundaryBox = GetBoundingBox(); - GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); } #endif } @@ -1562,7 +1562,7 @@ void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel, EXCHG( linewidth, m_Thickness ); // set initial value CreateGraphicShape( Poly, m_Pos + offset ); - GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color ); + GRPoly( panel->GetClipBox(), DC, Poly.size(), &Poly[0], 0, linewidth, color, color ); if( m_isDangling ) DrawDanglingSymbol( panel, DC, m_Pos + offset, color ); @@ -1571,7 +1571,7 @@ void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel, #if 0 { EDA_RECT BoundaryBox = GetBoundingBox(); - GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN ); + GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); } #endif } diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 551277b269..647c420241 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -291,7 +291,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) break; case ID_POPUP_PLACE_BLOCK: - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); m_canvas->MoveCursorToCrossHair(); HandleBlockPlace( &dc ); break; diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index a343686c78..c9a1447711 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -225,7 +225,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father, SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); if( m_canvas ) - m_canvas->m_Block_Enable = true; + m_canvas->SetEnableBlockCommands( true ); ReCreateMenuBar(); ReCreateHToolbar(); @@ -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->GetCanvas()->m_IgnoreMouseEvents = true; + this->GetCanvas()->SetIgnoreMouseEvents( true ); if( m_dlgFindReplace ) { @@ -704,7 +704,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event ) m_dlgFindReplace = NULL; } - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); } @@ -890,7 +890,7 @@ void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent ) && (index >= 0 && index < m_collectedItems.GetCount()) ) { SCH_ITEM* item = m_collectedItems[index]; - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); GetScreen()->SetCurItem( item ); } } diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index f82c5bfceb..eff1d5703e 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -164,7 +164,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) } aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode ); - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); if( isUndoable ) SaveCopyInUndoList( aSheet, UR_CHANGED ); @@ -204,7 +204,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) ); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); OnModify(); @@ -321,7 +321,7 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC ) // a sheet to a screen that already has multiple instances (!) GetScreen()->SetCurItem( sheet ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false ); m_canvas->CrossHairOff( aDC ); GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() ); m_canvas->MoveCursorToCrossHair(); @@ -349,7 +349,7 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC ) aSheet->SetFlags( IS_RESIZED ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true ); + m_canvas->CallMouseCapture( aDC, wxDefaultPosition, true ); if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo SetUndoItem( aSheet ); @@ -370,6 +370,6 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC ) aSheet->SetFlags( IS_MOVED ); m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet ); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true ); + m_canvas->CallMouseCapture( aDC, wxDefaultPosition, true ); m_canvas->CrossHairOn( aDC ); } diff --git a/eeschema/symbdraw.cpp b/eeschema/symbdraw.cpp index e6a53f0492..ea197c27c0 100644 --- a/eeschema/symbdraw.cpp +++ b/eeschema/symbdraw.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2009-2011 Wayne Stambaugh + * Copyright (C) 2004-2011 KiCad Developers, see change_log.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 symbdraw.cpp * @brief Create, move .. graphic shapes used to build and draw a component (lines, arcs ..) @@ -155,9 +180,9 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) Text->m_Orient = m_textOrientation; // Enter the graphic text info - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); EditSymbolText( NULL, Text ); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->MoveCursorToCrossHair(); if( Text->m_Text.IsEmpty() ) @@ -188,7 +213,7 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) m_drawItem->SetConvert( m_convert ); // Draw initial symbol: - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } else { @@ -197,7 +222,7 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ) } m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = FALSE; + m_canvas->SetIgnoreMouseEvents( false ); return m_drawItem; } @@ -263,7 +288,7 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC ) TempCopyComponent(); m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) ); m_canvas->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, true ); } @@ -276,7 +301,7 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC ) TempCopyComponent(); m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) ); m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, true ); } diff --git a/eeschema/symbedit.cpp b/eeschema/symbedit.cpp index 832dcd4c15..8acbf85a51 100644 --- a/eeschema/symbedit.cpp +++ b/eeschema/symbedit.cpp @@ -57,7 +57,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol() if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) ) return; - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath(); @@ -70,7 +70,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol() GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) ); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = FALSE; + m_canvas->SetIgnoreMouseEvents( false ); wxFileName fn = dlg.GetPath(); wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); diff --git a/gerbview/block.cpp b/gerbview/block.cpp index 0c5375cf54..22f026f93e 100644 --- a/gerbview/block.cpp +++ b/gerbview/block.cpp @@ -85,7 +85,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC ) { case BLOCK_MOVE: /* Move */ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); Block_Move( DC ); GetScreen()->m_BlockLocate.ClearItemsList(); @@ -93,7 +93,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_COPY: /* Copy */ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); Block_Duplicate( DC ); GetScreen()->m_BlockLocate.ClearItemsList(); @@ -139,14 +139,14 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC ) case BLOCK_COPY: /* Copy */ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; nextcmd = true; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); break; case BLOCK_DELETE: /* Delete */ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); Block_Delete( DC ); break; @@ -257,7 +257,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC ) wxPoint oldpos; oldpos = GetScreen()->GetCrossHairPosition(); - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); GetScreen()->SetCrossHairPosition( oldpos ); m_canvas->MoveCursorToCrossHair(); @@ -286,7 +286,7 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC ) wxPoint oldpos; oldpos = GetScreen()->GetCrossHairPosition(); - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); GetScreen()->SetCrossHairPosition( oldpos ); m_canvas->MoveCursorToCrossHair(); diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp index 5cc92c8793..044deda9de 100644 --- a/gerbview/class_gerber_draw_item.cpp +++ b/gerbview/class_gerber_draw_item.cpp @@ -364,7 +364,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, if( !isDark ) isFilled = true; - DrawGbrPoly( &aPanel->m_ClipBox, aDC, color, aOffset, isFilled ); + DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled ); break; case GBR_CIRCLE: @@ -376,14 +376,14 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, if( !isFilled ) { // draw the border of the pen's path using two circles, each as narrow as possible - GRCircle( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), radius - halfPenWidth, 0, color ); - GRCircle( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), radius + halfPenWidth, 0, color ); } else // Filled mode { - GRCircle( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), radius, m_Size.x, color ); } break; @@ -393,21 +393,21 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, // a round pen only is expected. #if 0 // for arc debug only - GRLine( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), GetABPosition( m_ArcCentre ), 0, color ); - GRLine( &aPanel->m_ClipBox, aDC, GetABPosition( m_End ), + GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_End ), GetABPosition( m_ArcCentre ), 0, color ); #endif if( !isFilled ) { - GRArc1( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), GetABPosition( m_End ), GetABPosition( m_ArcCentre ), 0, color ); } else { - GRArc1( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), GetABPosition( m_End ), GetABPosition( m_ArcCentre ), m_Size.x, color ); } @@ -420,7 +420,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, case GBR_SPOT_POLY: case GBR_SPOT_MACRO: isFilled = DisplayOpt.DisplayPadFill ? true : false; - d_codeDescr->DrawFlashedShape( this, &aPanel->m_ClipBox, aDC, color, alt_color, + d_codeDescr->DrawFlashedShape( this, aPanel->GetClipBox(), aDC, color, alt_color, m_Start, isFilled ); break; @@ -435,18 +435,18 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, if( m_PolyCorners.size() == 0 ) ConvertSegmentToPolygon( ); - DrawGbrPoly( &aPanel->m_ClipBox, aDC, color, aOffset, isFilled ); + DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled ); } else { if( !isFilled ) { - GRCSegm( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRCSegm( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), GetABPosition( m_End ), m_Size.x, color ); } else { - GRFilledSegment( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), + GRFilledSegment( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ), GetABPosition( m_End ), m_Size.x, color ); } } diff --git a/gerbview/controle.cpp b/gerbview/controle.cpp index a0f66c734a..e003f1d0b9 100644 --- a/gerbview/controle.cpp +++ b/gerbview/controle.cpp @@ -1,6 +1,30 @@ -/****************/ -/* controle.cpp */ -/****************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2010 + * Copyright (C) 1992-2010 KiCad Developers, see change_log.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 gerbview/controle.cpp + */ #include "fctsys.h" #include "common.h" @@ -61,7 +85,7 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); + m_canvas->CallMouseCapture( aDC, aPosition, true ); } } diff --git a/gerbview/draw_gerber_screen.cpp b/gerbview/draw_gerber_screen.cpp index eb87c3fabf..e7f2ce8ed3 100644 --- a/gerbview/draw_gerber_screen.cpp +++ b/gerbview/draw_gerber_screen.cpp @@ -56,11 +56,11 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer, DisplayOpt.DisplayZonesMode = 0; g_DisplayPolygonsModeSketch = 0; - m_canvas->m_PrintIsMirrored = aPrintMirrorMode; + m_canvas->SetPrintMirrored( aPrintMirrorMode ); GetBoard()->Draw( m_canvas, aDC, -1, wxPoint( 0, 0 ) ); - m_canvas->m_PrintIsMirrored = false; + m_canvas->SetPrintMirrored( false ); // Restore draw options: GetBoard()->SetVisibleLayers( visiblemask ); @@ -109,7 +109,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) TraceWorkSheet( DC, screen, 0 ); if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); m_canvas->DrawCrossHair( DC ); @@ -158,7 +158,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin // these parameters are saved here, because they are modified // and restored later - EDA_RECT drawBox = aPanel->m_ClipBox; + EDA_RECT drawBox = *aPanel->GetClipBox(); double scale; aDC->GetUserScale(&scale, &scale); wxPoint dev_org = aDC->GetDeviceOrigin(); @@ -171,7 +171,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin screenBitmap = new wxBitmap( bitmapWidth, bitmapHeight ); layerDC.SelectObject( *layerBitmap ); aPanel->DoPrepareDC( layerDC ); - aPanel->m_ClipBox = drawBox; + aPanel->SetClipBox( drawBox ); layerDC.SetBackground( bgBrush ); layerDC.SetBackgroundMode( wxSOLID ); layerDC.Clear(); diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 1fcf1a6b59..8ffedf7b4f 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -184,7 +184,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PLACE_BLOCK: GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE; - m_canvas->m_AutoPAN_Request = FALSE; + m_canvas->SetAutoPanRequest( false ); HandleBlockPlace( &dc ); break; diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 956bd56b6c..3c45a42c86 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -76,7 +76,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father, m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 ); if( m_canvas ) - m_canvas->m_Block_Enable = true; + m_canvas->SetEnableBlockCommands( true ); // Give an icon wxIcon icon; diff --git a/gerbview/onrightclick.cpp b/gerbview/onrightclick.cpp index a262709c43..4e46ba7b51 100644 --- a/gerbview/onrightclick.cpp +++ b/gerbview/onrightclick.cpp @@ -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. - m_canvas->m_CanStartBlock = -1; + m_canvas->SetCanStartBlock( -1 ); // Simple location of elements where possible. if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) ) diff --git a/include/class_drawpanel.h b/include/class_drawpanel.h index ac6b14dd9a..536e8e845f 100644 --- a/include/class_drawpanel.h +++ b/include/class_drawpanel.h @@ -63,37 +63,34 @@ private: 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) - bool m_AbortRequest; // Flag to abort long commands - bool m_AbortEnable; // true if abort button or menu to be displayed + /// The drawing area used to redraw the screen which is usually the visible area + /// of the drawing in internal units. + EDA_RECT m_ClipBox; - bool m_AutoPAN_Enable; // true to allow auto pan - bool m_AutoPAN_Request; // true to request an auto pan (will be made only if - // m_AutoPAN_Enable = true) - int m_IgnoreMouseEvents; // when non-zero (true), then ignore mouse events - bool m_Block_Enable; // true to accept Block Commands + bool m_abortRequest; ///< Flag used to abort long commands. + + bool m_enableAutoPan; ///< True to enable automatic panning. + + /// true to request an auto pan. Valid only when m_enableAutoPan = true. + bool m_requestAutoPan; + + bool m_ignoreMouseEvents; ///< Ignore mouse events when true. + + bool m_enableBlockCommands; ///< True enables block commands. + + /// True when drawing in mirror mode. Used by the draw arc function, because arcs + /// are oriented, and in mirror mode, orientations are reversed. + bool m_PrintIsMirrored; + + /// Mouse capture move callback function. + MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback; + + /// Abort mouse capture callback function. + END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback; // useful to avoid false start block in certain cases // (like switch from a sheet to an other sheet - int m_CanStartBlock; // >= 0 (or >= n) if a block can start - bool m_PrintIsMirrored; // True when drawing in mirror mode. Used in draw arc function, - // because arcs are oriented, and in mirror mode, orientations - // are reversed - -#ifdef USE_WX_OVERLAY - // MAC Uses overlay to workaround the wxINVERT and wxXOR miss - wxOverlay m_overlay; -#endif - - /* Cursor management (used in editing functions) */ - - /* Mouse capture move callback function. */ - MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback; - - /* Abort mouse capture callback function. */ - END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback; + int m_canStartBlock; // >= 0 (or >= n) if a block can start public: @@ -106,6 +103,29 @@ public: void OnPaint( wxPaintEvent& event ); + EDA_RECT* GetClipBox() { return &m_ClipBox; } + + void SetClipBox( const EDA_RECT& aRect ) { m_ClipBox = aRect; } + + bool GetAbortRequest() const { return m_abortRequest; } + + void SetAbortRequest( bool aAbortRequest ) { m_abortRequest = aAbortRequest; } + + bool GetEnableAutoPan() const { return m_enableAutoPan; } + + void SetEnableAutoPan( bool aEnable ) { m_enableAutoPan = aEnable; } + + void SetAutoPanRequest( bool aEnable ) { m_requestAutoPan = aEnable; } + + void SetIgnoreMouseEvents( bool aIgnore ) { m_ignoreMouseEvents = aIgnore; } + + void SetEnableBlockCommands( bool aEnable ) { m_enableBlockCommands = aEnable; } + + bool GetPrintMirrored() const { return m_PrintIsMirrored; } + + void SetPrintMirrored( bool aMirror ) { m_PrintIsMirrored = aMirror; } + + void SetCanStartBlock( int aStartBlock ) { m_canStartBlock = aStartBlock; } /** * Function DrawBackGround @@ -151,7 +171,7 @@ public: * Function OnActivate * handles window activation events. *

- * The member m_CanStartBlock is initialize to avoid a block start command on activation + * The member m_canStartBlock is initialize to avoid a block start command on activation * (because a left mouse button can be pressed and no block command wanted. This happens * when enter on a hierarchy sheet on double click. *

@@ -310,6 +330,13 @@ public: m_endMouseCaptureCallback = aEndMouseCaptureCallback; } + + void SetMouseCaptureCallback( MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback ) + { + m_mouseCaptureCallback = aMouseCaptureCallback; + } + + /** * Function EndMouseCapture * ends mouse a capture. @@ -328,6 +355,26 @@ public: inline bool IsMouseCaptured() const { return m_mouseCaptureCallback != NULL; } + /** + * Function CallMouseCapture + * calls the mouse capture callback. + * + * @param aDC A point to a wxDC object to perform any drawing upon. + * @param aPosition A referecnce to a wxPoint object containing the current cursor + * position. + * @param aErase True indicates the item being drawn should be erase before drawing + * it a \a aPosition. + */ + void CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase ); + + /** + * Function CallEndMouseCapture + * calls the end mouse capture callback. + * + * @param aDC A point to a wxDC object to perform any drawing upon. + */ + void CallEndMouseCapture( wxDC* aDC ); + /** * Function SetCurrentCursor * Set the current cursor shape for drawpanel diff --git a/include/common.h b/include/common.h index b6a0651ce6..de164adec5 100644 --- a/include/common.h +++ b/include/common.h @@ -37,9 +37,6 @@ #include "wx/fileconf.h" class wxAboutDialogInfo; -class BASE_SCREEN; -class EDA_DRAW_FRAME; -class EDA_DRAW_PANEL; /* Flag for special keys */ #define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right diff --git a/include/dialog_helpers.h b/include/dialog_helpers.h index 2c025bcba2..ff98234161 100644 --- a/include/dialog_helpers.h +++ b/include/dialog_helpers.h @@ -11,6 +11,10 @@ #include "common.h" // EDA_UNITS_T +class EDA_DRAW_FRAME; + + + /** * class EDA_LIST_DIALOG * diff --git a/include/wxstruct.h b/include/wxstruct.h index da40d8ad1c..dd574775d3 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -363,9 +363,13 @@ public: */ class EDA_DRAW_FRAME : public EDA_BASE_FRAME { +private: ///< Id of active button on the vertical toolbar. int m_toolId; + BASE_SCREEN* m_currentScreen; ///< current used SCREEN + bool m_snapToGrid; ///< Indicates if cursor should be snapped to grid. + protected: EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList; int m_LastGridSizeId; @@ -419,14 +423,15 @@ protected: /// Panel used to display information at the bottom of the main window. EDA_MSG_PANEL* m_messagePanel; +#ifdef USE_WX_OVERLAY + // MAC Uses overlay to workaround the wxINVERT and wxXOR miss + wxOverlay m_overlay; +#endif + /// Let the #EDA_DRAW_PANEL object have access to the protected data since /// it is closely tied to the #EDA_DRAW_FRAME. friend class EDA_DRAW_PANEL; -private: - BASE_SCREEN* m_currentScreen; ///< current used SCREEN - bool m_snapToGrid; ///< Indicates if cursor should be snapped to grid. - protected: void SetScreen( BASE_SCREEN* aScreen ) { diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp index 94349b4045..5d13966ffc 100644 --- a/pcbnew/automove.cpp +++ b/pcbnew/automove.cpp @@ -95,7 +95,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) case ID_POPUP_CANCEL_CURRENT_COMMAND: if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_endMouseCaptureCallback( m_canvas, &dc ); + m_canvas->CallEndMouseCapture( &dc ); } break; diff --git a/pcbnew/autoplac.cpp b/pcbnew/autoplac.cpp index c97c6706fe..694df6989e 100644 --- a/pcbnew/autoplac.cpp +++ b/pcbnew/autoplac.cpp @@ -117,8 +117,7 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ) if( GetBoard()->m_Modules == NULL ) return; - m_canvas->m_AbortRequest = false; - m_canvas->m_AbortEnable = true; + m_canvas->SetAbortRequest( false ); switch( place_mode ) { @@ -391,7 +390,6 @@ end_of_tst: GetBoard()->m_Status_Pcb = 0; Compile_Ratsnest( DC, true ); m_canvas->ReDraw( DC, true ); - m_canvas->m_AbortEnable = false; } @@ -431,7 +429,7 @@ void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC ) color = DARKGRAY; } - GRPutPixel( &m_canvas->m_ClipBox, DC, ox, oy, color ); + GRPutPixel( m_canvas->GetClipBox(), DC, ox, oy, color ); } } } @@ -690,12 +688,12 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) { wxYield(); - if( m_canvas->m_AbortRequest ) + if( m_canvas->GetAbortRequest() ) { if( IsOK( this, _( "Ok to abort?" ) ) ) return ESC; else - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); } cx = aModule->m_Pos.x; cy = aModule->m_Pos.y; @@ -956,7 +954,7 @@ float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC ) if( AutoPlaceShowAll ) { - GRLine( &m_canvas->m_ClipBox, DC, ox, oy, fx, fy, 0, color ); + GRLine( m_canvas->GetClipBox(), DC, ox, oy, fx, fy, 0, color ); } /* Cost of the ratsnest. */ diff --git a/pcbnew/autorout.cpp b/pcbnew/autorout.cpp index 7b02d43065..730d561c5a 100644 --- a/pcbnew/autorout.cpp +++ b/pcbnew/autorout.cpp @@ -253,7 +253,7 @@ void DisplayBoard( EDA_DRAW_PANEL* panel, wxDC* DC ) { for( i = 0; i < maxi; i++ ) for( j = 0; j < maxi; j++ ) - GRPutPixel( &panel->m_ClipBox, DC, + GRPutPixel( panel->GetClipBox(), DC, ( col * maxi ) + i + DRAW_OFFSET_X, ( row * maxi ) + j + DRAW_OFFSET_Y, color ); diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 943ac7e06a..581b9c8266 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -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]; - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); #if 0 && defined (DEBUG) item->Show( 0, std::cout ); diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index 9b97410b5d..1a6925e869 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -121,7 +121,7 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title { wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition(); - parent->GetCanvas()->m_IgnoreMouseEvents = true; + parent->GetCanvas()->SetIgnoreMouseEvents( true ); DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title ); int cmd = dlg->ShowModal(); @@ -129,7 +129,7 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title parent->GetScreen()->SetCrossHairPosition( oldpos ); parent->GetCanvas()->MoveCursorToCrossHair(); - parent->GetCanvas()->m_IgnoreMouseEvents = false; + parent->GetCanvas()->SetIgnoreMouseEvents( false ); return cmd == wxID_OK; } @@ -235,7 +235,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_MOVE: /* Move */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); Block_Move(); GetScreen()->m_BlockLocate.ClearItemsList(); @@ -243,7 +243,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_COPY: /* Copy */ if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); Block_Duplicate(); GetScreen()->m_BlockLocate.ClearItemsList(); @@ -293,7 +293,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) cancelCmd = true; // undraw block outline - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } else { @@ -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; - m_canvas->m_mouseCaptureCallback = drawMovingBlock; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->SetMouseCaptureCallback( drawMovingBlock ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); break; case BLOCK_DELETE: /* Delete */ - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; Block_Delete(); break; case BLOCK_ROTATE: /* Rotation */ - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; Block_Rotate(); break; case BLOCK_FLIP: /* Flip */ - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( 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 - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); Window_Zoom( GetScreen()->m_BlockLocate ); break; diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp index e3de67fd99..6343f9dde9 100644 --- a/pcbnew/block_module_editor.cpp +++ b/pcbnew/block_module_editor.cpp @@ -122,7 +122,7 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) { BlockState state = GetScreen()->m_BlockLocate.m_State; CmdBlockType command = GetScreen()->m_BlockLocate.m_Command; - m_canvas->m_endMouseCaptureCallback( m_canvas, DC ); + m_canvas->CallEndMouseCapture( DC ); GetScreen()->m_BlockLocate.m_State = state; GetScreen()->m_BlockLocate.m_Command = command; m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); @@ -148,9 +148,9 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) if( m_canvas->IsMouseCaptured() ) { - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; @@ -160,7 +160,7 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ nextcmd = true; - m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; + m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; break; diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index 06547a6021..02c58bcc15 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -355,55 +355,55 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxP width = 0; case FILLED: - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_crossBarOx - ox, m_crossBarOy - oy, m_crossBarFx - ox, m_crossBarFy - oy, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_featureLineGOx - ox, m_featureLineGOy - oy, m_featureLineGFx - ox, m_featureLineGFy - oy, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_featureLineDOx - ox, m_featureLineDOy - oy, m_featureLineDFx - ox, m_featureLineDFy - oy, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_arrowD1Ox - ox, m_arrowD1Oy - oy, m_arrowD1Fx - ox, m_arrowD1Fy - oy, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_arrowD2Ox - ox, m_arrowD2Oy - oy, m_arrowD2Fx - ox, m_arrowD2Fy - oy, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_arrowG1Ox - ox, m_arrowG1Oy - oy, m_arrowG1Fx - ox, m_arrowG1Fy - oy, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_arrowG2Ox - ox, m_arrowG2Oy - oy, m_arrowG2Fx - ox, m_arrowG2Fy - oy, width, gcolor ); break; case SKETCH: - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_crossBarOx - ox, m_crossBarOy - oy, m_crossBarFx - ox, m_crossBarFy - oy, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_featureLineGOx - ox, m_featureLineGOy - oy, m_featureLineGFx - ox, m_featureLineGFy - oy, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_featureLineDOx - ox, m_featureLineDOy - oy, m_featureLineDFx - ox, m_featureLineDFy - oy, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_arrowD1Ox - ox, m_arrowD1Oy - oy, m_arrowD1Fx - ox, m_arrowD1Fy - oy, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_arrowD2Ox - ox, m_arrowD2Oy - oy, m_arrowD2Fx - ox, m_arrowD2Fy - oy, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_arrowG1Ox - ox, m_arrowG1Oy - oy, m_arrowG1Fx - ox, m_arrowG1Fy - oy, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, m_arrowG2Ox - ox, m_arrowG2Oy - oy, m_arrowG2Fx - ox, m_arrowG2Fy - oy, width, gcolor ); diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 7f81a4e665..3babf3f511 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -196,16 +196,16 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx if( mode == FILAIRE ) { - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, color ); } else if( mode == SKETCH ) { - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius - l_trace, color ); - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius + l_trace, color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius - l_trace, color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius + l_trace, color ); } else { - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, m_Width, color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, m_Width, color ); } break; @@ -216,7 +216,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx StAngle = (int) ArcTangente( dy - uy0, dx - ux0 ); EndAngle = StAngle + m_Angle; - if( !panel->m_PrintIsMirrored ) + if( !panel->GetPrintMirrored() ) { if( StAngle > EndAngle ) EXCHG( StAngle, EndAngle ); @@ -229,19 +229,19 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx if( mode == FILAIRE ) - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, color ); else if( mode == SKETCH ) { - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius - l_trace, color ); - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius + l_trace, color ); } else { - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color ); } break; @@ -250,20 +250,20 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx for (unsigned int i=1; i < m_BezierPoints.size(); i++) { if( mode == FILAIRE ) - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_BezierPoints[i].x, m_BezierPoints[i].y, m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, 0, color ); else if( mode == SKETCH ) { - GRCSegm( &panel->m_ClipBox, DC, - m_BezierPoints[i].x, m_BezierPoints[i].y, - m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, + GRCSegm( panel->GetClipBox(), DC, + m_BezierPoints[i].x, m_BezierPoints[i].y, + m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, m_Width, color ); } else { - GRFillCSegm( &panel->m_ClipBox, DC, + GRFillCSegm( panel->GetClipBox(), DC, m_BezierPoints[i].x, m_BezierPoints[i].y, m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, m_Width, color ); @@ -273,17 +273,15 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx default: if( mode == FILAIRE ) { - GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, 0, color ); + GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, 0, color ); } else if( mode == SKETCH ) { - GRCSegm( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, - m_Width, color ); + GRCSegm( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color ); } else { - GRFillCSegm( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, - m_Width, color ); + GRFillCSegm( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color ); } break; diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index b930dc0bcc..6f586bc84f 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -125,12 +125,12 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx { case S_SEGMENT: if( typeaff == FILAIRE ) - GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, 0, color ); + GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, 0, color ); else if( typeaff == FILLED ) - GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, m_Width, color ); + GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color ); else // SKETCH Mode - GRCSegm( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, m_Width, color ); + GRCSegm( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color ); break; @@ -139,18 +139,18 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx if( typeaff == FILAIRE ) { - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, color ); } else { if( typeaff == FILLED ) { - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, m_Width, color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, m_Width, color ); } else // SKETCH Mode { - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius + (m_Width / 2), color ); - GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius - (m_Width / 2), color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius + (m_Width / 2), color ); + GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius - (m_Width / 2), color ); } } @@ -166,17 +166,17 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx if( typeaff == FILAIRE ) { - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, radius, color ); + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, color ); } else if( typeaff == FILLED ) { - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color ); + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color ); } else // SKETCH Mode { - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius + (m_Width / 2), color ); - GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius - (m_Width / 2), color ); } break; @@ -196,7 +196,7 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx pt += module->m_Pos - offset; } - GRPoly( &panel->m_ClipBox, DC, points.size(), &points[0], true, m_Width, color, color ); + GRPoly( panel->GetClipBox(), DC, points.size(), &points[0], true, m_Width, color, color ); break; } } diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp index ff109f4f25..3fd1525a32 100644 --- a/pcbnew/class_mire.cpp +++ b/pcbnew/class_mire.cpp @@ -98,12 +98,12 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx width = 0; case FILLED: - GRCircle( &panel->m_ClipBox, DC, ox, oy, radius, width, gcolor ); + GRCircle( panel->GetClipBox(), DC, ox, oy, radius, width, gcolor ); break; case SKETCH: - GRCircle( &panel->m_ClipBox, DC, ox, oy, radius + (width / 2), gcolor ); - GRCircle( &panel->m_ClipBox, DC, ox, oy, radius - (width / 2), gcolor ); + GRCircle( panel->GetClipBox(), DC, ox, oy, radius + (width / 2), gcolor ); + GRCircle( panel->GetClipBox(), DC, ox, oy, radius - (width / 2), gcolor ); break; } @@ -125,13 +125,13 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx { case FILAIRE: case FILLED: - GRLine( &panel->m_ClipBox, DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); - GRLine( &panel->m_ClipBox, DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); + GRLine( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); + GRLine( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); break; case SKETCH: - GRCSegm( &panel->m_ClipBox, DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); - GRCSegm( &panel->m_ClipBox, DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); + GRCSegm( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); + GRCSegm( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); break; } } diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 39301a9213..fbf8df60b1 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -99,11 +99,11 @@ void MODULE::DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset, if( GetBoard()->IsElementVisible( ANCHOR_VISIBLE ) ) { int color = g_ColorsSettings.GetItemColor( ANCHOR_VISIBLE ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_Pos.x - offset.x - anchor_size, m_Pos.y - offset.y, m_Pos.x - offset.x + anchor_size, m_Pos.y - offset.y, 0, color ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, m_Pos.x - offset.x, m_Pos.y - offset.y - anchor_size, m_Pos.x - offset.x, m_Pos.y - offset.y + anchor_size, 0, color ); @@ -261,7 +261,7 @@ void MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoi // Enable these line to draw m_BoundaryBox (debug tests purposes only) #if 0 - GRRect( &aPanel->m_ClipBox, aDC, m_BoundaryBox, 0, BROWN ); + GRRect( aPanel->GetClipBox(), aDC, m_BoundaryBox, 0, BROWN ); #endif } diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp index 38bdbcaadb..c2057cd80b 100644 --- a/pcbnew/class_netinfo_item.cpp +++ b/pcbnew/class_netinfo_item.cpp @@ -172,6 +172,6 @@ void RATSNEST_ITEM::Draw( EDA_DRAW_PANEL* panel, int color = g_ColorsSettings.GetItemColor(RATSNEST_VISIBLE); - GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos - aOffset, + GRLine( panel->GetClipBox(), DC, m_PadStart->m_Pos - aOffset, m_PadEnd->m_Pos - aOffset, 0, color ); } diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index d28ae08bb4..d830a8cebb 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -376,7 +376,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi if( !IsOnLayer( screen->m_Active_Layer ) && DisplayOpt.ContrastModeDisplay ) drawInfo.m_Display_netname = false; - DrawShape( &aPanel->m_ClipBox, aDC, drawInfo ); + DrawShape( aPanel->GetClipBox(), aDC, drawInfo ); } diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 07a4abdf04..36deed2eb5 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -253,10 +253,10 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w int anchor_size = DC->DeviceToLogicalXRel( 2 ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, pos.x - anchor_size, pos.y, pos.x + anchor_size, pos.y, 0, color ); - GRLine( &panel->m_ClipBox, DC, + GRLine( panel->GetClipBox(), DC, pos.x, pos.y - anchor_size, pos.x, pos.y + anchor_size, 0, color ); } @@ -300,11 +300,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel, const wxPoint& aOffset ) { MODULE* parent = (MODULE*) GetParent(); + if( !parent ) return; GRSetDrawMode( aDC, GR_XOR ); - GRLine( &aPanel->m_ClipBox, aDC, + GRLine( aPanel->GetClipBox(), aDC, parent->GetPosition(), GetPosition() + aOffset, 0, UMBILICAL_COLOR); } diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 4a1990f02c..f410eb94a4 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -648,7 +648,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& if( DC->LogicalToDeviceXRel( l_trace ) < MIN_DRAW_WIDTH ) { - GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, radius, color ); } else @@ -656,19 +656,19 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& if( DC->LogicalToDeviceXRel( l_trace ) <= 1 ) /* Sketch mode if l_trace/zoom <= 1 */ { - GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, radius, color ); } else if( ( !DisplayOpt.DisplayPcbTrackFill) || GetState( FORCE_SKETCH ) ) { - GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, radius - l_trace, color ); - GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, radius + l_trace, color ); } else { - GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, radius, m_Width, color ); } } @@ -678,17 +678,17 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& if( DC->LogicalToDeviceXRel( l_trace ) < MIN_DRAW_WIDTH ) { - GRLine( &panel->m_ClipBox, DC, m_Start + aOffset, m_End + aOffset, 0, color ); + GRLine( panel->GetClipBox(), DC, m_Start + aOffset, m_End + aOffset, 0, color ); return; } if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) ) { - GRCSegm( &panel->m_ClipBox, DC, m_Start + aOffset, m_End + aOffset, m_Width, color ); + GRCSegm( panel->GetClipBox(), DC, m_Start + aOffset, m_End + aOffset, m_Width, color ); } else { - GRFillCSegm( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRFillCSegm( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, m_End.x + aOffset.x, m_End.y + aOffset.y, m_Width, color ); } @@ -699,7 +699,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& // Show clearance for tracks, not for zone segments if( ShowClearance( this ) ) { - GRCSegm( &panel->m_ClipBox, DC, m_Start + aOffset, m_End + aOffset, + GRCSegm( panel->GetClipBox(), DC, m_Start + aOffset, m_End + aOffset, m_Width + (GetClearance() * 2), color ); } @@ -831,14 +831,16 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint if( fillvia ) { - GRFilledCircle( &panel->m_ClipBox, DC, m_Start + aOffset, radius, color ); + GRFilledCircle( panel->GetClipBox(), DC, m_Start + aOffset, radius, color ); } else { - GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset,radius, 0, color ); + GRCircle( panel->GetClipBox(), DC, m_Start + aOffset,radius, 0, color ); + if ( fast_draw ) return; - GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset, inner_radius, 0, color ); + + GRCircle( panel->GetClipBox(), DC, m_Start + aOffset, inner_radius, 0, color ); } // Draw the via hole if the display option allows it @@ -869,7 +871,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint GRSetDrawMode( DC, GR_XOR ); if( DC->LogicalToDeviceXRel( drill_radius ) > 1 ) // Draw hole if large enough. - GRFilledCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x, + GRFilledCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, drill_radius, 0, color, color ); if( screen->m_IsPrinting ) @@ -878,13 +880,13 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint else { if( drill_radius < inner_radius ) // We can show the via hole - GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset, drill_radius, 0, color ); + GRCircle( panel->GetClipBox(), DC, m_Start + aOffset, drill_radius, 0, color ); } } } if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS ) - GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset, radius + GetClearance(), 0, color ); + GRCircle( panel->GetClipBox(), DC, m_Start + aOffset, radius + GetClearance(), 0, color ); // for Micro Vias, draw a partial cross : X on component layer, or + on copper layer // (so we can see 2 superimposed microvias ): @@ -904,21 +906,21 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint } /* lines | or \ */ - GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - ax, + GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - ax, m_Start.y + aOffset.y - ay, m_Start.x + aOffset.x - bx, m_Start.y + aOffset.y - by, 0, color ); - GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x + bx, + GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x + bx, m_Start.y + aOffset.y + by, m_Start.x + aOffset.x + ax, m_Start.y + aOffset.y + ay, 0, color ); /* lines - or / */ - GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x + ay, + GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x + ay, m_Start.y + aOffset.y - ax, m_Start.x + aOffset.x + by, m_Start.y + aOffset.y - bx, 0, color ); - GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - by, + GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - by, m_Start.y + aOffset.y + bx, m_Start.x + aOffset.x - ay, m_Start.y + aOffset.y + ax, 0, color ); @@ -936,7 +938,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint /* lines for the top layer */ RotatePoint( &ax, &ay, layer_top * 3600 / brd->GetCopperLayerCount( ) ); RotatePoint( &bx, &by, layer_top * 3600 / brd->GetCopperLayerCount( ) ); - GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - ax, + GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - ax, m_Start.y + aOffset.y - ay, m_Start.x + aOffset.x - bx, m_Start.y + aOffset.y - by, 0, color ); @@ -945,7 +947,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint ax = 0; ay = radius; bx = 0; by = drill_radius; RotatePoint( &ax, &ay, layer_bottom * 3600 / brd->GetCopperLayerCount( ) ); RotatePoint( &bx, &by, layer_bottom * 3600 / brd->GetCopperLayerCount( ) ); - GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - ax, + GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - ax, m_Start.y + aOffset.y - ay, m_Start.x + aOffset.x - bx, m_Start.y + aOffset.y - by, 0, color ); diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h index eef20010ac..5b76ef6990 100644 --- a/pcbnew/class_track.h +++ b/pcbnew/class_track.h @@ -198,8 +198,8 @@ public: double aCorrectionFactor ); /** * Function SetDrillValue - * Set the drill value for vias - * @param drill_value = new drill value + * sets the drill value for vias. + * @param aDrill = new drill value */ void SetDrill( int aDrill ) { m_Drill = aDrill; } diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index bd31196f2c..31243a78f9 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -179,7 +179,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const lines.push_back( seg_end ); } - GRLineArray( &panel->m_ClipBox, DC, lines, 0, color ); + GRLineArray( panel->GetClipBox(), DC, lines, 0, color ); // draw hatches lines.clear(); @@ -195,7 +195,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const lines.push_back( seg_end ); } - GRLineArray( &panel->m_ClipBox, DC, lines, 0, color ); + GRLineArray( panel->GetClipBox(), DC, lines, 0, color ); } @@ -290,11 +290,11 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, if( CornersTypeBuffer[ie] == 0 ) // Draw only basic outlines, not extra segments { if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) ) - GRCSegm( &panel->m_ClipBox, DC, + GRCSegm( panel->GetClipBox(), DC, x0, y0, x1, y1, m_ZoneMinThickness, color ); else - GRFillCSegm( &panel->m_ClipBox, DC, + GRFillCSegm( panel->GetClipBox(), DC, x0, y0, x1, y1, m_ZoneMinThickness, color ); } @@ -303,7 +303,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, // Draw areas: if( m_FillMode==0 && !outline_mode ) - GRPoly( &panel->m_ClipBox, DC, CornersBuffer.size(), &CornersBuffer[0], + GRPoly( panel->GetClipBox(), DC, CornersBuffer.size(), &CornersBuffer[0], true, 0, color, color ); } @@ -320,10 +320,10 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, wxPoint end = m_FillSegmList[ic].m_End + offset; if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) ) - GRCSegm( &panel->m_ClipBox, DC, start.x, start.y, end.x, end.y, + GRCSegm( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y, m_ZoneMinThickness, color ); else - GRFillCSegm( &panel->m_ClipBox, DC, start.x, start.y, end.x, end.y, + GRFillCSegm( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y, m_ZoneMinThickness, color ); } } @@ -415,9 +415,9 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, in GRSetDrawMode( DC, current_gr_mode ); if( is_close_segment ) - GRLine( &panel->m_ClipBox, DC, xi, yi, xf, yf, 0, WHITE ); + GRLine( panel->GetClipBox(), DC, xi, yi, xf, yf, 0, WHITE ); else - GRLine( &panel->m_ClipBox, DC, xi, yi, xf, yf, 0, color ); + GRLine( panel->GetClipBox(), DC, xi, yi, xf, yf, 0, color ); } } diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index 94d3362277..940bfc100d 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -207,7 +207,7 @@ static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* aFrame ) if( aFrame->GetBoard()->m_Track == NULL ) return; - aFrame->GetCanvas()->m_AbortRequest = false; + aFrame->GetCanvas()->SetAbortRequest( 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->GetCanvas()->m_AbortRequest ) + if( aFrame->GetCanvas()->GetAbortRequest() ) break; if( segment->GetNet() != oldnetcode ) @@ -412,7 +412,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame ) int flag, no_inc; wxString msg; - aFrame->GetCanvas()->m_AbortRequest = false; + aFrame->GetCanvas()->SetAbortRequest( 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->GetCanvas()->m_AbortRequest ) + if( aFrame->GetCanvas()->GetAbortRequest() ) 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->GetCanvas()->m_AbortRequest = false; + aFrame->GetCanvas()->SetAbortRequest( false ); for( segment = aFrame->GetBoard()->m_Track; segment; segment = segment->Next() ) { D_PAD* pad; - if( aFrame->GetCanvas()->m_AbortRequest ) + if( aFrame->GetCanvas()->GetAbortRequest() ) return; pad = aFrame->GetBoard()->GetPad( segment, START ); diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index a161e12e49..041482351b 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -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. - * m_canvas->m_IgnoreMouseEvents = true; + * m_canvas->SetIgnoreMouseEvents( true ); */ // this menu's handler is void PCB_BASE_FRAME::ProcessItemSelection() // and it calls SetCurItem() which in turn calls DisplayInfo() on the item. - m_canvas->m_AbortRequest = true; // changed in false if an item is selected + m_canvas->SetAbortRequest( true ); // changed in false if an item is selected PopupMenu( &itemMenu ); m_canvas->MoveCursorToCrossHair(); // The function ProcessItemSelection() has set the current item, return it. - if( m_canvas->m_AbortRequest ) // Nothing selected + if( m_canvas->GetAbortRequest() ) // Nothing selected item = NULL; else item = GetCurItem(); @@ -352,17 +352,17 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH if( m_canvas->IsMouseCaptured() ) { #ifdef USE_WX_OVERLAY - wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC ); + wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC ); oDC.Clear(); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false ); + m_canvas->CallMouseCapture( aDC, aPosition, false ); #else - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); + m_canvas->CallMouseCapture( aDC, aPosition, true ); #endif } #ifdef USE_WX_OVERLAY else { - m_canvas->m_overlay.Reset(); + m_overlay.Reset(); } #endif } diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index f0e65c4330..50524adaf1 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -111,7 +111,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) else { if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); return g_CurrentTrackSegment; } diff --git a/pcbnew/dialogs/dialog_SVG_print.cpp b/pcbnew/dialogs/dialog_SVG_print.cpp index 05254a9f40..67e3beca14 100644 --- a/pcbnew/dialogs/dialog_SVG_print.cpp +++ b/pcbnew/dialogs/dialog_SVG_print.cpp @@ -251,19 +251,16 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, // to print floating point numbers like 1.3) wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi ); - EDA_RECT tmp = panel->m_ClipBox; + EDA_RECT tmp = *panel->GetClipBox(); GRResetPenAndBrush( &dc ); GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? false : true ); s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE; - panel->m_ClipBox.SetX( 0 ); - panel->m_ClipBox.SetY( 0 ); // Set clip box to the max size #define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer // and that allows calculations without overflow - panel->m_ClipBox.SetWidth( MAX_VALUE ); - panel->m_ClipBox.SetHeight( MAX_VALUE ); + panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) ); screen->m_IsPrinting = true; @@ -277,7 +274,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, g_DrawBgColor = bg_color; SetLocaleTo_Default(); // revert to the current locale screen->m_IsPrinting = false; - panel->m_ClipBox = tmp; + panel->SetClipBox( tmp ); GRForceBlackPen( false ); diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp index 359dd23b16..46255339db 100644 --- a/pcbnew/dialogs/dialog_edit_module_text.cpp +++ b/pcbnew/dialogs/dialog_edit_module_text.cpp @@ -48,10 +48,10 @@ private: void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC ) { - m_canvas->m_IgnoreMouseEvents = TRUE; + m_canvas->SetIgnoreMouseEvents( true ); DialogEditModuleText dialog( this, TextMod, DC ); dialog.ShowModal(); - m_canvas->m_IgnoreMouseEvents = FALSE; + m_canvas->SetIgnoreMouseEvents( false ); } diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp index 4be3c567cd..3ec86912b8 100644 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ b/pcbnew/dialogs/dialog_general_options.cpp @@ -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()->GetCanvas()->m_AutoPAN_Enable ); + m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() ); m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only ); m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild ); @@ -133,9 +133,8 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) 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()->GetCanvas()->m_AutoPAN_Enable = m_AutoPANOpt->GetValue(); + GetParent()->GetCanvas()->SetEnableAutoPan( m_AutoPANOpt->GetValue() ); g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue(); - g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection(); g_MagneticTrackOption = m_MagneticTrackOptCtrl->GetSelection(); diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index 34f5d9994b..b6d806e52a 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -71,12 +71,11 @@ void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxD return; } - m_canvas->m_IgnoreMouseEvents = TRUE; - DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this, - aItem, aDC ); + m_canvas->SetIgnoreMouseEvents( true ); + DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this, aItem, aDC ); dialog->ShowModal(); dialog->Destroy(); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = FALSE; + m_canvas->SetIgnoreMouseEvents( false ); } /**************************************************************************/ diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index e11caf3e62..52d97f6031 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -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 ) { - m_canvas->m_IgnoreMouseEvents = TRUE; + m_canvas->SetIgnoreMouseEvents( true ); DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC ); dlg.ShowModal(); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = FALSE; + m_canvas->SetIgnoreMouseEvents( false ); } diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index a2097da7d6..3fe508dd5f 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -388,7 +388,7 @@ void PCB_EDIT_FRAME::BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC ) m_canvas->SetMouseCapture( MoveDimensionText, AbortMoveDimensionText ); SetCurItem( aItem ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } diff --git a/pcbnew/edgemod.cpp b/pcbnew/edgemod.cpp index 0d65e350a3..3e5b8c7618 100644 --- a/pcbnew/edgemod.cpp +++ b/pcbnew/edgemod.cpp @@ -1,9 +1,31 @@ -/*******************************/ -/* Footprint outlines editing. */ -/*******************************/ +/* + * 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 + * 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 + */ /** - * Functions to edit graphic items used to draw footprint edges. + * @file edgemod.cpp: + * @brief Functions to edit graphic items used to draw footprint edges. * * @todo - Arc functions not compete but menus are ready to use. */ @@ -45,7 +67,7 @@ void FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC ) CursorInitialPosition = GetScreen()->GetCrossHairPosition(); m_canvas->SetMouseCapture( ShowCurrentOutlineWhileMoving, Abort_Move_ModuleOutline ); SetCurItem( Edge ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index f50e8e9a0e..86587d380a 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -165,7 +165,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) default: // Finish (abort) the command if( m_canvas->IsMouseCaptured() ) - m_canvas->m_endMouseCaptureCallback( m_canvas, &dc ); + m_canvas->CallEndMouseCapture( &dc ); if( GetToolId() != id ) { @@ -213,14 +213,14 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PLACE_BLOCK: GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE; - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); HandleBlockPlace( &dc ); break; case ID_POPUP_COPY_BLOCK: GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY; GetScreen()->m_BlockLocate.SetMessageBlock( this ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); HandleBlockPlace( &dc ); break; @@ -332,13 +332,13 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) * switch from _/ to -\ . * If a track is in progress, it will be redrawn */ - if( m_canvas->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor ) - ShowNewTrackWhenMovingCursor( m_canvas, &dc, wxDefaultPosition, false ); + if( m_canvas->IsMouseCaptured() ) + m_canvas->CallMouseCapture( &dc, wxDefaultPosition, false ); g_Alternate_Track_Posture = !g_Alternate_Track_Posture; - if( m_canvas->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor ) - ShowNewTrackWhenMovingCursor( m_canvas, &dc, wxDefaultPosition, false ); + if( m_canvas->IsMouseCaptured() ) + m_canvas->CallMouseCapture( &dc, wxDefaultPosition, false ); break; @@ -445,13 +445,13 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE: m_canvas->MoveCursorToCrossHair(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Add_Similar_Zone( &dc, (ZONE_CONTAINER*) GetCurItem() ); break; case ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE: m_canvas->MoveCursorToCrossHair(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Add_Zone_Cutout( &dc, (ZONE_CONTAINER*) GetCurItem() ); break; @@ -476,7 +476,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) { m_canvas->MoveCursorToCrossHair(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, false ); break; } @@ -485,7 +485,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) { m_canvas->MoveCursorToCrossHair(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Start_Move_Zone_Drag_Outline_Edge( &dc, zone_cont, zone_cont->m_CornerSelection ); break; } @@ -494,7 +494,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) { m_canvas->MoveCursorToCrossHair(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Start_Move_Zone_Outlines( &dc, zone_cont ); break; } @@ -513,7 +513,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection, pos.x, pos.y ); zone_cont->m_CornerSelection++; zone_cont->Draw( m_canvas, &dc, GR_XOR ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, true ); break; } @@ -524,7 +524,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) m_canvas->MoveCursorToCrossHair(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); End_Move_Zone_Corner_Or_Outlines( &dc, zone_cont ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); break; } @@ -576,7 +576,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST: StartMoveTextePcb( (TEXTE_PCB*) GetCurItem(), &dc ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); break; case ID_POPUP_PCB_DRAG_MODULE_REQUEST: @@ -1000,7 +1000,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) SetCurItem( NULL ); } - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); break; case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER: @@ -1092,7 +1092,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } m_canvas->CrossHairOn( &dc ); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); } diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index 7cead2ac97..60b27f76c2 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -1,6 +1,31 @@ -/*********************************************************************/ -/* Edition of texts on copper and technical layers (TEXTE_PCB class) */ -/*********************************************************************/ +/* + * 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) 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 edit_pcb_text.cpp + * @brief Editimg of text on copper and technical layers (TEXTE_PCB class) + */ #include "fctsys.h" #include "gr_basic.h" @@ -115,7 +140,7 @@ void PCB_EDIT_FRAME::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ) m_canvas->SetMouseCapture( Move_Texte_Pcb, Abort_Edit_Pcb_Text ); SetCurItem( TextePcb ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } diff --git a/pcbnew/editedge.cpp b/pcbnew/editedge.cpp index c7cbd3ebb4..4640b5bef5 100644 --- a/pcbnew/editedge.cpp +++ b/pcbnew/editedge.cpp @@ -1,6 +1,31 @@ -/***********************************/ -/* Edit segments and edges of PCB. */ -/***********************************/ +/* + * 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) 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 editedge.cpp + * @brief Edit segments and edges of PCB. + */ #include "fctsys.h" #include "class_drawpanel.h" @@ -38,7 +63,7 @@ void PCB_EDIT_FRAME::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ) drawitem->DisplayInfo( this ); m_canvas->SetMouseCapture( Move_Segment, Abort_EditEdge ); SetCurItem( drawitem ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } @@ -185,7 +210,7 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC ) if( Segment->IsNew() ) { - Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, false ); + Panel->CallMouseCapture( DC, wxDefaultPosition, false ); Segment ->DeleteStructure(); Segment = NULL; } @@ -193,7 +218,7 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC ) { wxPoint pos = Panel->GetScreen()->GetCrossHairPosition(); Panel->GetScreen()->SetCrossHairPosition( s_InitialPosition ); - Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, true ); + Panel->CallMouseCapture( DC, wxDefaultPosition, true ); Panel->GetScreen()->SetCrossHairPosition( pos ); Segment->ClearFlags(); Segment->Draw( Panel, DC, GR_OR ); diff --git a/pcbnew/editrack-part2.cpp b/pcbnew/editrack-part2.cpp index dadf5ec6d1..39f2ebf8be 100644 --- a/pcbnew/editrack-part2.cpp +++ b/pcbnew/editrack-part2.cpp @@ -92,7 +92,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) itmp = g_CurrentTrackList.GetCount(); Begin_Route( g_CurrentTrackSegment, DC ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); /* create the via */ SEGVIA* via = new SEGVIA( GetBoard() ); @@ -153,7 +153,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) /* DRC fault: the Via cannot be placed here ... */ delete via; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); // delete the track(s) added in Begin_Route() while( g_CurrentTrackList.GetCount() > itmp ) @@ -207,7 +207,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) g_CurrentTrackList.PushBack( g_CurrentTrackSegment->Copy() ); } - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); via->DisplayInfo( this ); UpdateStatusBar(); diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index 21803f750f..8e8bf5972b 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -200,7 +200,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) g_CurrentTrackSegment->DisplayInfoBase( this ); SetCurItem( g_CurrentTrackSegment, false ); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false ); if( Drc_On ) { @@ -686,7 +686,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo { int color = g_ColorsSettings.GetLayerColor( g_CurrentTrackSegment->GetLayer() ); - GRCircle( &aPanel->m_ClipBox, aDC, g_CurrentTrackSegment->m_End.x, + GRCircle( aPanel->GetClipBox(), aDC, g_CurrentTrackSegment->m_End.x, g_CurrentTrackSegment->m_End.y, ( netclass->GetViaDiameter() / 2 ) + netclass->GetClearance(), color ); @@ -754,7 +754,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo { int color = g_ColorsSettings.GetLayerColor(g_CurrentTrackSegment->GetLayer()); - GRCircle( &aPanel->m_ClipBox, aDC, g_CurrentTrackSegment->m_End.x, + GRCircle( aPanel->GetClipBox(), aDC, g_CurrentTrackSegment->m_End.x, g_CurrentTrackSegment->m_End.y, ( netclass->GetViaDiameter() / 2 ) + netclass->GetClearance(), color ); diff --git a/pcbnew/edtxtmod.cpp b/pcbnew/edtxtmod.cpp index 09d0dcf8af..dc77ca12dc 100644 --- a/pcbnew/edtxtmod.cpp +++ b/pcbnew/edtxtmod.cpp @@ -1,3 +1,27 @@ +/* + * 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) 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 edtxtmod.cpp * @brief Edit module text. @@ -194,7 +218,7 @@ void PCB_BASE_FRAME::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ) SetCurItem( Text ); m_canvas->SetMouseCapture( Show_MoveTexte_Module, AbortMoveTextModule ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, true ); } diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index 65152f962e..488ba90f41 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -235,28 +235,28 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit break; case HK_SWITCH_TRACK_WIDTH_TO_NEXT: - if( GetCanvas()->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor ) - ShowNewTrackWhenMovingCursor( GetCanvas(), aDC, wxDefaultPosition, false ); + if( GetCanvas()->IsMouseCaptured() ) + GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); GetBoard()->m_TrackWidthSelector = ( GetBoard()->m_TrackWidthSelector + 1 ) % GetBoard()->m_TrackWidthList.size(); - if( GetCanvas()->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor ) - ShowNewTrackWhenMovingCursor( GetCanvas(), aDC, wxDefaultPosition, false ); + if( GetCanvas()->IsMouseCaptured() ) + GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); break; case HK_SWITCH_TRACK_WIDTH_TO_PREVIOUS: - if( GetCanvas()->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor ) - ShowNewTrackWhenMovingCursor( GetCanvas(), aDC, wxDefaultPosition, false ); + if( GetCanvas()->IsMouseCaptured() ) + GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); if( GetBoard()->m_TrackWidthSelector == 0 ) GetBoard()->m_TrackWidthSelector = GetBoard()->m_TrackWidthList.size(); GetBoard()->m_TrackWidthSelector--; - if( GetCanvas()->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor ) - ShowNewTrackWhenMovingCursor( GetCanvas(), aDC, wxDefaultPosition, false ); + if( GetCanvas()->IsMouseCaptured() ) + GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); break; @@ -567,7 +567,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit SetCurItem( track ); if( track ) - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else if( GetCurItem()->IsNew() ) { @@ -578,7 +578,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit if( track ) // A new segment was created SetCurItem( track, false ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } break; @@ -918,11 +918,11 @@ bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC ) bool no_tool = GetToolId() == ID_NO_TOOL_SELECTED; bool itemCurrentlyEdited = item && item->GetFlags(); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); if( itemCurrentlyEdited ) { - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); m_canvas->CrossHairOff( aDC ); switch( item->Type() ) @@ -964,7 +964,7 @@ bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC ) break; } - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->CrossHairOn( aDC ); return true; diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 6dc624851f..9f3caf55da 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -387,7 +387,7 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn return; } - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); // Create a new, empty library if no old lib, or if archive all modules if( !NewModulesOnly || !file_exists ) @@ -430,7 +430,7 @@ void PCB_BASE_FRAME::Archive_Modules( const wxString& LibName, bool NewModulesOn DisplayActivity( (int) ( ii * step ), wxEmptyString ); /* Check for request to stop backup (ESCAPE key actuated) */ - if( m_canvas->m_AbortRequest ) + if( m_canvas->GetAbortRequest() ) break; } } diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index aec181830a..0fc5420fc7 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -110,12 +110,11 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) // PCB_BASE_FRAME::ProcessItemSelection() // and it calls SetCurItem() which in turn calls DisplayInfo() on the // item. - m_canvas->m_AbortRequest = true; // changed in false if an item - PopupMenu( &itemMenu ); // m_AbortRequest = false if an - // item is selected + m_canvas->SetAbortRequest( true ); // changed in false if an item + PopupMenu( &itemMenu ); // m_AbortRequest = false if an item is selected m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); // The function ProcessItemSelection() has set the current item, return it. item = GetCurItem(); @@ -198,7 +197,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( m_canvas->IsMouseCaptured() ) { // for all other commands: stop the move in progress - m_canvas->m_endMouseCaptureCallback( m_canvas, &dc ); + m_canvas->CallEndMouseCapture( &dc ); } if( id != ID_POPUP_CANCEL_CURRENT_COMMAND ) @@ -647,14 +646,14 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PLACE_BLOCK: GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE; - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); HandleBlockPlace( &dc ); break; case ID_POPUP_COPY_BLOCK: GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY; GetScreen()->m_BlockLocate.SetMessageBlock( this ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); HandleBlockPlace( &dc ); break; diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 6ee622c3ef..870b983f06 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -178,7 +178,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( wxWindow* father, ReCreateOptToolbar(); if( m_canvas ) - m_canvas->m_Block_Enable = true; + m_canvas->SetEnableBlockCommands( true ); m_auimgr.SetManagedWindow( this ); @@ -413,17 +413,17 @@ void FOOTPRINT_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, if( m_canvas->IsMouseCaptured() ) { #ifdef USE_WX_OVERLAY - wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC ); + wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC ); oDC.Clear(); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false ); + m_canvas->CallMouseCapture( aDC, aPosition, false ); #else - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); + m_canvas->CallMouseCapture( aDC, aPosition, true ); #endif } #ifdef USE_WX_OVERLAY else { - m_canvas->m_overlay.Reset(); + m_overlay.Reset(); } #endif } diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index 70e997663d..d1b038df93 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -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) 2008-2011 Wayne Stambaugh + * 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 modules.cpp */ @@ -105,7 +130,7 @@ void PCB_EDIT_FRAME::StartMove_Module( MODULE* module, wxDC* DC ) GetBoard()->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST; m_canvas->SetMouseCapture( MoveFootprint, Abort_MoveOrCopyModule ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); // Erase the module. if( DC ) @@ -115,7 +140,7 @@ void PCB_EDIT_FRAME::StartMove_Module( MODULE* module, wxDC* DC ) module->ClearFlags( DO_NOT_DRAW ); } - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp index 37bf6d7135..969bec096b 100644 --- a/pcbnew/move_or_drag_track.cpp +++ b/pcbnew/move_or_drag_track.cpp @@ -87,7 +87,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) Panel->GetScreen()->SetCrossHairPosition( PosInit ); if( Panel->IsMouseCaptured() ) - Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, true ); + Panel->CallMouseCapture( DC, wxDefaultPosition, true ); Panel->GetScreen()->SetCrossHairPosition( oldpos ); pcb->HighLightOFF(); @@ -770,7 +770,7 @@ void PCB_EDIT_FRAME::StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aC GetBoard()->HighLightON(); GetBoard()->DrawHighLight( m_canvas, aDC, GetBoard()->GetHighLightNetCode() ); - m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true ); + m_canvas->CallMouseCapture( aDC, wxDefaultPosition, true ); } @@ -981,7 +981,7 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC if( !InitialiseDragParameters() ) { DisplayError( this, _( "Unable to drag this segment: two collinear segments" ) ); - m_canvas->m_mouseCaptureCallback = NULL; + m_canvas->SetMouseCaptureCallback( NULL ); Abort_MoveTrack( m_canvas, DC ); return; } diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index f9b525afc2..a2765e73c7 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -118,7 +118,7 @@ static void ShowBoundingBoxMicroWaveInductor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, if( aErase ) { - GRPoly( &aPanel->m_ClipBox, aDC, 5, poly, false, 0, YELLOW, YELLOW ); + GRPoly( aPanel->GetClipBox(), aDC, 5, poly, false, 0, YELLOW, YELLOW ); } Mself.m_End = aPanel->GetScreen()->GetCrossHairPosition(); @@ -137,7 +137,7 @@ static void ShowBoundingBoxMicroWaveInductor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, poly[3] = Mself.m_Start + pt; poly[4] = poly[0]; - GRPoly( &aPanel->m_ClipBox, aDC, 5, poly, false, 0, YELLOW, YELLOW ); + GRPoly( aPanel->GetClipBox(), aDC, 5, poly, false, 0, YELLOW, YELLOW ); } @@ -146,7 +146,7 @@ void Exit_Self( EDA_DRAW_PANEL* Panel, wxDC* DC ) if( Self_On ) { Self_On = 0; - Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, 0 ); + Panel->CallMouseCapture( DC, wxDefaultPosition, 0 ); } } @@ -169,7 +169,7 @@ void PCB_EDIT_FRAME::Begin_Self( wxDC* DC ) UpdateStatusBar(); m_canvas->SetMouseCapture( ShowBoundingBoxMicroWaveInductor, Exit_Self ); - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } @@ -179,7 +179,7 @@ MODULE* PCB_EDIT_FRAME::Genere_Self( wxDC* DC ) int ll; wxString msg; - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); m_canvas->SetMouseCapture( NULL, NULL ); if( Self_On == 0 ) diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index 9e01240192..ca3292d0bc 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -51,11 +51,11 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( no_tool || ( DrawStruct && DrawStruct->GetFlags() ) ) { - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); if( DrawStruct && DrawStruct->GetFlags() ) // Command in progress { - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); m_canvas->CrossHairOff( aDC ); switch( DrawStruct->Type() ) @@ -63,7 +63,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) case PCB_ZONE_AREA_T: if( DrawStruct->IsNew() ) { - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Begin_Zone( aDC ); } else @@ -134,7 +134,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) break; } - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); m_canvas->CrossHairOn( aDC ); if( exit ) @@ -247,7 +247,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { DrawStruct = (BOARD_ITEM*) Begin_DrawSegment( NULL, shape, aDC ); SetCurItem( DrawStruct ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else if( DrawStruct && (DrawStruct->Type() == PCB_LINE_T) @@ -255,7 +255,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { DrawStruct = (BOARD_ITEM*) Begin_DrawSegment( (DRAWSEGMENT*) DrawStruct, shape, aDC ); SetCurItem( DrawStruct ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } break; } @@ -273,7 +273,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) SetCurItem( DrawStruct ); if( DrawStruct ) - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else if( DrawStruct && DrawStruct->IsNew() ) { @@ -284,7 +284,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( track ) // A new segment was created SetCurItem( DrawStruct = (BOARD_ITEM*) track, false ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } break; @@ -315,19 +315,19 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { m_canvas->MoveCursorToCrossHair(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Start_Move_Zone_Corner( aDC, zone_cont, zone_cont->m_CornerSelection, false ); } else if( Begin_Zone( aDC ) ) { - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); DrawStruct = GetBoard()->m_CurrentZoneContour; GetScreen()->SetCurItem( DrawStruct ); } } else if( DrawStruct && (DrawStruct->Type() == PCB_ZONE_AREA_T) && DrawStruct->IsNew() ) { // Add a new corner to the current outline being created: - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); Begin_Zone( aDC ); DrawStruct = GetBoard()->m_CurrentZoneContour; GetScreen()->SetCurItem( DrawStruct ); @@ -344,12 +344,12 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { SetCurItem( Create_Texte_Pcb( aDC ) ); m_canvas->MoveCursorToCrossHair(); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else if( DrawStruct->Type() == PCB_TEXT_T ) { Place_Texte_Pcb( (TEXTE_PCB*) DrawStruct, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } else { @@ -371,7 +371,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) else if( DrawStruct->Type() == PCB_MODULE_T ) { PlaceModule( (MODULE*) DrawStruct, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } else { @@ -391,13 +391,13 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) { DrawStruct = (BOARD_ITEM*) EditDimension( NULL, aDC ); SetCurItem( DrawStruct ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else if( DrawStruct && (DrawStruct->Type() == PCB_DIMENSION_T) && DrawStruct->IsNew() ) { DrawStruct = (BOARD_ITEM*) EditDimension( (DIMENSION*) DrawStruct, aDC ); SetCurItem( DrawStruct ); - m_canvas->m_AutoPAN_Request = true; + m_canvas->SetAutoPanRequest( true ); } else { @@ -471,7 +471,7 @@ void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) if( DrawStruct->IsNew() ) { if( End_Route( (TRACK*) DrawStruct, aDC ) ) - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } else if( DrawStruct->GetFlags() == 0 ) { @@ -511,7 +511,7 @@ void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) if( DrawStruct && DrawStruct->IsNew() ) { if( End_Route( (TRACK*) DrawStruct, aDC ) ) - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); } break; @@ -519,7 +519,7 @@ void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) case ID_PCB_ZONES_BUTT: if( End_Zone( aDC ) ) { - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); SetCurItem( NULL ); } @@ -534,14 +534,14 @@ void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) if( DrawStruct->Type() != PCB_LINE_T ) { DisplayError( this, wxT( "DrawStruct Type error" ) ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); break; } if( DrawStruct->IsNew() ) { End_Edge( (DRAWSEGMENT*) DrawStruct, aDC ); - m_canvas->m_AutoPAN_Request = false; + m_canvas->SetAutoPanRequest( false ); SetCurItem( NULL ); } diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 23a5000e32..6a4fe78d69 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -59,7 +59,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) BOARD_ITEM* item = GetCurItem(); - m_canvas->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu + m_canvas->SetCanStartBlock( -1 ); // Avoid to start a block coomand when clicking on menu // If a command or a block is in progress: // Put the Cancel command (if needed) and the End command @@ -119,10 +119,10 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) // previously picked at this position if( !item || cursorPos != selectPos ) { - m_canvas->m_AbortRequest = false; + m_canvas->SetAbortRequest( false ); item = PcbGeneralLocateAndDisplay(); - if( m_canvas->m_AbortRequest ) + if( m_canvas->GetAbortRequest() ) { m_canvas->CrossHairOn( &dc ); return false; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 7f29d909ee..127a6df09c 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -329,7 +329,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title, GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); if( m_canvas ) - m_canvas->m_Block_Enable = true; + m_canvas->SetEnableBlockCommands( true ); ReCreateMenuBar(); ReCreateHToolbar(); @@ -451,7 +451,7 @@ void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event ) void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) { - m_canvas->m_AbortRequest = true; + m_canvas->SetAbortRequest( true ); if( GetScreen()->IsModify() ) { diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index 556579eef4..a6a7f517f4 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -63,7 +63,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC, DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayNetNamesMode = 0; - m_canvas->m_PrintIsMirrored = aPrintMirrorMode; + m_canvas->SetPrintMirrored( aPrintMirrorMode ); // The OR mode is used in color mode, but be aware the background *must be // BLACK. In the print page dialog, we first print in BLACK, and after @@ -94,7 +94,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC, D_PAD::m_PadSketchModePenSize = tmp; - m_canvas->m_PrintIsMirrored = false; + m_canvas->SetPrintMirrored( false ); DisplayOpt = save_opt; m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; @@ -195,7 +195,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayNetNamesMode = 0; - m_canvas->m_PrintIsMirrored = aPrintMirrorMode; + m_canvas->SetPrintMirrored( aPrintMirrorMode ); // The OR mode is used in color mode, but be aware the background *must be // BLACK. In the print page dialog, we first print in BLACK, and after @@ -240,7 +240,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, int radius = pt_trace->m_Width >> 1; int color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + pt_trace->m_Shape ); GRSetDrawMode( aDC, drawmode ); - GRFilledCircle( &m_canvas->m_ClipBox, aDC, + GRFilledCircle( m_canvas->GetClipBox(), aDC, pt_trace->m_Start.x, pt_trace->m_Start.y, radius, @@ -310,7 +310,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, else diameter = pt_trace->GetDrillValue(); - GRFilledCircle( &m_canvas->m_ClipBox, aDC, + GRFilledCircle( m_canvas->GetClipBox(), aDC, pt_trace->m_Start.x, pt_trace->m_Start.y, diameter/2, 0, color, color ); @@ -320,7 +320,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, GRForceBlackPen( blackpenstate ); } - m_canvas->m_PrintIsMirrored = false; + m_canvas->SetPrintMirrored( false ); DisplayOpt = save_opt; GetScreen()->m_Active_Layer = activeLayer; diff --git a/pcbnew/printout_controler.cpp b/pcbnew/printout_controler.cpp index fae5d573a8..067cfb5b58 100644 --- a/pcbnew/printout_controler.cpp +++ b/pcbnew/printout_controler.cpp @@ -260,18 +260,18 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() screen->m_DrawOrg = DrawOffset; GRResetPenAndBrush( dc ); + if( m_PrintParams.m_Print_Black_and_White ) GRForceBlackPen( true ); EDA_DRAW_PANEL* panel = m_Parent->GetCanvas(); - EDA_RECT tmp = panel->m_ClipBox; + EDA_RECT tmp = *panel->GetClipBox(); // Set clip box to the max size #define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer // and that allows calculations without overflow - panel->m_ClipBox.SetOrigin( wxPoint( 0, 0 ) ); - panel->m_ClipBox.SetSize( wxSize( MAX_VALUE, MAX_VALUE ) ); + panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) ); m_Parent->GetScreen()->m_IsPrinting = true; int bg_color = g_DrawBgColor; @@ -283,6 +283,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() { // To plot mirror, we reverse the y axis, and modify the plot y origin dc->SetAxisOrientation( true, true ); + if( userscale < 1.0 ) scaley /= userscale; @@ -309,7 +310,8 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() DrawOffset.y += pcb_centre.y - (ysize / 2); dc->SetLogicalOrigin( screen->m_DrawOrg.x, screen->m_DrawOrg.y ); - panel->m_ClipBox.SetOrigin( wxPoint( -MAX_VALUE/2, -MAX_VALUE/2 ) ); + panel->SetClipBox( EDA_RECT( wxPoint( -MAX_VALUE/2, -MAX_VALUE/2 ), + panel->GetClipBox()->GetSize() ) ); } g_DrawBgColor = WHITE; @@ -331,7 +333,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() g_DrawBgColor = bg_color; m_Parent->GetScreen()->m_IsPrinting = false; - panel->m_ClipBox = tmp; + panel->SetClipBox( tmp ); GRForceBlackPen( false ); diff --git a/pcbnew/protos.h b/pcbnew/protos.h index 0726058f5c..c70d729d6c 100644 --- a/pcbnew/protos.h +++ b/pcbnew/protos.h @@ -70,8 +70,8 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo bool aErase ); /** - * Determine coordinate for a segment direction of 0, 90 or 45 degrees, - * depending on it's position from the origin (ox, oy) and \a aPosiition.. + * Determine coordinate for a segment direction of 0, 90, or 45 degrees + * depending on it's position from the origin (ox, oy) and \a aPosiition. */ void CalculateSegmentEndPoint( const wxPoint& aPosition, int ox, int oy, int* fx, int* fy ); diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index c2e1a21b61..0057329155 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -876,6 +876,6 @@ void PCB_BASE_FRAME::TraceAirWiresToTargets( wxDC* aDC ) if( ii >= g_MaxLinksShowed ) break; - GRLine( &m_canvas->m_ClipBox, aDC, s_CursorPos, s_TargetsLocations[ii], 0, YELLOW ); + GRLine( m_canvas->GetClipBox(), aDC, s_CursorPos, s_TargetsLocations[ii], 0, YELLOW ); } } diff --git a/pcbnew/solve.cpp b/pcbnew/solve.cpp index 6f0a2ec6a7..400f90751e 100644 --- a/pcbnew/solve.cpp +++ b/pcbnew/solve.cpp @@ -267,8 +267,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) bool stop = false; wxString msg; - m_canvas->m_AbortRequest = false; - m_canvas->m_AbortEnable = true; + m_canvas->SetAbortRequest( false ); s_Clearance = GetBoard()->m_NetClasses.GetDefault()->GetClearance(); @@ -289,7 +288,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) /* Test to stop routing ( escape key pressed ) */ wxYield(); - if( m_canvas->m_AbortRequest ) + if( m_canvas->GetAbortRequest() ) { if( IsOK( this, _( "Abort routing?" ) ) ) { @@ -299,7 +298,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) } else { - m_canvas->m_AbortRequest = 0; + m_canvas->SetAbortRequest( false ); } } @@ -323,7 +322,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) segm_fY = GetBoard()->GetBoundingBox().GetY() + (Board.m_GridRouting * row_target); /* Draw segment. */ - GRLine( &m_canvas->m_ClipBox, + GRLine( m_canvas->GetClipBox(), DC, segm_oX, segm_oY, @@ -378,8 +377,6 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) break; } - m_canvas->m_AbortEnable = false; - SaveCopyInUndoList( s_ItemsListPicker, UR_UNSPECIFIED ); s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items @@ -608,7 +605,7 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe, { /* Remove link. */ GRSetDrawMode( DC, GR_XOR ); - GRLine( &pcbframe->GetCanvas()->m_ClipBox, + GRLine( pcbframe->GetCanvas()->GetClipBox(), DC, segm_oX, segm_oY, @@ -627,7 +624,7 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe, break; /* Routing complete. */ } - if( pcbframe->GetCanvas()->m_AbortRequest ) + if( pcbframe->GetCanvas()->GetAbortRequest() ) { result = STOP_FROM_ESC; break; @@ -635,6 +632,7 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe, /* report every COUNT new nodes or so */ #define COUNT 20000 + if( ( OpenNodes - lastopen > COUNT ) || ( ClosNodes - lastclos > COUNT ) || ( MoveNodes - lastmove > COUNT ) ) diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index f23eac1569..6bad2af501 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -80,14 +80,14 @@ void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) #ifdef USE_WX_OVERLAY if( IsShown() ) { - m_canvas->m_overlay.Reset(); - wxDCOverlay overlaydc( m_canvas->m_overlay, (wxWindowDC*)DC ); + m_overlay.Reset(); + wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC ); overlaydc.Clear(); } #endif if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); /* Redraw the cursor */ m_canvas->DrawCrossHair( DC ); @@ -116,14 +116,14 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) #ifdef USE_WX_OVERLAY if( IsShown() ) { - m_canvas->m_overlay.Reset(); - wxDCOverlay overlaydc( m_canvas->m_overlay, (wxWindowDC*)DC ); + m_overlay.Reset(); + wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC ); overlaydc.Clear(); } #endif if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); // Redraw the cursor m_canvas->DrawCrossHair( DC ); diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index e41e644552..895346b513 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -122,7 +122,7 @@ int PCB_EDIT_FRAME::Delete_LastCreatedCorner( wxDC* DC ) zone->m_Poly->DeleteCorner( zone->GetNumCorners() - 1 ); if( m_canvas->IsMouseCaptured() ) - m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); + m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); } else { @@ -467,7 +467,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) zone->SetLayer( getActiveLayer() ); // Prompt user for parameters: - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); if( zone->IsOnCopperLayer() ) { // Put a zone on a copper layer @@ -496,7 +496,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) } m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); if( diag == ZONE_ABORT ) return 0; @@ -718,7 +718,7 @@ static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC, void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ) { int diag; - m_canvas->m_IgnoreMouseEvents = true; + m_canvas->SetIgnoreMouseEvents( true ); /* Save initial zones configuration, for undo/redo, before adding new zone * note the net name and the layer can be changed, so we must save all zones @@ -740,7 +740,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container } m_canvas->MoveCursorToCrossHair(); - m_canvas->m_IgnoreMouseEvents = false; + m_canvas->SetIgnoreMouseEvents( false ); if( diag == ZONE_ABORT ) { From 5916688f35e51d96d300e1364e4ba3575f6900af Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 30 Dec 2011 13:29:54 +0100 Subject: [PATCH 06/12] Pcbnew: Fix error message in Module Editor after a global pad change. Minor other enhancements and code cleaning. --- bitmaps_png/cpp_26/edit_comp_footprint.cpp | 158 +-- common/dialog_about/AboutDialog_main.cpp | 77 +- include/wxBasePcbFrame.h | 21 +- include/wxPcbStruct.h | 10 + .../dialog_global_pads_edition_base.cpp | 154 ++- .../dialog_global_pads_edition_base.fbp | 942 ++++++++++++------ .../dialogs/dialog_global_pads_edition_base.h | 117 +-- pcbnew/edit.cpp | 2 +- pcbnew/globaleditpad.cpp | 187 +++- pcbnew/modedit.cpp | 3 +- pcbnew/module_editor_frame.h | 9 + 11 files changed, 1069 insertions(+), 611 deletions(-) diff --git a/bitmaps_png/cpp_26/edit_comp_footprint.cpp b/bitmaps_png/cpp_26/edit_comp_footprint.cpp index a641ad0ea4..e50f15a99a 100644 --- a/bitmaps_png/cpp_26/edit_comp_footprint.cpp +++ b/bitmaps_png/cpp_26/edit_comp_footprint.cpp @@ -8,71 +8,99 @@ static const unsigned char png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, - 0xce, 0x00, 0x00, 0x03, 0xeb, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x96, 0x7d, 0x48, 0x55, - 0x67, 0x1c, 0xc7, 0xd5, 0xab, 0x76, 0xaf, 0xca, 0xe5, 0xaa, 0x88, 0x77, 0xd0, 0x1d, 0x8d, 0xa9, - 0xac, 0x92, 0xa6, 0x8c, 0x5d, 0xdc, 0x44, 0x41, 0x26, 0x75, 0xb9, 0x21, 0x16, 0x5e, 0xf7, 0x67, - 0x98, 0x25, 0xe6, 0x40, 0x8d, 0x88, 0xad, 0xfd, 0xd3, 0x36, 0x9a, 0xd0, 0x98, 0x8a, 0xe4, 0x0b, - 0xf8, 0x72, 0xaf, 0xfe, 0x21, 0xb1, 0xc9, 0xfe, 0x18, 0x23, 0x29, 0x8a, 0xcd, 0x4c, 0x88, 0xb2, - 0xa8, 0x90, 0x5e, 0xb4, 0xae, 0x7a, 0xb2, 0xd9, 0xbc, 0x29, 0x66, 0x4e, 0x26, 0xb1, 0xdc, 0x77, - 0xdf, 0xdf, 0xf1, 0x39, 0xe9, 0xa2, 0x7b, 0x77, 0x61, 0xb0, 0xa0, 0x03, 0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0x49, 0x45, 0x4e, 0x44, - 0xae, 0x42, 0x60, 0x82, + 0xce, 0x00, 0x00, 0x05, 0xb3, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x95, 0x95, 0x0b, 0x50, 0x94, + 0x55, 0x18, 0x86, 0x77, 0x17, 0x84, 0x00, 0x05, 0x86, 0x11, 0x46, 0x45, 0x26, 0x6a, 0x61, 0x59, + 0xd9, 0x25, 0x04, 0x1a, 0x64, 0x42, 0x44, 0x86, 0xb4, 0x30, 0x11, 0xd1, 0x40, 0x31, 0x40, 0x12, + 0x52, 0x23, 0x44, 0x62, 0x17, 0xc5, 0x40, 0xd4, 0x48, 0x97, 0x55, 0x76, 0x81, 0xcd, 0x40, 0x2e, + 0x11, 0xc1, 0xb8, 0x6d, 0xca, 0xa0, 0x0d, 0x59, 0x69, 0x84, 0x66, 0x52, 0x22, 0x9a, 0x78, 0x49, + 0x40, 0x50, 0x14, 0x51, 0x2e, 0x81, 0x72, 0x19, 0xc0, 0xfb, 0xdb, 0x39, 0xff, 0x5e, 0x00, 0x05, + 0xa5, 0x7f, 0xe6, 0x9d, 0xf3, 0x9f, 0xf7, 0x9c, 0xfd, 0x9e, 0xb3, 0xdf, 0xf9, 0xce, 0xf9, 0x59, + 0x00, 0x58, 0xe4, 0x89, 0x27, 0x5a, 0x4e, 0xdf, 0xc7, 0x52, 0x41, 0x41, 0x81, 0x7b, 0x7e, 0x7e, + 0xfe, 0xfd, 0xbc, 0xbc, 0x3c, 0x1e, 0x79, 0x17, 0x93, 0xf7, 0x76, 0xea, 0x93, 0xf6, 0x00, 0xf5, + 0x35, 0x63, 0xfb, 0xb6, 0x6f, 0xdf, 0xce, 0x19, 0x2f, 0x06, 0x4b, 0x03, 0xca, 0x24, 0x82, 0x99, + 0x99, 0x59, 0x0d, 0x69, 0xed, 0x9e, 0x9d, 0x44, 0x02, 0x79, 0x10, 0x21, 0x37, 0x37, 0x97, 0x4f, + 0xda, 0x44, 0xa2, 0x1e, 0xcd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99, 0x82, 0xfa, 0xfb, 0x81, 0x9e, 0x1e, + 0x35, 0xa4, 0xa3, 0x03, 0xb8, 0x73, 0x07, 0x68, 0x69, 0x01, 0xb2, 0xb3, 0x0f, 0x62, 0xe6, 0xcc, + 0xd7, 0x60, 0x62, 0x62, 0xd2, 0x49, 0xf6, 0xd0, 0x8f, 0x2c, 0xcc, 0x90, 0x68, 0x05, 0xd1, 0x1e, + 0x22, 0xd7, 0x09, 0x81, 0x48, 0x4a, 0xe4, 0x2e, 0x2e, 0x2e, 0x17, 0x79, 0x3c, 0x3e, 0x03, 0xe9, + 0xee, 0x1e, 0x86, 0xdc, 0xba, 0x05, 0xdc, 0xb8, 0x01, 0x34, 0x35, 0x01, 0x97, 0x2e, 0xdd, 0x87, + 0x48, 0x24, 0xc5, 0xe4, 0xc9, 0xa6, 0xe0, 0x70, 0x38, 0xfd, 0x33, 0x66, 0xcc, 0xc0, 0xc2, 0x85, + 0xef, 0x61, 0xd2, 0x24, 0x03, 0x58, 0x58, 0x58, 0xa4, 0xbc, 0x14, 0xa4, 0xdd, 0x23, 0x0a, 0xa2, + 0x90, 0x4e, 0xb2, 0xcd, 0x6d, 0x6d, 0xc3, 0x90, 0x6b, 0xd7, 0x80, 0x86, 0x06, 0xe0, 0xca, 0x15, + 0x0a, 0x03, 0x24, 0x92, 0xfd, 0x14, 0x84, 0x0b, 0x17, 0x5a, 0x70, 0xfd, 0x3a, 0x10, 0x13, 0xf3, + 0x05, 0x8c, 0x8c, 0x8c, 0x60, 0x69, 0x69, 0xd9, 0x41, 0xe2, 0x9c, 0x26, 0x3a, 0xf4, 0x42, 0x90, + 0xbd, 0x3d, 0x5f, 0x07, 0x69, 0x6d, 0x05, 0x6e, 0xde, 0x54, 0x43, 0xae, 0x5e, 0x05, 0xea, 0xea, + 0xd4, 0x90, 0xda, 0x5a, 0x20, 0x3e, 0x5e, 0x4e, 0x7f, 0x80, 0x9c, 0x9c, 0x32, 0x54, 0x57, 0x0f, + 0xc1, 0x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a4, 0x24, + 0x06, 0x90, 0xb2, 0x33, 0x03, 0xac, 0xd7, 0x83, 0x18, 0xb1, 0xb9, 0xc1, 0x30, 0x15, 0x84, 0x60, + 0x41, 0xb0, 0x08, 0xff, 0xde, 0xed, 0x43, 0xd5, 0xaf, 0xe5, 0x58, 0x1d, 0xb5, 0x91, 0x19, 0xcb, + 0x90, 0x4a, 0xf0, 0x6d, 0xd9, 0x09, 0xdd, 0x5c, 0x7d, 0xbb, 0x60, 0x98, 0x09, 0x43, 0x10, 0x97, + 0x5a, 0x88, 0x07, 0x0f, 0x1f, 0x8d, 0x06, 0x91, 0xb3, 0xd1, 0x1b, 0x1a, 0x1a, 0xaa, 0x4b, 0x53, + 0x5a, 0x5a, 0x5a, 0xc3, 0xea, 0xb5, 0x71, 0xcc, 0x0f, 0xe3, 0x52, 0x8b, 0x70, 0xe0, 0xc8, 0x9f, + 0xd8, 0xf9, 0x55, 0x19, 0x8c, 0x05, 0xa1, 0x08, 0x5c, 0xbf, 0x87, 0x59, 0xe9, 0x3e, 0xe5, 0x31, + 0x66, 0xbc, 0xae, 0xa9, 0x55, 0x07, 0x92, 0x15, 0x94, 0x43, 0xf5, 0x63, 0x15, 0x42, 0xe3, 0x15, + 0x4c, 0xff, 0xd0, 0xb1, 0x33, 0xa3, 0x40, 0x0b, 0xa2, 0xa3, 0xa3, 0x7d, 0x34, 0xd5, 0x73, 0x83, + 0xde, 0xd2, 0x42, 0xa1, 0x50, 0x7c, 0xf4, 0xc4, 0x19, 0x66, 0x72, 0xc9, 0xa1, 0x93, 0xd0, 0x3e, + 0x09, 0x92, 0x12, 0xc6, 0x6b, 0xeb, 0xbc, 0x37, 0x26, 0xe8, 0xef, 0x7f, 0xae, 0x33, 0xf3, 0x6e, + 0xb5, 0x75, 0x31, 0xfd, 0xad, 0x72, 0xd5, 0x30, 0x88, 0xaa, 0xb0, 0xb0, 0xd0, 0x91, 0x40, 0x76, + 0x92, 0x72, 0x35, 0xa6, 0x7d, 0x81, 0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 0x64, 0xad, 0x8d, 0xf1, 0x1f, 0x68, 0xa0, 0x70, 0x72, 0xd7, 0xc5, 0x8a, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, }; const BITMAP_OPAQUE edit_comp_footprint_xpm[1] = {{ png, sizeof( png ), "edit_comp_footprint_xpm" }}; diff --git a/common/dialog_about/AboutDialog_main.cpp b/common/dialog_about/AboutDialog_main.cpp index 1ea8e353f1..5f1512fb86 100644 --- a/common/dialog_about/AboutDialog_main.cpp +++ b/common/dialog_about/AboutDialog_main.cpp @@ -205,72 +205,79 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) /* The developers */ info.AddDeveloper( new Contributor( wxT( "Jean-Pierre Charras" ), - wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); + wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); info.AddDeveloper( new Contributor( wxT( "Dick Hollenbeck" ), wxT( "dick@softplc.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Hauptmech" ), wxT( "hauptmech@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Jerry Jacobs" ), - wxT( "xor.gate.engineering@gmail.com" ) ) ); + wxT( "xor.gate.engineering@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Jonas Diemer" ), wxT( "diemer@gmx.de" ) ) ); info.AddDeveloper( new Contributor( wxT( "KBool Library" ), - wxT( "http://boolean.klaasholwerda.nl/bool.html" ) ) ); + wxT( "http://boolean.klaasholwerda.nl/bool.html" ) ) ); info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) ); - info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) ); + info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), + wxT( "marco.serantoni@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ), - wxT( "rafael.sokolowski@web.de" ) ) ); + wxT( "rafael.sokolowski@web.de" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) ); info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) ); - info.AddDeveloper( new Contributor( wxT( "Wayne Stambaugh" ), wxT( "stambaughw@verizon.net" ) ) ); + info.AddDeveloper( new Contributor( wxT( "Wayne Stambaugh" ), + wxT( "stambaughw@verizon.net" ) ) ); /* The document writers */ info.AddDocWriter( new Contributor( wxT( "Jean-Pierre Charras" ), - wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); - info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ) ) ); + wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); + info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ), + wxT( "plyatov@gmail.com" ) ) ); + info.AddDocWriter( new Contributor( wxT( "Fabrizio Tappero" ), + wxT( "fabrizio.tappero@gmail.com" ) ) ); /* The translators * As category the language to which the translation was done is used * and as icon the national flag of the corresponding country. */ info.AddTranslator( new Contributor( wxT( "Martin Kratoška" ), wxT( "martin@ok1rr.com" ), - wxT( "Czech (CZ)" ), KiBitmapNew( lang_cs_xpm ) ) ); + wxT( "Czech (CZ)" ), KiBitmapNew( lang_cs_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Jerry Jacobs" ), - wxT( "xor.gate.engineering@gmail.com" ), wxT( "Dutch (NL)" ), - KiBitmapNew( lang_nl_xpm ) ) ); + wxT( "xor.gate.engineering@gmail.com" ), wxT( "Dutch (NL)" ), + KiBitmapNew( lang_nl_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ), - wxT( "Finnish (FI)" ), KiBitmapNew( lang_fi_xpm ) ) ); + wxT( "Finnish (FI)" ), KiBitmapNew( lang_fi_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Jean-Pierre Charras" ), - wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ), - wxT( "French (FR)" ), KiBitmapNew( lang_fr_xpm ) ) ); + wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ), + wxT( "French (FR)" ), KiBitmapNew( lang_fr_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Mateusz Skowroński" ), wxT( "skowri@gmail.com" ), - wxT( "Polish (PL)" ), KiBitmapNew( lang_pl_xpm ) ) ); + wxT( "Polish (PL)" ), KiBitmapNew( lang_pl_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Renie Marquet" ), wxT( "reniemarquet@uol.com.br" ), - wxT( "Portuguese (PT)" ), KiBitmapNew( lang_pt_xpm ) ) ); + wxT( "Portuguese (PT)" ), KiBitmapNew( lang_pt_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ), - wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); + wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Andrey Fedorushkov" ), wxT( "" ), - wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); + wxT( "Russian (RU)" ), KiBitmapNew( lang_ru_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Pedro Martin del Valle" ), wxT( "pkicad@yahoo.es" ), - wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) ); + wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Iñigo Zuluaga" ), wxT( "inigo_zuluaga@yahoo.es" ), - wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) ); + wxT( "Spanish (ES)" ), KiBitmapNew( lang_es_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Rafael Sokolowski" ), - wxT( "rafael.sokolowski@web.de" ), wxT( "German (DE)" ), - KiBitmapNew( lang_de_xpm ) ) ); + wxT( "rafael.sokolowski@web.de" ), wxT( "German (DE)" ), + KiBitmapNew( lang_de_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Kenta Yonekura" ), - wxT( "midpika@hotmail.com" ), wxT( "Japanese (JA)" ), - KiBitmapNew( lang_jp_xpm ) ) ); + wxT( "midpika@hotmail.com" ), wxT( "Japanese (JA)" ), + KiBitmapNew( lang_jp_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Manolis Stefanis, Athanasios Vlastos and Milonas Kostas" ), - wxT( "milonas.ko@gmail.com" ), wxT( "Greek (el_GR)" ), - KiBitmapNew( lang_gr_xpm ) ) ); + wxT( "milonas.ko@gmail.com" ), wxT( "Greek (el_GR)" ), + KiBitmapNew( lang_gr_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Massimo Cioce" ), - wxT( "ciocemax@alice.it" ), wxT( "Italian (IT)" ), - KiBitmapNew( lang_it_xpm ) ) ); + wxT( "ciocemax@alice.it" ), wxT( "Italian (IT)" ), + KiBitmapNew( lang_it_xpm ) ) ); info.AddTranslator( new Contributor( wxT( "Evgeniy Ivanov" ), - wxT( "evgeniy_p_ivanov@yahoo.ca" ), wxT( "Bulgarian (BG)" ), - KiBitmapNew( lang_bg_xpm ) ) ); + wxT( "evgeniy_p_ivanov@yahoo.ca" ), wxT( "Bulgarian (BG)" ), + KiBitmapNew( lang_bg_xpm ) ) ); - /* TODO: are these all russian translators, placed them here now, or else align them below other language maintainer with mail adress */ + // TODO: are these all russian translators, + // placed them here now, + // or else align them below other language maintainer with mail adress info.AddTranslator( new Contributor( wxT( "Remy Halvick" ), wxEmptyString, wxT( "Others" ) ) ); info.AddTranslator( new Contributor( wxT( "David Briscoe" ), wxEmptyString, wxT( "Others" ) ) ); info.AddTranslator( new Contributor( wxT( "Dominique Laigle" ), wxEmptyString, wxT( "Others" ) ) ); @@ -278,13 +285,13 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) /* Programm credits for icons */ info.AddArtist( new Contributor( wxT( "Iñigo Zuluagaz" ), wxT( "inigo_zuluaga@yahoo.es" ), - wxT( "Icons by" ), KiBitmapNew( edit_module_xpm ) ) ); + wxT( "Icons by" ), KiBitmapNew( edit_module_xpm ) ) ); info.AddArtist( new Contributor( wxT( "Fabrizio Tappero" ), wxT( "fabrizio.tappero@gmail.com" ), - wxT( "New icons by" ), KiBitmapNew( edit_module_xpm ) ) ); + wxT( "New icons by" ), KiBitmapNew( edit_module_xpm ) ) ); info.AddArtist( new Contributor( wxT( "Renie Marquet" ), wxT( "reniemarquet@uol.com.br" ), - wxT( "3D modules by" ), KiBitmapNew( three_d_xpm ) ) ); + wxT( "3D modules by" ), KiBitmapNew( three_d_xpm ) ) ); info.AddArtist( new Contributor( wxT( "Christophe Boschat" ), wxT( "nox454@hotmail.fr" ), - wxT( "3D modules by" ), KiBitmapNew( three_d_xpm ) ) ); + wxT( "3D modules by" ), KiBitmapNew( three_d_xpm ) ) ); } diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 282de446a8..e0ccdb8aeb 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -325,7 +325,26 @@ public: void PlacePad( D_PAD* Pad, wxDC* DC ); void Export_Pad_Settings( D_PAD* aPad ); void Import_Pad_Settings( D_PAD* aPad, bool aDraw ); - void Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ); + + /** + * Function GlobalChange_PadSettings + * Function to change pad caracteristics for the given footprint + * or all footprints which look like the given footprint + * @param aPad is the pattern. The given footprint is the parent of this pad + * @param aSameFootprints: if true, make changes on all identical footprints + * @param aPadShapeFilter: if true, make changes only on pads having the same shape as aPad + * @param aPadOrientFilter: if true, make changes only on pads having the same orientation as aPad + * @param aPadLayerFilter: if true, make changes only on pads having the same layers as aPad + * @param aRedraw: if true: redraws the footprint + * @param aSaveForUndo: if true: create an entry in the Undo/Redo list + * (usually: true in Schematic editor, false in Module editor) + */ + void GlobalChange_PadSettings( D_PAD* aPad, + bool aSameFootprints, + bool aPadShapeFilter, + bool aPadOrientFilter, + bool aPadLayerFilter, + bool aRedraw, bool aSaveForUndo ); // loading footprints diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 261942cc4c..fe54718b26 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -877,6 +877,16 @@ public: void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ); void StartMove_Module( MODULE* module, wxDC* DC ); + /** + * Function DlgGlobalChange_PadSettings + * Function to change pad caracteristics for the given footprint + * or all footprints which look like the given footprint + * Options are set by the opened dialog. + * @param aPad is the pattern. The given footprint is the parent of this pad + * @param aRedraw: if true: redraws the footprint + */ + void DlgGlobalChange_PadSettings( D_PAD* aPad, bool aRedraw ); + /** * Function Delete Module * Remove a footprint from m_Modules linked list and put it in undelete buffer diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.cpp b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp index 5f9467ce77..a98f780fdb 100644 --- a/pcbnew/dialogs/dialog_global_pads_edition_base.cpp +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp @@ -1,78 +1,76 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_global_pads_edition_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_GLOBAL_PADS_EDITION_BASE::DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer1; - sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Filter :") ), wxVERTICAL ); - - m_Pad_Shape_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different shape"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbSizer1->Add( m_Pad_Shape_Filter_CB, 0, wxALL, 5 ); - - m_Pad_Layer_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having different layers"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxALL, 5 ); - - m_Pad_Orient_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different orientation"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxALL, 5 ); - - bLeftSizer->Add( sbSizer1, 1, wxEXPAND, 5 ); - - bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonPadEditor = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, _("Pad Editor"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonPadEditor, 0, wxALL|wxEXPAND, 5 ); - - - bRightSizer->Add( 10, 10, 0, 0, 5 ); - - m_button2 = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _("Change Pads on Module"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_button2, 0, wxALL|wxEXPAND, 5 ); - - m_button3 = new wxButton( this, ID_CHANGE_ID_MODULES, _("Change Pads on Same Modules"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_button3, 0, wxALL|wxEXPAND, 5 ); - - m_button4 = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_button4, 0, wxALL|wxEXPAND, 5 ); - - bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - - // Connect Events - m_buttonPadEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this ); - m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); - m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); - m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this ); -} - -DIALOG_GLOBAL_PADS_EDITION_BASE::~DIALOG_GLOBAL_PADS_EDITION_BASE() -{ - // Disconnect Events - m_buttonPadEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this ); - m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); - m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); - m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this ); -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 30 2011) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_global_pads_edition_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_GLOBAL_PADS_EDITION_BASE::DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer1; + sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Filter :") ), wxVERTICAL ); + + m_Pad_Shape_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different shape"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_Pad_Shape_Filter_CB, 0, wxALL, 5 ); + + m_Pad_Layer_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having different layers"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxALL, 5 ); + + m_Pad_Orient_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different orientation"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxALL, 5 ); + + bLeftSizer->Add( sbSizer1, 1, wxEXPAND, 5 ); + + bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonPadEditor = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, _("Pad Editor"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonPadEditor, 0, wxALL|wxEXPAND, 5 ); + + + bRightSizer->Add( 10, 10, 0, 0, 5 ); + + m_buttonChangeModule = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _("Change Pads on Module"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonChangeModule, 0, wxALL|wxEXPAND, 5 ); + + m_buttonIdModules = new wxButton( this, ID_CHANGE_ID_MODULES, _("Change Pads on Same Modules"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonIdModules, 0, wxALL|wxEXPAND, 5 ); + + m_buttonCancel = new wxButton( this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + + // Connect Events + m_buttonPadEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this ); + m_buttonChangeModule->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); + m_buttonIdModules->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this ); +} + +DIALOG_GLOBAL_PADS_EDITION_BASE::~DIALOG_GLOBAL_PADS_EDITION_BASE() +{ + // Disconnect Events + m_buttonPadEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this ); + m_buttonChangeModule->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); + m_buttonIdModules->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this ); + m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp index 17ae2af460..f2a40819b7 100644 --- a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp @@ -2,76 +2,124 @@ - + C++ 1 + source_name + 0 + res UTF-8 connect dialog_global_pads_edition_base 1000 none - 0 + 1 dialog_global_pads_edition - + . - + 1 + 1 0 0 - - - + 1 + 1 + 1 + 1 + 0 + + + + + 1 + + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - - + impl_virtual + + + 1 + + 0 0 wxID_ANY - - + + + 0 + + + 0 + + 1 DIALOG_GLOBAL_PADS_EDITION_BASE - + 1 + + + 1 + + + Resizable + + 1 482,165 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + Global Pads Edition - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + bMainSizer wxHORIZONTAL none @@ -80,7 +128,7 @@ wxEXPAND 1 - + bLeftSizer wxVERTICAL none @@ -91,61 +139,97 @@ wxID_ANY Pad Filter : - + sbSizer1 wxVERTICAL none - + 5 wxALL 0 - + 1 + 1 + 1 + 1 + + + + + 1 + 0 0 - + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Do not modify pads having a different shape - - + + + 0 + + + 0 + + 1 m_Pad_Shape_Filter_CB + 1 + + protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -153,51 +237,87 @@ wxALL 0 - + 1 + 1 + 1 + 1 + + + + + 1 + 0 0 - + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Do not modify pads having different layers - - + + + 0 + + + 0 + + 1 m_Pad_Layer_Filter_CB + 1 + + protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -205,51 +325,87 @@ wxALL 0 - + 1 + 1 + 1 + 1 + + + + + 1 + 0 0 - + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Do not modify pads having a different orientation - - + + + 0 + + + 0 + + 1 m_Pad_Orient_Filter_CB + 1 + + protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -261,7 +417,7 @@ wxEXPAND 0 - + bRightSizer wxVERTICAL none @@ -270,56 +426,92 @@ wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_CHANGE_GET_PAD_SETTINGS Pad Editor - - + + + 0 + + + 0 + + 1 m_buttonPadEditor + 1 + + protected - - - - - - - - + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + InstallPadEditor - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + 5 - + 0 10 @@ -332,51 +524,87 @@ wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_CHANGE_CURRENT_MODULE Change Pads on Module - - - m_button2 + + + 0 + + + 0 + + 1 + m_buttonChangeModule + 1 + + protected - - - - - - - - + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + PadPropertiesAccept - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -384,51 +612,87 @@ wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_CHANGE_ID_MODULES Change Pads on Same Modules - - - m_button3 - protected - - - - - - - - + + + 0 + + + 0 + + 1 + m_buttonIdModules + 1 + + + public + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + PadPropertiesAccept - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -436,51 +700,87 @@ wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 - wxID_CANCEL + wxID_ANY Cancel - - - m_button4 + + + 0 + + + 0 + + 1 + m_buttonCancel + 1 + + protected - - - - - - - - + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.h b/pcbnew/dialogs/dialog_global_pads_edition_base.h index 4bdf636b96..30f144ce85 100644 --- a/pcbnew/dialogs/dialog_global_pads_edition_base.h +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.h @@ -1,57 +1,60 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_global_pads_edition_base__ -#define __dialog_global_pads_edition_base__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -#define ID_CHANGE_GET_PAD_SETTINGS 1000 -#define ID_CHANGE_CURRENT_MODULE 1001 -#define ID_CHANGE_ID_MODULES 1002 - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_GLOBAL_PADS_EDITION_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_GLOBAL_PADS_EDITION_BASE : public wxDialog -{ - private: - - protected: - wxCheckBox* m_Pad_Shape_Filter_CB; - wxCheckBox* m_Pad_Layer_Filter_CB; - wxCheckBox* m_Pad_Orient_Filter_CB; - wxButton* m_buttonPadEditor; - - wxButton* m_button2; - wxButton* m_button3; - wxButton* m_button4; - - // Virtual event handlers, overide them in your derived class - virtual void InstallPadEditor( wxCommandEvent& event ){ event.Skip(); } - virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - - - public: - DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _( "Global Pads Edition" ), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 482,165 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_GLOBAL_PADS_EDITION_BASE(); - -}; - -#endif //__dialog_global_pads_edition_base__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 30 2011) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_GLOBAL_PADS_EDITION_BASE_H__ +#define __DIALOG_GLOBAL_PADS_EDITION_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +#define ID_CHANGE_GET_PAD_SETTINGS 1000 +#define ID_CHANGE_CURRENT_MODULE 1001 +#define ID_CHANGE_ID_MODULES 1002 + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_GLOBAL_PADS_EDITION_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_GLOBAL_PADS_EDITION_BASE : public wxDialog +{ + private: + + protected: + wxCheckBox* m_Pad_Shape_Filter_CB; + wxCheckBox* m_Pad_Layer_Filter_CB; + wxCheckBox* m_Pad_Orient_Filter_CB; + wxButton* m_buttonPadEditor; + wxButton* m_buttonChangeModule; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void InstallPadEditor( wxCommandEvent& event ) { event.Skip(); } + virtual void PadPropertiesAccept( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + wxButton* m_buttonIdModules; + + DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global Pads Edition"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 482,165 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_GLOBAL_PADS_EDITION_BASE(); + +}; + +#endif //__DIALOG_GLOBAL_PADS_EDITION_BASE_H__ diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 86587d380a..93c1af13b6 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -813,7 +813,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS: m_canvas->MoveCursorToCrossHair(); - Global_Import_Pad_Settings( (D_PAD*) GetCurItem(), true ); + DlgGlobalChange_PadSettings( (D_PAD*) GetCurItem(), true ); break; case ID_POPUP_PCB_EXPORT_PAD_SETTINGS: diff --git a/pcbnew/globaleditpad.cpp b/pcbnew/globaleditpad.cpp index 6eec000c31..7e784ed272 100644 --- a/pcbnew/globaleditpad.cpp +++ b/pcbnew/globaleditpad.cpp @@ -6,8 +6,9 @@ #include "common.h" #include "class_drawpanel.h" #include "confirm.h" -#include "wxBasePcbFrame.h" +#include "wxPcbStruct.h" #include "pcbcommon.h" +#include "module_editor_frame.h" #include "class_board.h" #include "class_module.h" @@ -105,24 +106,22 @@ void DIALOG_GLOBAL_PADS_EDITION::PadPropertiesAccept( wxCommandEvent& event ) } -/** - * Function Global_Import_Pad_Settings +/* + * PCB_EDIT_FRAME::Function DlgGlobalChange_PadSettings * Function to change pad caracteristics for the given footprint * or alls footprints which look like the given footprint - * @param aPad pad to use as pattern. The given footprint is the parent of - * this pad - * @param aDraw: if true: redraws the footprint + * Options are set by the opened dialog. + * aPad is the pattern. The given footprint is the parent of this pad + * aRedraw: if true: redraws the footprint */ -void PCB_BASE_FRAME::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) +void PCB_EDIT_FRAME::DlgGlobalChange_PadSettings( D_PAD* aPad, bool aRedraw ) { - MODULE* Module_Ref, * Module; int diag; - bool edit_Same_Modules = false; if( aPad == NULL ) aPad = &g_Pad_Master; - Module = (MODULE*) aPad->GetParent(); + MODULE* Module = (MODULE*) aPad->GetParent(); if( Module == NULL ) { @@ -140,88 +139,172 @@ void PCB_BASE_FRAME::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) if( diag == -1 ) return; + bool edit_Same_Modules = false; if( diag == 1 ) edit_Same_Modules = true; + GlobalChange_PadSettings( aPad,edit_Same_Modules, + DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter, + DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter, + DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter, + aRedraw, true ); +} + +/* + * FOOTPRINT_EDIT_FRAME::Function DlgGlobalChange_PadSettings + * Function to change pad caracteristics for the given footprint + * or alls footprints which look like the given footprint + * Options are set by the opened dialog. + * aPad is the pattern. The given footprint is the parent of this pad + */ +void FOOTPRINT_EDIT_FRAME::DlgGlobalChange_PadSettings( D_PAD* aPad ) +{ + int diag; + + if( aPad == NULL ) + aPad = &g_Pad_Master; + + MODULE* Module = (MODULE*) aPad->GetParent(); + + if( Module == NULL ) + { + DisplayError( this, wxT( "Global_Import_Pad_Settings() Error: NULL module" ) ); + return; + } + + Module->DisplayInfo( this ); + + DIALOG_GLOBAL_PADS_EDITION* dlg = new DIALOG_GLOBAL_PADS_EDITION( this, aPad ); + dlg->m_buttonIdModules->Enable( false ); + + diag = dlg->ShowModal(); + dlg->Destroy(); + + if( diag == -1 ) + return; + + bool edit_Same_Modules = false; + if( diag == 1 ) + edit_Same_Modules = true; + + GlobalChange_PadSettings( aPad,edit_Same_Modules, + DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter, + DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter, + DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter, + true, false ); +} + +/* + * Function GlobalChange_PadSettings + * Function to change pad caracteristics for the given footprint + * or alls footprints which look like the given footprint + * aPad is the pattern. The given footprint is the parent of this pad + * aSameFootprints: if true, make changes on all identical footprints + * aPadShapeFilter: if true, make changes only on pads having the same shape as aPad + * aPadOrientFilter: if true, make changes only on pads having the same orientation as aPad + * aPadLayerFilter: if true, make changes only on pads having the same layers as aPad + * aRedraw: if true: redraws the footprint + * aSaveForUndo: if true: create an entry in the Undo/Redo list + * (usually: true in Schematic editor, false in Module editor) + */ +void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad, + bool aSameFootprints, + bool aPadShapeFilter, + bool aPadOrientFilter, + bool aPadLayerFilter, + bool aRedraw, bool aSaveForUndo ) +{ + if( aPad == NULL ) + aPad = &g_Pad_Master; + + MODULE* Module = (MODULE*) aPad->GetParent(); + + if( Module == NULL ) + { + DisplayError( this, wxT( "Global_Import_Pad_Settings() Error: NULL module" ) ); + return; + } + /* Search and copy the name of library reference. */ - Module_Ref = Module; + MODULE* Module_Ref = Module; int pad_orient = aPad->m_Orient - Module_Ref->m_Orient; // Prepare an undo list: - PICKED_ITEMS_LIST itemsList; - Module = (MODULE*) m_Pcb->m_Modules; - for( ; Module != NULL; Module = Module->Next() ) + if( aSaveForUndo ) { - if( !edit_Same_Modules && (Module != Module_Ref) ) - continue; - - if( Module->m_LibRef != Module_Ref->m_LibRef ) - continue; - - bool saveMe = false; - D_PAD* pt_pad = (D_PAD*) Module->m_Pads; - - for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) + PICKED_ITEMS_LIST itemsList; + Module = (MODULE*) m_Pcb->m_Modules; + for( ; Module != NULL; Module = Module->Next() ) { - /* Filters changes prohibited. */ - if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter - && ( pt_pad->m_PadShape != aPad->m_PadShape ) ) + if( !aSameFootprints && (Module != Module_Ref) ) continue; - if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter - && ( (pt_pad->m_Orient - Module->m_Orient) != pad_orient ) ) + if( Module->m_LibRef != Module_Ref->m_LibRef ) continue; - if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter - && ( pt_pad->m_layerMask != aPad->m_layerMask ) ) - continue; + bool saveMe = false; + D_PAD* pt_pad = (D_PAD*) Module->m_Pads; - saveMe = true; + for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) + { + /* Filters changes prohibited. */ + if( aPadShapeFilter && ( pt_pad->m_PadShape != aPad->m_PadShape ) ) + continue; + + int currpad_orient = pt_pad->m_Orient - Module->m_Orient; + if( aPadOrientFilter && ( currpad_orient != pad_orient ) ) + continue; + + if( aPadLayerFilter + && ( pt_pad->m_layerMask != aPad->m_layerMask ) ) + continue; + + saveMe = true; + } + + if( saveMe ) + { + ITEM_PICKER itemWrapper( Module, UR_CHANGED ); + itemWrapper.m_PickedItemType = Module->Type(); + itemsList.PushItem( itemWrapper ); + } } - if( saveMe ) - { - ITEM_PICKER itemWrapper( Module, UR_CHANGED ); - itemWrapper.m_PickedItemType = Module->Type(); - itemsList.PushItem( itemWrapper ); - } + SaveCopyInUndoList( itemsList, UR_CHANGED ); } - SaveCopyInUndoList( itemsList, UR_CHANGED ); - /* Update the current module and same others modules if requested. */ - Module = (MODULE*) m_Pcb->m_Modules; + Module = m_Pcb->m_Modules; for( ; Module != NULL; Module = Module->Next() ) { - if( !edit_Same_Modules && (Module != Module_Ref) ) + if( !aSameFootprints && (Module != Module_Ref) ) continue; if( Module->m_LibRef != Module_Ref->m_LibRef ) continue; /* Erase module on screen */ - if( aDraw ) + if( aRedraw ) { Module->SetFlags( DO_NOT_DRAW ); m_canvas->RefreshDrawingRect( Module->GetBoundingBox() ); Module->ClearFlags( DO_NOT_DRAW ); } - D_PAD* pt_pad = (D_PAD*) Module->m_Pads; + D_PAD* pt_pad = Module->m_Pads; for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) { - /* Filters changes prohibited. */ - if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter - && ( pt_pad->m_PadShape != aPad->m_PadShape ) ) + // Filters changes prohibited. + if( aPadShapeFilter && ( pt_pad->m_PadShape != aPad->m_PadShape ) ) continue; - if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter + if( aPadOrientFilter && ( (pt_pad->m_Orient - Module->m_Orient) != pad_orient ) ) continue; - if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter ) + if( aPadLayerFilter ) { if( pt_pad->m_layerMask != aPad->m_layerMask ) continue; @@ -229,7 +312,7 @@ void PCB_BASE_FRAME::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) m_Pcb->m_Status_Pcb &= ~( LISTE_RATSNEST_ITEM_OK | CONNEXION_OK); } - /* Change characteristics.: */ + // Change characteristics: pt_pad->m_Attribut = aPad->m_Attribut; pt_pad->m_PadShape = aPad->m_PadShape; @@ -278,7 +361,7 @@ void PCB_BASE_FRAME::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) Module->CalculateBoundingBox(); - if( aDraw ) + if( aRedraw ) m_canvas->RefreshDrawingRect( Module->GetBoundingBox() ); } diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 0fc5420fc7..b1cdd0d782 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -512,7 +512,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS: SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); - Global_Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true ); + // Calls the global change dialog: + DlgGlobalChange_PadSettings( (D_PAD*) GetScreen()->GetCurItem() ); m_canvas->MoveCursorToCrossHair(); break; diff --git a/pcbnew/module_editor_frame.h b/pcbnew/module_editor_frame.h index a34d5170e7..40ecf52b92 100644 --- a/pcbnew/module_editor_frame.h +++ b/pcbnew/module_editor_frame.h @@ -334,6 +334,15 @@ public: /* Function to place a graphic item type EDGE_MODULE currently moved */ void Place_EdgeMod( EDGE_MODULE* drawitem ); + /** + * Function DlgGlobalChange_PadSettings + * Function to change pad caracteristics for the given footprint + * or all footprints which look like the given footprint + * Options are set by the opened dialog. + * @param aPad is the pattern. The given footprint is the parent of this pad + */ + void DlgGlobalChange_PadSettings( D_PAD* aPad ); + // handlers for libraries: void Delete_Module_In_Library( const wxString& libname ); From e420623fdec1a48631ae63c976af0d630a205aa8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 30 Dec 2011 13:44:02 +0100 Subject: [PATCH 07/12] Commit forgotten file --- bitmaps_png/sources/edit_comp_footprint.svg | 526 +++++++++++++++++--- 1 file changed, 462 insertions(+), 64 deletions(-) diff --git a/bitmaps_png/sources/edit_comp_footprint.svg b/bitmaps_png/sources/edit_comp_footprint.svg index 60234aab57..fb2b24fa5c 100644 --- a/bitmaps_png/sources/edit_comp_footprint.svg +++ b/bitmaps_png/sources/edit_comp_footprint.svg @@ -1,67 +1,465 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + DIP From 3f15b9c057eaffd0e0e0be72d0b08fc0af0ab330 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 30 Dec 2011 20:04:40 +0100 Subject: [PATCH 08/12] Eeschema: Fix issue in Search/ReplaceAll Pcbnew: fix a very minor issue. --- eeschema/class_libentry.cpp | 7 +- eeschema/dialogs/dialog_sch_find.fbp | 663 +++++++++++++++++- .../dialogs/dialog_schematic_find_base.cpp | 5 +- eeschema/dialogs/dialog_schematic_find_base.h | 13 +- eeschema/find.cpp | 6 +- pcbnew/files.cpp | 1 - pcbnew/initpcb.cpp | 8 + 7 files changed, 686 insertions(+), 17 deletions(-) diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index b06350f400..2e2c0c3642 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -756,7 +756,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) if( ( p = strtok( NULL, " \t\n" ) ) != NULL && *p == 'P' ) m_options = ENTRY_POWER; - /* Read next lines */ + // Read next lines, until "ENDDEF" is found while( aLineReader.ReadLine() ) { line = aLineReader.Line(); @@ -766,11 +766,14 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) /* This is the error flag ( if an error occurs, Res = FALSE) */ Res = true; + if( *line == '#' ) // a comment + continue; + if( (*line == 'T') && (*(line + 1) == 'i') ) Res = LoadDateAndTime( aLineReader ); else if( *line == 'F' ) Res = LoadField( aLineReader, Msg ); - else if( strcmp( p, "ENDDEF" ) == 0 ) + else if( strcmp( p, "ENDDEF" ) == 0 ) // End of component description break; else if( strcmp( p, "DRAW" ) == 0 ) Res = LoadDrawEntries( aLineReader, Msg ); diff --git a/eeschema/dialogs/dialog_sch_find.fbp b/eeschema/dialogs/dialog_sch_find.fbp index ed18566f2a..a12f77090f 100644 --- a/eeschema/dialogs/dialog_sch_find.fbp +++ b/eeschema/dialogs/dialog_sch_find.fbp @@ -7,6 +7,7 @@ 1 source_name 0 + res UTF-8 connect dialog_schematic_find_base @@ -22,25 +23,57 @@ 0 0 + 1 + 1 + 1 + 1 + 0 + + + + 1 wxBOTH + 0 + 1 1 + 0 + Dock + 0 + Left 1 impl_virtual + 1 + 0 0 wxID_ANY + + + 0 + + 0 + 1 DIALOG_SCH_FIND_BASE + 1 + + + 1 - + + Resizable + + 1 + 334,225 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Find + 0 wxFILTER_NONE @@ -51,6 +84,12 @@ + + + + + + OnClose @@ -114,23 +153,54 @@ wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY &Search for: + + + 0 + + 0 + 1 m_staticText1 + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -170,23 +240,54 @@ wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + + 0 + + 0 125,-1 + 1 m_comboFind + 1 + + protected + 1 + + Resizable + + 1 wxCB_DROPDOWN + 0 wxFILTER_NONE @@ -229,23 +330,54 @@ wxALIGN_CENTER_VERTICAL|wxALL 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_ANY Replace &with: + + + 0 + + 0 + 1 m_staticReplace + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -285,23 +417,54 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_ANY + + + 0 + + 0 + 1 m_comboReplace + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -344,23 +507,54 @@ 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_ANY Direction: + + + 0 + + 0 + 1 m_staticDirection + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -409,23 +603,54 @@ wxALL 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_ANY F&orward + + + 0 + + 0 + 1 m_radioForward + 1 + + protected + 1 + + Resizable + + 1 wxRB_GROUP + 0 wxFILTER_NONE @@ -466,23 +691,54 @@ wxALL 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_ANY &Backward + + + 0 + + 0 + 1 m_radioBackward + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -527,24 +783,55 @@ wxALL 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 1 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Match whole wor&d + + + 0 + + 0 + 1 m_checkWholeWord + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -584,24 +871,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY &Match case + + + 0 + + 0 + 1 m_checkMatchCase + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -641,24 +959,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Search &using simple wildcard matching + + + 0 + + 0 + 1 m_checkWildcardMatch + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -698,24 +1047,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 1 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Wrap around &end of search list + + + 0 + + 0 + 1 m_checkWrap + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -755,24 +1135,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Search all com&ponent fields + + + 0 + + 0 + 1 m_checkAllFields + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -812,24 +1223,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Search all pin &names and numbers + + + 0 + + 0 + 1 m_checkAllPins + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -869,24 +1311,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Search the current &sheet onl&y + + + 0 + + 0 + 1 m_checkCurrentSheetOnly + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -926,24 +1399,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_ANY Replace componen&t reference designators + + + 0 + + 0 + 1 m_checkReplaceReferences + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -983,24 +1487,55 @@ wxBOTTOM|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY D&o not warp cursor to found item + + + 0 + + 0 + 1 m_checkNoWarpCursor + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -1051,24 +1586,55 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_FIND &Find + + + 0 + + 0 + 1 m_buttonFind + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -1108,24 +1674,55 @@ wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_REPLACE &Replace + + + 0 + + 0 + 1 m_buttonReplace + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -1165,24 +1762,55 @@ wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 1 wxID_REPLACE_ALL Replace &All + + + 0 + + 0 + 1 m_buttonReplaceAll + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -1222,24 +1850,55 @@ wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 1 0 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_CANCEL - Cancel + Close + + + 0 + + 0 + 1 m_buttonCancel + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE diff --git a/eeschema/dialogs/dialog_schematic_find_base.cpp b/eeschema/dialogs/dialog_schematic_find_base.cpp index c77391edff..d4eb862ef7 100644 --- a/eeschema/dialogs/dialog_schematic_find_base.cpp +++ b/eeschema/dialogs/dialog_schematic_find_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Jun 30 2011) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -117,14 +117,13 @@ DIALOG_SCH_FIND_BASE::DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id, con rightSizer->Add( m_buttonReplaceAll, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 6 ); - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); rightSizer->Add( m_buttonCancel, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 6 ); mainSizer->Add( rightSizer, 0, wxALL|wxEXPAND, 6 ); this->SetSizer( mainSizer ); this->Layout(); - mainSizer->Fit( this ); this->Centre( wxBOTH ); diff --git a/eeschema/dialogs/dialog_schematic_find_base.h b/eeschema/dialogs/dialog_schematic_find_base.h index b8b0c411a3..dfb6a36bab 100644 --- a/eeschema/dialogs/dialog_schematic_find_base.h +++ b/eeschema/dialogs/dialog_schematic_find_base.h @@ -1,15 +1,16 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Jun 30 2011) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_schematic_find_base__ -#define __dialog_schematic_find_base__ +#ifndef __DIALOG_SCHEMATIC_FIND_BASE_H__ +#define __DIALOG_SCHEMATIC_FIND_BASE_H__ +#include +#include #include - #include #include #include @@ -69,9 +70,9 @@ class DIALOG_SCH_FIND_BASE : public wxDialog public: - DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 334,225 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_SCH_FIND_BASE(); }; -#endif //__dialog_schematic_find_base__ +#endif //__DIALOG_SCHEMATIC_FIND_BASE_H__ diff --git a/eeschema/find.cpp b/eeschema/find.cpp index 756bed516c..3e305ee392 100644 --- a/eeschema/find.cpp +++ b/eeschema/find.cpp @@ -403,6 +403,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent ) if( m_foundItems.ReplaceItem() ) { + OnModify(); SaveUndoItemInUndoList( undoItem ); RedrawScreen( data.GetPosition(), warpCursor ); } @@ -411,9 +412,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent ) if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL ) { - item = (SCH_ITEM*) m_foundItems.GetItem( data ); - - while( item != NULL ) + while( ( item = (SCH_ITEM*) m_foundItems.GetItem( data ) ) != NULL ) { wxLogTrace( traceFindReplace, wxT( "Replacing %s with %s in item %s" ), GetChars( aEvent.GetFindString() ), GetChars( aEvent.GetReplaceString() ), @@ -429,6 +428,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent ) if( m_foundItems.ReplaceItem() ) { + OnModify(); SaveUndoItemInUndoList( undoItem ); RedrawScreen( data.GetPosition(), warpCursor ); } diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 71764e7ac3..443acc836d 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -300,7 +300,6 @@ this file again." ) ); } catch( IO_ERROR ioe ) { - wxMessageBox( _( "catch" ) ); wxString msg = wxString::Format( _( "Error loading board.\n%s" ), ioe.errorText.GetData() ); wxMessageBox( msg, _( "Open Board File" ), wxOK | wxICON_ERROR ); diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index 5f52b08059..29b4fab5dd 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -37,9 +37,17 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery ) // Clear undo and redo lists because we want a full deletion GetScreen()->ClearUndoRedoList(); + /* Items visibility flags will be set becuse a new board will be created. + * Grid and ratsnest can be left to their previous state + */ + bool showGrid = IsElementVisible( GRID_VISIBLE ); + bool showRats = IsElementVisible( RATSNEST_VISIBLE ); // delete the old BOARD and create a new BOARD so that the default // layer names are put into the BOARD. SetBoard( new BOARD() ); + SetElementVisibility( GRID_VISIBLE, showGrid ); + SetElementVisibility( RATSNEST_VISIBLE, showRats ); + SetCurItem( NULL ); /* clear filename, to avoid overwriting an old file */ From 0ba26e1d8ffc8426f7e073d77fc9cc6beca1dea9 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 2 Jan 2012 15:45:46 -0500 Subject: [PATCH 09/12] Remove unused EDA_ITEM list from BASE_SCREEN. --- common/base_screen.cpp | 16 ---------------- include/class_base_screen.h | 14 +------------- include/class_sch_screen.h | 7 ------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/common/base_screen.cpp b/common/base_screen.cpp index 2d0b8c5c60..1ef0b27de1 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -498,22 +498,6 @@ PICKED_ITEMS_LIST* BASE_SCREEN::PopCommandFromRedoList( ) } -void BASE_SCREEN::AddItem( EDA_ITEM* aItem ) -{ - wxCHECK_RET( aItem != NULL, wxT( "Attempt to add NULL item pointer to " ) + GetClass() + - wxT( "item list" ) ); - m_items.push_back( aItem ); -} - - -void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_ITEM* aItem ) -{ - wxCHECK_RET( aItem != NULL, wxT( "Attempt to insert NULL item pointer to " ) + GetClass() + - wxT( "item list" ) ); - m_items.insert( aIter, aItem ); -} - - #if defined(DEBUG) void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const diff --git a/include/class_base_screen.h b/include/class_base_screen.h index 04c004fa37..9c70c07aa4 100644 --- a/include/class_base_screen.h +++ b/include/class_base_screen.h @@ -76,7 +76,7 @@ typedef std::vector< GRID_TYPE > GRIDS; */ class BASE_SCREEN : public EDA_ITEM { - EDA_ITEMS m_items; ///< The drawing items associated with this screen. +// EDA_ITEMS m_items; ///< The drawing items associated with this screen. GRIDS m_grids; ///< List of valid grid sizes. EDA_ITEM* m_drawList; ///< Object list for the screen. wxString m_fileName; ///< File used to load the screen. @@ -446,18 +446,6 @@ public: return wxT( "BASE_SCREEN" ); } - /** - * Helpers for accessing the draw item list. - */ - EDA_ITEMS::iterator Begin() { return m_items.begin(); } - EDA_ITEMS::iterator End() { return m_items.end(); } - virtual void AddItem( EDA_ITEM* aItem ); - virtual void InsertItem( EDA_ITEMS::iterator aIter, EDA_ITEM* aItem ); - - /** - * Function IsBlockActive - * returns true if a block command is in progress. - */ inline bool IsBlockActive() const { return !m_BlockLocate.IsIdle(); } void ClearBlockCommand() { m_BlockLocate.Clear(); } diff --git a/include/class_sch_screen.h b/include/class_sch_screen.h index 44705ac683..7f9b4b50a5 100644 --- a/include/class_sch_screen.h +++ b/include/class_sch_screen.h @@ -449,13 +449,6 @@ public: * @return The number of items in the pick list. */ int UpdatePickList(); - - virtual void AddItem( SCH_ITEM* aItem ) { BASE_SCREEN::AddItem( (EDA_ITEM*) aItem ); } - - virtual void InsertItem( EDA_ITEMS::iterator aIter, SCH_ITEM* aItem ) - { - BASE_SCREEN::InsertItem( aIter, (EDA_ITEM*) aItem ); - } }; From b774d96fb0a9aa6c4fe82e1ac22e0aa8a36dd73d Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 3 Jan 2012 12:14:17 -0500 Subject: [PATCH 10/12] Minor coding policy and code readability improvements. --- common/base_struct.cpp | 6 +- common/class_plotter.cpp | 18 +++--- common/common_plotDXF_functions.cpp | 14 +++-- common/common_plotGERBER_functions.cpp | 12 ++-- common/common_plotHPGL_functions.cpp | 17 ++--- common/common_plotPS_functions.cpp | 8 +-- common/drawtxt.cpp | 8 +-- .../dialog_edit_component_in_schematic.cpp | 4 +- .../dialog_edit_libentry_fields_in_lib.cpp | 4 +- eeschema/sch_component.cpp | 4 +- eeschema/sch_field.cpp | 4 +- gerbview/gerbview_frame.h | 6 +- include/base_struct.h | 33 +++++----- include/class_base_screen.h | 1 - include/drawtxt.h | 4 +- include/plot_common.h | 61 +++++++++--------- include/wxBasePcbFrame.h | 20 +++--- pcbnew/basepcbframe.cpp | 4 +- pcbnew/class_dimension.cpp | 4 +- pcbnew/class_drawsegment.cpp | 13 ++-- pcbnew/class_edge_mod.cpp | 8 +-- pcbnew/class_mire.cpp | 6 +- pcbnew/class_pcb_text.cpp | 3 +- pcbnew/class_text_mod.cpp | 2 +- pcbnew/dialogs/dialog_pcb_text_properties.cpp | 2 +- pcbnew/gen_drill_report_files.cpp | 2 +- pcbnew/kicad_plugin.cpp | 4 +- pcbnew/pcb_plot_params.cpp | 2 +- pcbnew/pcb_plot_params.h | 2 +- pcbnew/pcbplot.cpp | 2 +- pcbnew/pcbplot.h | 12 ++-- pcbnew/plot_rtn.cpp | 62 ++++++++++--------- pcbnew/plotdxf.cpp | 2 +- pcbnew/plotgerb.cpp | 2 +- pcbnew/plothpgl.cpp | 2 +- pcbnew/plotps.cpp | 2 +- 36 files changed, 183 insertions(+), 177 deletions(-) diff --git a/common/base_struct.cpp b/common/base_struct.cpp index cf09a6d4c2..5d1655e39a 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -427,7 +427,7 @@ bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_Colors aColor, int aDrawMode, - GRTraceMode aFillMode, EDA_Colors aAnchor_color ) + EDA_DRAW_MODE_T aFillMode, EDA_Colors aAnchor_color ) { if( m_MultilineAllowed ) { @@ -471,13 +471,13 @@ void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_Colors aColor, - int aDrawMode, GRTraceMode aFillMode, + int aDrawMode, EDA_DRAW_MODE_T aFillMode, EDA_Colors aAnchor_color, wxString& aText, wxPoint aPos ) { int width = m_Thickness; - if( aFillMode == FILAIRE ) + if( aFillMode == LINE ) width = 0; if( aDrawMode != -1 ) diff --git a/common/class_plotter.cpp b/common/class_plotter.cpp index e86267dc69..1908b9d64b 100644 --- a/common/class_plotter.cpp +++ b/common/class_plotter.cpp @@ -254,7 +254,7 @@ void PLOTTER::marker( const wxPoint& position, int diametre, int aShapeId ) /* Convert a thick segment and plot it as an oval */ void PLOTTER::segment_as_oval( wxPoint start, wxPoint end, int width, - GRTraceMode tracemode ) + EDA_DRAW_MODE_T tracemode ) { wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 ); wxSize size( end.x - start.x, end.y - start.y ); @@ -328,12 +328,12 @@ void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient, /* Plot 1 segment like a track segment */ void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, - GRTraceMode tracemode ) + EDA_DRAW_MODE_T tracemode ) { switch( tracemode ) { case FILLED: - case FILAIRE: + case LINE: set_current_line_width( tracemode==FILLED ? width : -1 ); move_to( start ); finish_to( end ); @@ -348,11 +348,11 @@ void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius, - int width, GRTraceMode tracemode ) + int width, EDA_DRAW_MODE_T tracemode ) { switch( tracemode ) { - case FILAIRE: + case LINE: set_current_line_width( -1 ); arc( centre, StAngle, EndAngle, radius, NO_FILL, -1 ); break; @@ -373,11 +373,11 @@ void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius, void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width, - GRTraceMode tracemode ) + EDA_DRAW_MODE_T tracemode ) { switch( tracemode ) { - case FILAIRE: + case LINE: rect( p1, p2, NO_FILL, -1 ); break; @@ -403,11 +403,11 @@ void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width, void PLOTTER::thick_circle( wxPoint pos, int diametre, int width, - GRTraceMode tracemode ) + EDA_DRAW_MODE_T tracemode ) { switch( tracemode ) { - case FILAIRE: + case LINE: circle( pos, diametre, NO_FILL, -1 ); break; diff --git a/common/common_plotDXF_functions.cpp b/common/common_plotDXF_functions.cpp index 85a50b6790..165da464f8 100644 --- a/common/common_plotDXF_functions.cpp +++ b/common/common_plotDXF_functions.cpp @@ -213,15 +213,17 @@ void DXF_PLOTTER::set_dash( bool dashed ) * @param aPlotMode = FILLED, SKETCH .. */ void DXF_PLOTTER::thick_segment( wxPoint aStart, wxPoint aEnd, int aWidth, - GRTraceMode aPlotMode ) + EDA_DRAW_MODE_T aPlotMode ) { - if( aPlotMode == FILAIRE ) /* just a line is Ok */ + if( aPlotMode == LINE ) /* just a line is Ok */ { move_to( aStart ); finish_to( aEnd ); } else + { segment_as_oval( aStart, aEnd, aWidth, aPlotMode ); + } } @@ -253,7 +255,7 @@ void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius, /* Plot oval pad at position. */ void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); @@ -272,7 +274,7 @@ void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, /* Plot round pad or via. */ void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); circle( pos, diametre, NO_FILL ); @@ -283,7 +285,7 @@ void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, * Plot rectangular pad vertical or horizontal (rectangular Pad) */ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, - int orient, GRTraceMode trace_mode ) + int orient, EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); wxSize size; @@ -353,7 +355,7 @@ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, * Plot mode = FILLED, SKETCH (unused) */ void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ) + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) { wxASSERT( output_file ); wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */ diff --git a/common/common_plotGERBER_functions.cpp b/common/common_plotGERBER_functions.cpp index ee9506eee9..bced1d6f22 100644 --- a/common/common_plotGERBER_functions.cpp +++ b/common/common_plotGERBER_functions.cpp @@ -369,14 +369,14 @@ void GERBER_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFac /* Function flash_pad_circle * Plot a circular pad or via at the user position pos */ -void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, GRTraceMode trace_mode ) +void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); wxSize size( diametre, diametre ); switch( trace_mode ) { - case FILAIRE: + case LINE: case SKETCH: set_current_line_width( -1 ); circle( pos, diametre - current_pen_width, NO_FILL ); @@ -398,7 +398,7 @@ void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, GRTraceMode tr * For any orientation the shape is drawn as a segment */ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); int x0, y0, x1, y1, delta; @@ -455,7 +455,7 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, * For others shape the direction is plotted as a polygon. */ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ) + int orient, EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); @@ -472,7 +472,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, case 1800: switch( trace_mode ) { - case FILAIRE: + case LINE: case SKETCH: set_current_line_width( -1 ); rect( wxPoint( pos.x - (size.x - current_pen_width) / 2, @@ -522,7 +522,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, * Plot mode = FILLED or SKETCH */ void GERBER_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ) + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) { // polygon corners list diff --git a/common/common_plotHPGL_functions.cpp b/common/common_plotHPGL_functions.cpp index 0f85c9ecec..d19689266a 100644 --- a/common/common_plotHPGL_functions.cpp +++ b/common/common_plotHPGL_functions.cpp @@ -203,13 +203,13 @@ void HPGL_PLOTTER::set_dash( bool dashed ) * @param width = segment width (thickness) * @param tracemode = FILLED, SKETCH .. */ -void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, GRTraceMode tracemode ) +void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, EDA_DRAW_MODE_T tracemode ) { wxASSERT( output_file ); wxPoint center; wxSize size; - if( (pen_diameter >= width) || (tracemode == FILAIRE) ) /* just a line is + if( (pen_diameter >= width) || (tracemode == LINE) ) /* just a line is * Ok */ { move_to( start ); @@ -266,7 +266,7 @@ void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, /* Plot oval pad. */ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); int deltaxy, cx, cy; @@ -305,7 +305,7 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, /* Plot round pad or via. */ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); int rayon, delta; @@ -314,7 +314,8 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, delta = wxRound( pen_diameter - pen_overlap ); rayon = diametre / 2; - if( trace_mode != FILAIRE ) + + if( trace_mode != LINE ) { rayon = ( diametre - wxRound( pen_diameter ) ) / 2; } @@ -356,7 +357,7 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, * Units are user units */ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, - int orient, GRTraceMode trace_mode ) + int orient, EDA_DRAW_MODE_T trace_mode ) { wxASSERT( output_file ); wxSize size; @@ -366,7 +367,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, size.x = padsize.x / 2; size.y = padsize.y / 2; - if( trace_mode != FILAIRE ) + if( trace_mode != LINE ) { size.x = (padsize.x - (int) pen_diameter) / 2; size.y = (padsize.y - (int) pen_diameter) / 2; @@ -474,7 +475,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, * Plot mode FILLED or SKETCH */ void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ) + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) { wxASSERT( output_file ); wxPoint polygone[4]; // coordinates of corners relatives to the pad diff --git a/common/common_plotPS_functions.cpp b/common/common_plotPS_functions.cpp index ca195ec38d..4eefbb4bfd 100644 --- a/common/common_plotPS_functions.cpp +++ b/common/common_plotPS_functions.cpp @@ -454,7 +454,7 @@ bool PS_PLOTTER::end_plot() * The shape is drawn as a segment */ void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode modetrace ) + EDA_DRAW_MODE_T modetrace ) { wxASSERT( output_file ); int x0, y0, x1, y1, delta; @@ -487,7 +487,7 @@ void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, /* Plot round pad or via. */ void PS_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode modetrace ) + EDA_DRAW_MODE_T modetrace ) { wxASSERT( output_file ); @@ -507,7 +507,7 @@ void PS_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, /* Plot rectangular pad in any orientation. */ void PS_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ) + int orient, EDA_DRAW_MODE_T trace_mode ) { static std::vector< wxPoint > cornerList; cornerList.clear(); @@ -555,7 +555,7 @@ void PS_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, * Plot mode FILLED or SKETCH */ void PS_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ) + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) { static std::vector< wxPoint > cornerList; cornerList.clear(); diff --git a/common/drawtxt.cpp b/common/drawtxt.cpp index 90991306b9..e2913226cf 100644 --- a/common/drawtxt.cpp +++ b/common/drawtxt.cpp @@ -230,8 +230,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, const wxString& aText, int aOrient, const wxSize& aSize, - enum GRTextHorizJustifyType aH_justify, - enum GRTextVertJustifyType aV_justify, + enum EDA_TEXT_HJUSTIFY_T aH_justify, + enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, @@ -521,8 +521,8 @@ void PLOTTER::text( const wxPoint& aPos, const wxString& aText, int aOrient, const wxSize& aSize, - enum GRTextHorizJustifyType aH_justify, - enum GRTextVertJustifyType aV_justify, + enum EDA_TEXT_HJUSTIFY_T aH_justify, + enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold ) diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index ba310c121d..94fe42f810 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -685,12 +685,12 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField() rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT ); // Copy the text justification - GRTextHorizJustifyType hjustify[3] = { + EDA_TEXT_HJUSTIFY_T hjustify[3] = { GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_RIGHT }; - GRTextVertJustifyType vjustify[3] = { + EDA_TEXT_VJUSTIFY_T vjustify[3] = { GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP }; diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp index 9f0e8018d6..1717826ad2 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp @@ -712,12 +712,12 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField() field.m_Orient = TEXT_ORIENT_HORIZ; // Copy the text justification - static const GRTextHorizJustifyType hjustify[3] = { + static const EDA_TEXT_HJUSTIFY_T hjustify[3] = { GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_RIGHT }; - static const GRTextVertJustifyType vjustify[3] = { + static const EDA_TEXT_VJUSTIFY_T vjustify[3] = { GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP }; diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index d812bcec20..4bfd9547fa 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1252,8 +1252,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg ) int fieldNdx; wxString fieldText; - GRTextHorizJustifyType hjustify = GR_TEXT_HJUSTIFY_CENTER; - GRTextVertJustifyType vjustify = GR_TEXT_VJUSTIFY_CENTER; + EDA_TEXT_HJUSTIFY_T hjustify = GR_TEXT_HJUSTIFY_CENTER; + EDA_TEXT_VJUSTIFY_T vjustify = GR_TEXT_VJUSTIFY_CENTER; ptcar = (char*) aLine; diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index c4a8dd0671..3cf24b4c58 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -546,8 +546,8 @@ void SCH_FIELD::doPlot( PLOTTER* aPlotter ) * and use GetBoundaryBox to know the text coordinate considered as centered */ EDA_RECT BoundaryBox = GetBoundingBox(); - GRTextHorizJustifyType hjustify = GR_TEXT_HJUSTIFY_CENTER; - GRTextVertJustifyType vjustify = GR_TEXT_VJUSTIFY_CENTER; + EDA_TEXT_HJUSTIFY_T hjustify = GR_TEXT_HJUSTIFY_CENTER; + EDA_TEXT_VJUSTIFY_T vjustify = GR_TEXT_VJUSTIFY_CENTER; wxPoint textpos = BoundaryBox.Centre(); int thickness = GetPenSize(); diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index 0733388363..d2d14baefe 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -459,12 +459,12 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, void Genere_GERBER( const wxString& FullFileName, int Layers ); void Genere_PS( const wxString& FullFileName, int Layers ); void Plot_Layer_HPGL( FILE* File, int masque_layer,int garde, bool trace_via, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); void Plot_Layer_GERBER( FILE* File, int masque_layer, int garde, bool trace_via, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); int Gen_D_CODE_File( const wxString& Name_File ); void Plot_Layer_PS( FILE* File, int masque_layer, int garde, bool trace_via, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); void Files_io( wxCommandEvent& event ); diff --git a/include/base_struct.h b/include/base_struct.h index f286735f31..2c441b541b 100644 --- a/include/base_struct.h +++ b/include/base_struct.h @@ -746,25 +746,24 @@ typedef std::vector< EDA_ITEM* > EDA_ITEMS; // Graphic Text justify: // Values -1,0,1 are used in computations, do not change them -enum GRTextHorizJustifyType { +enum EDA_TEXT_HJUSTIFY_T { GR_TEXT_HJUSTIFY_LEFT = -1, GR_TEXT_HJUSTIFY_CENTER = 0, GR_TEXT_HJUSTIFY_RIGHT = 1 }; -enum GRTextVertJustifyType { - GR_TEXT_VJUSTIFY_TOP = -1, +enum EDA_TEXT_VJUSTIFY_T { + GR_TEXT_VJUSTIFY_TOP = -1, GR_TEXT_VJUSTIFY_CENTER = 0, GR_TEXT_VJUSTIFY_BOTTOM = 1 }; /* Options to show solid segments (segments, texts...) */ -enum GRTraceMode { - FILAIRE = 0, // segments are drawn as lines +enum EDA_DRAW_MODE_T { + LINE = 0, // segments are drawn as lines FILLED, // normal mode: segments have thickness - SKETCH // sketch mode: segments have thickness, but are not - // filled + SKETCH // sketch mode: segments have thickness, but are not filled }; /** @@ -803,8 +802,8 @@ public: int m_Attributs; ///< bit flags such as visible, etc. bool m_Italic; ///< should be italic font (if available) bool m_Bold; ///< should be bold font (if available) - GRTextHorizJustifyType m_HJustify; ///< horizontal justification - GRTextVertJustifyType m_VJustify; ///< vertical justification + EDA_TEXT_HJUSTIFY_T m_HJustify; ///< horizontal justification + EDA_TEXT_VJUSTIFY_T m_VJustify; ///< vertical justification bool m_MultilineAllowed; /**< true to use multiline option, false * to use only single line text @@ -866,12 +865,12 @@ public: * @param aOffset = draw offset (usually (0,0)) * @param aColor = text color * @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode. - * @param aDisplay_mode = FILAIRE, FILLED or SKETCH + * @param aDisplay_mode = LINE, FILLED or SKETCH * @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). */ void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_Colors aColor, - int aDrawMode, GRTraceMode aDisplay_mode = FILAIRE, + int aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = LINE, EDA_Colors aAnchor_color = UNSPECIFIED_COLOR ); private: @@ -885,14 +884,14 @@ private: * @param aOffset = draw offset (usually (0,0)) * @param aColor = text color * @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode. - * @param aFillMode = FILAIRE, FILLED or SKETCH + * @param aFillMode = LINE, FILLED or SKETCH * @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). * @param aText = the single line of text to draw. * @param aPos = the position of this line ). */ void DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_Colors aColor, - int aDrawMode, GRTraceMode aFillMode, + int aDrawMode, EDA_DRAW_MODE_T aFillMode, EDA_Colors aAnchor_color, wxString& aText, wxPoint aPos ); @@ -972,10 +971,10 @@ public: */ virtual const wxString GetText() const { return m_Text; } - GRTextHorizJustifyType GetHorizJustify() const { return m_HJustify; }; - GRTextVertJustifyType GetVertJustify() const { return m_VJustify; }; - void SetHorizJustify( GRTextHorizJustifyType aType ) { m_HJustify = aType; }; - void SetVertJustify( GRTextVertJustifyType aType ) { m_VJustify = aType; }; + EDA_TEXT_HJUSTIFY_T GetHorizJustify() const { return m_HJustify; }; + EDA_TEXT_VJUSTIFY_T GetVertJustify() const { return m_VJustify; }; + void SetHorizJustify( EDA_TEXT_HJUSTIFY_T aType ) { m_HJustify = aType; }; + void SetVertJustify( EDA_TEXT_VJUSTIFY_T aType ) { m_VJustify = aType; }; }; #endif // BASE_STRUCT_H_ diff --git a/include/class_base_screen.h b/include/class_base_screen.h index 9c70c07aa4..8b1339e003 100644 --- a/include/class_base_screen.h +++ b/include/class_base_screen.h @@ -76,7 +76,6 @@ typedef std::vector< GRID_TYPE > GRIDS; */ class BASE_SCREEN : public EDA_ITEM { -// EDA_ITEMS m_items; ///< The drawing items associated with this screen. GRIDS m_grids; ///< List of valid grid sizes. EDA_ITEM* m_drawList; ///< Object list for the screen. wxString m_fileName; ///< File used to load the screen. diff --git a/include/drawtxt.h b/include/drawtxt.h index 6ebadf6034..00db99f3b4 100644 --- a/include/drawtxt.h +++ b/include/drawtxt.h @@ -75,8 +75,8 @@ void DrawGraphicText( EDA_DRAW_PANEL * aPanel, const wxString &aText, int aOrient, const wxSize &aSize, - enum GRTextHorizJustifyType aH_justify, - enum GRTextVertJustifyType aV_justify, + enum EDA_TEXT_HJUSTIFY_T aH_justify, + enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, diff --git a/include/plot_common.h b/include/plot_common.h index 41aa46b316..207669049a 100644 --- a/include/plot_common.h +++ b/include/plot_common.h @@ -121,22 +121,22 @@ public: PLOTTER( PlotFormat aPlotType ); virtual void PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor ) = 0; virtual void thick_segment( wxPoint start, wxPoint end, int width, - GRTraceMode tracemode ); + EDA_DRAW_MODE_T tracemode ); virtual void thick_arc( wxPoint centre, int StAngle, int EndAngle, int rayon, - int width, GRTraceMode tracemode ); + int width, EDA_DRAW_MODE_T tracemode ); virtual void thick_rect( wxPoint p1, wxPoint p2, int width, - GRTraceMode tracemode ); + EDA_DRAW_MODE_T tracemode ); virtual void thick_circle( wxPoint pos, int diametre, int width, - GRTraceMode tracemode ); + EDA_DRAW_MODE_T tracemode ); virtual void pen_to( wxPoint pos, char plume ) = 0; // Flash primitives virtual void flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ) = 0; + EDA_DRAW_MODE_T trace_mode ) = 0; virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ) = 0; + EDA_DRAW_MODE_T trace_mode ) = 0; virtual void flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ) = 0; + int orient, EDA_DRAW_MODE_T trace_mode ) = 0; /** virtual function flash_pad_trapez * flash a trapezoidal pad @@ -146,7 +146,7 @@ public: PLOTTER( PlotFormat aPlotType ); * @param aTrace_Mode = FILLED or SKETCH */ virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ) = 0; + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) = 0; // Convenience functions void move_to( wxPoint pos ) @@ -180,12 +180,13 @@ public: PLOTTER( PlotFormat aPlotType ); const wxString& aText, int aOrient, const wxSize& aSize, - enum GRTextHorizJustifyType aH_justify, - enum GRTextVertJustifyType aV_justify, + enum EDA_TEXT_HJUSTIFY_T aH_justify, + enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold ); - void marker( const wxPoint& position, int diametre, int aShapeId ); + + void marker( const wxPoint& position, int diametre, int aShapeId ); /** * Function SetLayerPolarity @@ -202,7 +203,7 @@ protected: // Helper function for sketched filler segment void segment_as_oval( wxPoint start, wxPoint end, int width, - GRTraceMode tracemode ); + EDA_DRAW_MODE_T tracemode ); void sketch_oval( wxPoint pos, wxSize size, int orient, int width ); virtual void user_to_device_coordinates( wxPoint& pos ); @@ -303,19 +304,19 @@ public: HPGL_PLOTTER() : PLOTTER( PLOT_FORMAT_HPGL ) virtual void PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor ); virtual void thick_segment( wxPoint start, wxPoint end, int width, - GRTraceMode tracemode ); + EDA_DRAW_MODE_T tracemode ); virtual void arc( wxPoint centre, int StAngle, int EndAngle, int rayon, FILL_T fill, int width = -1 ); virtual void pen_to( wxPoint pos, char plume ); virtual void flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ); + int orient, EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ); + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ); virtual void SetLayerPolarity( bool aPositive ) {} @@ -380,14 +381,14 @@ public: PS_PLOTTER() : PLOTTER( PLOT_FORMAT_POST ) virtual void pen_to( wxPoint pos, char plume ); virtual void flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ); + int orient, EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ); + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ); virtual void SetLayerPolarity( bool aPositive ) {} @@ -459,14 +460,14 @@ public: GERBER_PLOTTER() : PLOTTER( PLOT_FORMAT_GERBER ) virtual void pen_to( wxPoint pos, char plume ); virtual void flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ); + int orient, EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ); + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ); virtual void SetLayerPolarity( bool aPositive ); @@ -538,19 +539,19 @@ public: DXF_PLOTTER() : PLOTTER( PLOT_FORMAT_DXF ) virtual void PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor ); virtual void thick_segment( wxPoint start, wxPoint end, int width, - GRTraceMode tracemode ); + EDA_DRAW_MODE_T tracemode ); virtual void arc( wxPoint centre, int StAngle, int EndAngle, int rayon, FILL_T fill, int width = -1 ); virtual void pen_to( wxPoint pos, char plume ); virtual void flash_pad_circle( wxPoint pos, int diametre, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_rect( wxPoint pos, wxSize size, - int orient, GRTraceMode trace_mode ); + int orient, EDA_DRAW_MODE_T trace_mode ); virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], - int aPadOrient, GRTraceMode aTrace_Mode ); + int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ); virtual void SetLayerPolarity( bool aPositive ) {} diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index e0ccdb8aeb..0cffc8a1df 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -507,24 +507,24 @@ public: bool ExportToGerberFile( const wxString& aFullFileName, int aLayer, bool aPlotOriginIsAuxAxis, - GRTraceMode aTraceMode ); + EDA_DRAW_MODE_T aTraceMode ); bool ExportToHpglFile( const wxString& aFullFileName, int aLayer, - GRTraceMode aTraceMode ); + EDA_DRAW_MODE_T aTraceMode ); bool ExportToPostScriptFile( const wxString& aFullFileName, int aLayer, bool aUseA4, - GRTraceMode aTraceMode ); + EDA_DRAW_MODE_T aTraceMode ); bool ExportToDxfFile( const wxString& aFullFileName, int aLayer, - GRTraceMode aTraceMode ); + EDA_DRAW_MODE_T aTraceMode ); - void Plot_Layer( PLOTTER* plotter, - int Layer, - GRTraceMode trace_mode ); + void Plot_Layer( PLOTTER* plotter, + int Layer, + EDA_DRAW_MODE_T trace_mode ); /** * Function Plot_Standard_Layer @@ -540,10 +540,10 @@ public: * have the same size. Used in GERBER format only. */ void Plot_Standard_Layer( PLOTTER* aPlotter, int aLayerMask, - bool aPlotVia, GRTraceMode aPlotMode, + bool aPlotVia, EDA_DRAW_MODE_T aPlotMode, bool aSkipNPTH_Pads = false ); - void PlotSilkScreen( PLOTTER* plotter, int masque_layer, GRTraceMode trace_mode ); + void PlotSilkScreen( PLOTTER* plotter, int masque_layer, EDA_DRAW_MODE_T trace_mode ); /** * Function PlotDrillMark @@ -556,7 +556,7 @@ public: * @param aSmallDrillShape = true to plot a small drill shape, false to * plot the actual drill shape */ - void PlotDrillMark( PLOTTER* aPlotter, GRTraceMode aTraceMode, bool aSmallDrillShape ); + void PlotDrillMark( PLOTTER* aPlotter, EDA_DRAW_MODE_T aTraceMode, bool aSmallDrillShape ); /* Functions relative to Undo/redo commands: */ diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 581b9c8266..93e788c47b 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -549,12 +549,12 @@ void PCB_BASE_FRAME::LoadSettings() cfg->Read( m_FrameName + FastGrid2Entry, &itmp, ( long )0); m_FastGrid2 = itmp; - if( m_DisplayModEdge < FILAIRE || m_DisplayModEdge > SKETCH ) + if( m_DisplayModEdge < LINE || m_DisplayModEdge > SKETCH ) m_DisplayModEdge = FILLED; cfg->Read( m_FrameName + DisplayModuleTextEntry, &m_DisplayModText, ( long )FILLED ); - if( m_DisplayModText < FILAIRE || m_DisplayModText > SKETCH ) + if( m_DisplayModText < LINE || m_DisplayModText > SKETCH ) m_DisplayModText = FILLED; // WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" ) diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index 02c58bcc15..6960f5cc50 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -347,11 +347,11 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxP width = m_Width; if( DC->LogicalToDeviceXRel( width ) < 2 ) - typeaff = FILAIRE; + typeaff = LINE; switch( typeaff ) { - case FILAIRE: + case LINE: width = 0; case FILLED: diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 3babf3f511..187ec05fed 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -187,14 +187,14 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx mode = SKETCH; if( l_trace < DC->DeviceToLogicalXRel( MIN_DRAW_WIDTH ) ) - mode = FILAIRE; + mode = LINE; switch( m_Shape ) { case S_CIRCLE: radius = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) ); - if( mode == FILAIRE ) + if( mode == LINE ) { GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, color ); } @@ -228,9 +228,8 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx } - if( mode == FILAIRE ) - GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, - radius, color ); + if( mode == LINE ) + GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, color ); else if( mode == SKETCH ) { @@ -249,7 +248,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx m_BezierPoints = Bezier2Poly(m_Start,m_BezierC1, m_BezierC2, m_End); for (unsigned int i=1; i < m_BezierPoints.size(); i++) { - if( mode == FILAIRE ) + if( mode == LINE ) GRLine( panel->GetClipBox(), DC, m_BezierPoints[i].x, m_BezierPoints[i].y, m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, 0, @@ -271,7 +270,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx } break; default: - if( mode == FILAIRE ) + if( mode == LINE ) { GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, 0, color ); } diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 6f586bc84f..81d7a3ff49 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -119,12 +119,12 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx } if( DC->LogicalToDeviceXRel( m_Width ) < MIN_DRAW_WIDTH ) - typeaff = FILAIRE; + typeaff = LINE; switch( type_trace ) { case S_SEGMENT: - if( typeaff == FILAIRE ) + if( typeaff == LINE ) GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, 0, color ); else if( typeaff == FILLED ) GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color ); @@ -137,7 +137,7 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx case S_CIRCLE: radius = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) ); - if( typeaff == FILAIRE ) + if( typeaff == LINE ) { GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, color ); } @@ -164,7 +164,7 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx if( StAngle > EndAngle ) EXCHG( StAngle, EndAngle ); - if( typeaff == FILAIRE ) + if( typeaff == LINE ) { GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, color ); } diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp index 3fd1525a32..2bd3867c00 100644 --- a/pcbnew/class_mire.cpp +++ b/pcbnew/class_mire.cpp @@ -88,13 +88,13 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx width = m_Width; if( DC->LogicalToDeviceXRel( width ) < 2 ) - typeaff = FILAIRE; + typeaff = LINE; radius = m_Size / 4; switch( typeaff ) { - case FILAIRE: + case LINE: width = 0; case FILLED: @@ -123,7 +123,7 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx switch( typeaff ) { - case FILAIRE: + case LINE: case FILLED: GRLine( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); GRLine( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index 71b5ea812c..c7235784a6 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -66,7 +66,8 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int color = brd->GetLayerColor( m_Layer ); - GRTraceMode fillmode = FILLED; + EDA_DRAW_MODE_T fillmode = FILLED; + if( DisplayOpt.DisplayDrawItems == SKETCH ) fillmode = SKETCH; diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 36deed2eb5..2b9ea2bcaf 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -238,7 +238,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w orient = GetDrawRotation(); width = m_Thickness; - if( ( frame->m_DisplayModText == FILAIRE ) + if( ( frame->m_DisplayModText == LINE ) || ( DC->LogicalToDeviceXRel( width ) < MIN_DRAW_WIDTH ) ) width = 0; else if( frame->m_DisplayModText == SKETCH ) diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index 52d97f6031..1056f0baea 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -149,7 +149,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit() m_StyleCtrl->SetSelection( 0 ); // Set justification - GRTextHorizJustifyType hJustify = m_SelectedPCBText->GetHorizJustify(); + EDA_TEXT_HJUSTIFY_T hJustify = m_SelectedPCBText->GetHorizJustify(); m_justifyChoice->SetSelection( (int) hJustify + 1 ); // Set focus on most important control diff --git a/pcbnew/gen_drill_report_files.cpp b/pcbnew/gen_drill_report_files.cpp index 7b13e26588..8e22ebf06e 100644 --- a/pcbnew/gen_drill_report_files.cpp +++ b/pcbnew/gen_drill_report_files.cpp @@ -274,7 +274,7 @@ void Gen_Drill_PcbMap( BOARD* aPcb, PLOTTER* aPlotter, wxSize oblong_size; oblong_size = aHoleListBuffer[ii].m_Hole_Size; aPlotter->flash_pad_oval( pos, oblong_size, - aHoleListBuffer[ii].m_Hole_Orient, FILAIRE ); + aHoleListBuffer[ii].m_Hole_Orient, LINE ); } } } diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 5bd9f92dc8..88275675b2 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -1767,7 +1767,7 @@ void KICAD_PLUGIN::loadPCB_TEXT() pcbtxt->SetTimeStamp( timestamp ); pcbtxt->SetItalic( !strcmp( style, "Italic" ) ); - GRTextHorizJustifyType hj; + EDA_TEXT_HJUSTIFY_T hj; if( hJustify ) { @@ -1780,7 +1780,9 @@ void KICAD_PLUGIN::loadPCB_TEXT() } } else + { hj = GR_TEXT_HJUSTIFY_CENTER; + } pcbtxt->SetHorizJustify( hj ); diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index d4d8fbece5..71e493fa72 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -319,7 +319,7 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ aPcbPlotParams->m_PlotViaOnMaskLayer = ParseBool(); break; case T_mode: - aPcbPlotParams->m_PlotMode = (GRTraceMode)ParseInt( 0, 2 ); + aPcbPlotParams->m_PlotMode = (EDA_DRAW_MODE_T)ParseInt( 0, 2 ); break; case T_useauxorigin: aPcbPlotParams->useAuxOrigin = ParseBool(); diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index 0d9a6c677e..e7a06c93df 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -49,7 +49,7 @@ public: bool m_PlotFrameRef; // True to plot/print frame references bool m_PlotViaOnMaskLayer; // True if vias are drawn on Mask layer // (ie protected by mask) - GRTraceMode m_PlotMode; // = FILAIRE, FILLED or SKETCH: select how to plot filled objects. + EDA_DRAW_MODE_T m_PlotMode; // LINE, FILLED or SKETCH: select how to plot filled objects. // depending on plot format or layers, all options are not always allowed int m_HPGLPenNum; int m_HPGLPenSpeed; diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index db9b20f6f4..385bc035e6 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -434,7 +434,7 @@ void DIALOG_PLOT::applyPlotSettings() tempOptions.m_DrillShapeOpt = (PCB_PLOT_PARAMS::DrillShapeOptT) m_drillShapeOpt->GetSelection(); tempOptions.m_PlotMirror = m_plotMirrorOpt->GetValue(); - tempOptions.m_PlotMode = (GRTraceMode) m_plotModeOpt->GetSelection(); + tempOptions.m_PlotMode = (EDA_DRAW_MODE_T) m_plotModeOpt->GetSelection(); tempOptions.m_PlotViaOnMaskLayer = m_plotNoViaOnMaskOpt->GetValue(); // Update settings from text fields. Rewrite values back to the fields, diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h index 66f475d587..da690cc504 100644 --- a/pcbnew/pcbplot.h +++ b/pcbnew/pcbplot.h @@ -38,24 +38,24 @@ class ZONE_CONTAINER; void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); /* Plat PCB text type, ie other than text on modules * prepare the plot settings of text */ void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int masque_layer, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); void PlotPcbTarget( PLOTTER* plotter, PCB_TARGET* PtMire, int masque_layer, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); /* PLOTGERB.CPP */ void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize ); diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index d8ea56f39f..b123279bd1 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -28,14 +28,14 @@ #include "pcbplot.h" static void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, - GRTraceMode trace_mode ); + EDA_DRAW_MODE_T trace_mode ); /* Creates the plot for silkscreen layers */ -void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* plotter, int aLayerMask, GRTraceMode trace_mode ) +void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* plotter, int aLayerMask, EDA_DRAW_MODE_T trace_mode ) { bool trace_val, trace_ref; TEXTE_MODULE* pt_texte; @@ -97,24 +97,24 @@ void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* plotter, int aLayerMask, GRTraceMo switch( pad->m_PadShape & 0x7F ) { case PAD_CIRCLE: - plotter->flash_pad_circle( shape_pos, pad->m_Size.x, FILAIRE ); + plotter->flash_pad_circle( shape_pos, pad->m_Size.x, LINE ); break; case PAD_OVAL: - plotter->flash_pad_oval( shape_pos, pad->m_Size, pad->m_Orient, FILAIRE ); + plotter->flash_pad_oval( shape_pos, pad->m_Size, pad->m_Orient, LINE ); break; case PAD_TRAPEZOID: { wxPoint coord[4]; pad->BuildPadPolygon( coord, wxSize(0,0), 0 ); - plotter->flash_pad_trapez( shape_pos, coord, pad->m_Orient, FILAIRE ); + plotter->flash_pad_trapez( shape_pos, coord, pad->m_Orient, LINE ); break; } case PAD_RECT: default: - plotter->flash_pad_rect( shape_pos, pad->m_Size, pad->m_Orient, FILAIRE ); + plotter->flash_pad_rect( shape_pos, pad->m_Size, pad->m_Orient, LINE ); break; } } @@ -232,7 +232,7 @@ for module\n %s's \"module text\" text of %s." ), } -static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, GRTraceMode trace_mode ) +static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, EDA_DRAW_MODE_T trace_mode ) { wxSize size; wxPoint pos; @@ -246,7 +246,7 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, GRTraceMod thickness = pt_texte->m_Thickness; - if( trace_mode == FILAIRE ) + if( trace_mode == LINE ) thickness = -1; if( pt_texte->m_Mirror ) @@ -267,14 +267,14 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, GRTraceMod void PlotDimension( PLOTTER* plotter, DIMENSION* aDim, int aLayerMask, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { if( (GetLayerMask( aDim->GetLayer() ) & aLayerMask) == 0 ) return; DRAWSEGMENT draw; - draw.SetWidth( (trace_mode==FILAIRE) ? -1 : aDim->GetWidth() ); + draw.SetWidth( (trace_mode==LINE) ? -1 : aDim->GetWidth() ); draw.SetLayer( aDim->GetLayer() ); PlotTextePcb( plotter, &aDim->m_Text, aLayerMask, trace_mode ); @@ -309,7 +309,8 @@ void PlotDimension( PLOTTER* plotter, DIMENSION* aDim, int aLayerMask, } -void PlotPcbTarget( PLOTTER* plotter, PCB_TARGET* aMire, int aLayerMask, GRTraceMode trace_mode ) +void PlotPcbTarget( PLOTTER* plotter, PCB_TARGET* aMire, int aLayerMask, + EDA_DRAW_MODE_T trace_mode ) { int dx1, dx2, dy1, dy2, radius; @@ -319,7 +320,7 @@ void PlotPcbTarget( PLOTTER* plotter, PCB_TARGET* aMire, int aLayerMask, GRTrace DRAWSEGMENT draw; draw.SetShape( S_CIRCLE ); - draw.SetWidth( ( trace_mode == FILAIRE ) ? -1 : aMire->GetWidth() ); + draw.SetWidth( ( trace_mode == LINE ) ? -1 : aMire->GetWidth() ); draw.SetLayer( aMire->GetLayer() ); draw.SetStart( aMire->GetPosition() ); @@ -354,7 +355,7 @@ void PlotPcbTarget( PLOTTER* plotter, PCB_TARGET* aMire, int aLayerMask, GRTrace /* Plot footprints graphic items (outlines) */ -void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask, GRTraceMode trace_mode ) +void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask, EDA_DRAW_MODE_T trace_mode ) { for( MODULE* module = pcb->m_Modules; module; module = module->Next() ) { @@ -375,7 +376,7 @@ void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask, GRTraceMo /** Plot a graphic item (outline) relative to a footprint */ -void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* aEdge, GRTraceMode trace_mode ) +void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* aEdge, EDA_DRAW_MODE_T trace_mode ) { int type_trace; // Type of item to plot. int thickness; // Segment thickness. @@ -456,7 +457,8 @@ void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* aEdge, GRTraceMode trace_ /* Plot a PCB Text, i;e. a text found on a copper or technical layer */ -void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int aLayerMask, GRTraceMode trace_mode ) +void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int aLayerMask, + EDA_DRAW_MODE_T trace_mode ) { int orient, thickness; wxPoint pos; @@ -471,7 +473,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int aLayerMask, GRTrac size = pt_texte->m_Size; pos = pt_texte->m_Pos; orient = pt_texte->m_Orient; - thickness = ( trace_mode==FILAIRE ) ? -1 : pt_texte->m_Thickness; + thickness = ( trace_mode==LINE ) ? -1 : pt_texte->m_Thickness; if( pt_texte->m_Mirror ) size.x = -size.x; @@ -517,7 +519,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int aLayerMask, GRTrac /* Plot areas (given by .m_FilledPolysList member) in a zone */ -void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone, GRTraceMode trace_mode ) +void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone, EDA_DRAW_MODE_T trace_mode ) { unsigned imax = aZone->m_FilledPolysList.size(); @@ -578,7 +580,7 @@ void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone, GRTraceMode trace { for( unsigned jj = 1; jjthick_segment( cornerList[jj -1], cornerList[jj], - ( trace_mode == FILAIRE ) ? -1 : aZone->m_ZoneMinThickness, + ( trace_mode == LINE ) ? -1 : aZone->m_ZoneMinThickness, trace_mode ); } @@ -594,7 +596,7 @@ void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone, GRTraceMode trace /* Plot items type DRAWSEGMENT on layers allowed by aLayerMask */ void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* aSeg, int aLayerMask, - GRTraceMode trace_mode ) + EDA_DRAW_MODE_T trace_mode ) { int thickness; int radius = 0, StAngle = 0, EndAngle = 0; @@ -602,7 +604,7 @@ void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* aSeg, int aLayerMask, if( (GetLayerMask( aSeg->GetLayer() ) & aLayerMask) == 0 ) return; - if( trace_mode == FILAIRE ) + if( trace_mode == LINE ) thickness = g_PcbPlotOptions.m_PlotLineWidth; else thickness = aSeg->GetWidth(); @@ -646,7 +648,7 @@ void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* aSeg, int aLayerMask, } -void PCB_BASE_FRAME::Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_mode ) +void PCB_BASE_FRAME::Plot_Layer( PLOTTER* plotter, int Layer, EDA_DRAW_MODE_T trace_mode ) { // Specify that the contents of the "Edges Pcb" layer are to be plotted // in addition to the contents of the currently specified layer. @@ -734,11 +736,11 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_ /* Plot a copper layer or mask in HPGL format. * HPGL unit = 0.98 mils (1 mil = 1.02041 unit HPGL). */ -void PCB_BASE_FRAME::Plot_Standard_Layer( PLOTTER* aPlotter, - int aLayerMask, - bool aPlotVia, - GRTraceMode aPlotMode, - bool aSkipNPTH_Pads ) +void PCB_BASE_FRAME::Plot_Standard_Layer( PLOTTER* aPlotter, + int aLayerMask, + bool aPlotVia, + EDA_DRAW_MODE_T aPlotMode, + bool aSkipNPTH_Pads ) { wxPoint pos; wxSize size; @@ -967,9 +969,9 @@ void PCB_BASE_FRAME::Plot_Standard_Layer( PLOTTER* aPlotter, * @param aSmallDrillShape = true to plot a small drill shape, false to plot * the actual drill shape */ -void PCB_BASE_FRAME::PlotDrillMark( PLOTTER* aPlotter, - GRTraceMode aTraceMode, - bool aSmallDrillShape ) +void PCB_BASE_FRAME::PlotDrillMark( PLOTTER* aPlotter, + EDA_DRAW_MODE_T aTraceMode, + bool aSmallDrillShape ) { wxPoint pos; wxSize diam; diff --git a/pcbnew/plotdxf.cpp b/pcbnew/plotdxf.cpp index 06e3801250..033dffd8b5 100644 --- a/pcbnew/plotdxf.cpp +++ b/pcbnew/plotdxf.cpp @@ -16,7 +16,7 @@ bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer, - GRTraceMode aTraceMode ) + EDA_DRAW_MODE_T aTraceMode ) { Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc; diff --git a/pcbnew/plotgerb.cpp b/pcbnew/plotgerb.cpp index 9e90b4cb85..8a1084df09 100644 --- a/pcbnew/plotgerb.cpp +++ b/pcbnew/plotgerb.cpp @@ -24,7 +24,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLayer, - bool aPlotOriginIsAuxAxis, GRTraceMode aTraceMode ) + bool aPlotOriginIsAuxAxis, EDA_DRAW_MODE_T aTraceMode ) { FILE* output_file = wxFopen( aFullFileName, wxT( "wt" ) ); diff --git a/pcbnew/plothpgl.cpp b/pcbnew/plothpgl.cpp index 2337905c45..2ffa973f35 100644 --- a/pcbnew/plothpgl.cpp +++ b/pcbnew/plothpgl.cpp @@ -18,7 +18,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer, - GRTraceMode aTraceMode ) + EDA_DRAW_MODE_T aTraceMode ) { wxSize SheetSize; wxSize BoardSize; diff --git a/pcbnew/plotps.cpp b/pcbnew/plotps.cpp index 1e9a427f88..7ef143ca21 100644 --- a/pcbnew/plotps.cpp +++ b/pcbnew/plotps.cpp @@ -22,7 +22,7 @@ * If layer < 0: all layers are plotted. */ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int aLayer, - bool aUseA4, GRTraceMode aTraceMode ) + bool aUseA4, EDA_DRAW_MODE_T aTraceMode ) { wxSize SheetSize; wxSize PaperSize; From 5a96588eec77ea68eb4a8794d1ca8b1dc6bdfe2b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 4 Jan 2012 20:10:33 +0100 Subject: [PATCH 11/12] Fix bug 910364: When a footprint saved in a .mod file is not on front layer and/or not with orientation 0 degree, the Module editor load it incorrectly. note: the Module editor save it with default orientation and layer, but the archive function does not, so some footprints can be not editable. TODO: modify the Archive Function to use the default layer / orientation. --- bitmaps_png/cpp_26/load_module_lib.cpp | 158 +-- bitmaps_png/sources/load_module_lib.svg | 1071 ++++------------- .../dialogs/dialog_print_using_printer.cpp | 7 +- pcbnew/loadcmp.cpp | 20 +- pcbnew/zones_polygons_test_connections.cpp | 85 +- 5 files changed, 393 insertions(+), 948 deletions(-) diff --git a/bitmaps_png/cpp_26/load_module_lib.cpp b/bitmaps_png/cpp_26/load_module_lib.cpp index 5e5293d1bf..00be91443f 100644 --- a/bitmaps_png/cpp_26/load_module_lib.cpp +++ b/bitmaps_png/cpp_26/load_module_lib.cpp @@ -8,84 +8,86 @@ static const unsigned char png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, - 0xce, 0x00, 0x00, 0x04, 0xc3, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0x0b, 0x50, 0x94, - 0x55, 0x14, 0xc7, 0x2f, 0x4e, 0x4a, 0x0a, 0x6a, 0x39, 0xd6, 0x38, 0x36, 0x9a, 0xaf, 0xc1, 0xb4, - 0x51, 0x74, 0x7c, 0x80, 0x06, 0x31, 0x21, 0x35, 0x26, 0xa4, 0xf9, 0x20, 0x28, 0x40, 0x17, 0x29, - 0x1a, 0xd4, 0x59, 0x72, 0x64, 0x10, 0x30, 0xd8, 0x87, 0x01, 0x22, 0xaf, 0x85, 0xe5, 0x8d, 0xb8, - 0x4b, 0x82, 0xcb, 0x5a, 0x62, 0x22, 0x0b, 0x15, 0xa1, 0x8d, 0x39, 0xa8, 0x11, 0xea, 0x4c, 0x02, - 0x8e, 0xb0, 0x29, 0x99, 0x82, 0xf2, 0x46, 0x91, 0x5d, 0x60, 0xf9, 0x77, 0xbe, 0x4f, 0xdc, 0x16, - 0x96, 0x31, 0x35, 0xed, 0xce, 0xfc, 0x76, 0xef, 0xde, 0x9d, 0x39, 0xbf, 0x7b, 0xee, 0x39, 0x77, - 0xf7, 0x63, 0x00, 0xd8, 0xb3, 0x84, 0xc6, 0x3a, 0x62, 0xb4, 0xd9, 0xfa, 0x73, 0x10, 0xc9, 0x88, - 0xdc, 0xff, 0x47, 0xe4, 0xc5, 0xb8, 0x89, 0xe4, 0xb9, 0x88, 0xb8, 0xe3, 0x22, 0x16, 0x10, 0x45, - 0xac, 0x94, 0x44, 0x4e, 0xbc, 0x4c, 0xf0, 0xcc, 0x44, 0x34, 0x1c, 0xd8, 0x58, 0x76, 0x96, 0xb9, - 0xb0, 0x3e, 0xb6, 0x83, 0x82, 0x4b, 0x89, 0x9f, 0x88, 0x12, 0x62, 0x0e, 0xad, 0x31, 0xe6, 0xf2, - 0x9f, 0x44, 0x34, 0x26, 0xb2, 0x31, 0x2c, 0x8f, 0x05, 0x50, 0xc0, 0x22, 0xa2, 0x7c, 0x04, 0x44, - 0x7c, 0x56, 0xd5, 0x84, 0xc5, 0xd3, 0x8b, 0x26, 0x50, 0xf8, 0xd8, 0x61, 0x81, 0xbf, 0x27, 0xb8, - 0xb5, 0x32, 0x22, 0x8d, 0xb0, 0x66, 0x5d, 0x24, 0x59, 0xf8, 0xd4, 0x19, 0xd1, 0x08, 0x64, 0x5f, - 0x9a, 0x08, 0x22, 0x09, 0x3b, 0xd6, 0xc1, 0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8, 0x40, 0x96, 0x46, 0x8e, 0xa8, 0x08, 0x39, 0x24, 0xf6, 0x95, - 0x88, 0xb0, 0x30, 0xf4, 0x6f, 0x67, 0xd5, 0x85, 0x93, 0xd8, 0x1c, 0x27, 0x0a, 0x6e, 0x4b, 0xcc, - 0x24, 0x5e, 0x7c, 0xa2, 0xa7, 0xa0, 0x98, 0x71, 0x4d, 0x41, 0x4a, 0x9b, 0x6f, 0xbb, 0xaf, 0xfb, - 0xbd, 0x86, 0x94, 0xb7, 0xab, 0x20, 0xcb, 0x4a, 0x46, 0xe4, 0xae, 0x6c, 0x88, 0xdf, 0xac, 0x81, - 0xc8, 0xc2, 0x80, 0x9d, 0xac, 0xe1, 0xb4, 0x1d, 0x13, 0x7a, 0x50, 0xe0, 0xc5, 0xc4, 0x5c, 0xe2, - 0x65, 0xee, 0x19, 0x61, 0x78, 0x9c, 0xbf, 0x01, 0x5d, 0xf7, 0x9c, 0x31, 0x62, 0xc8, 0x34, 0xf3, - 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, + 0xce, 0x00, 0x00, 0x04, 0xd9, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xad, 0x96, 0x7b, 0x4c, 0x93, + 0x57, 0x18, 0x87, 0xdf, 0xe9, 0xd8, 0x88, 0x11, 0x51, 0xd1, 0xcd, 0x0d, 0xa2, 0xfe, 0xa1, 0xcb, + 0xc4, 0x25, 0x9b, 0xd1, 0x51, 0x9c, 0x3a, 0x99, 0x04, 0x95, 0xb9, 0x09, 0x0b, 0x71, 0xc6, 0x5b, + 0x51, 0x99, 0xc0, 0x94, 0xa1, 0xec, 0xc2, 0x20, 0x52, 0x68, 0x11, 0x5a, 0xa1, 0x17, 0x2e, 0x05, + 0xbc, 0x56, 0x2e, 0xc2, 0xa0, 0x48, 0x84, 0x39, 0x41, 0x9d, 0x4c, 0x21, 0x33, 0x44, 0x99, 0x3a, + 0x11, 0x06, 0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2, 0x15, 0xac, 0x0a, 0x2f, 0xd2, 0x32, 0x32, + 0xd2, 0x36, 0x16, 0x58, 0x3e, 0x20, 0x29, 0x64, 0x4c, 0xa6, 0x7b, 0xec, 0xfb, 0x77, 0xfe, 0x17, + 0xd1, 0xb0, 0xd4, 0xba, 0xb2, 0x75, 0x5e, 0xa2, 0x93, 0x4c, 0xe2, 0xca, 0xc4, 0x44, 0x9e, 0xcf, + 0xbc, 0x47, 0x36, 0x0b, 0xa7, 0xd3, 0xcf, 0xe4, 0xc5, 0xa7, 0x4c, 0xf8, 0x4c, 0x55, 0xf7, 0x1c, + 0x2b, 0x2b, 0x61, 0x88, 0x6c, 0x3e, 0x47, 0x2f, 0x20, 0xf2, 0x19, 0xde, 0xf7, 0x2f, 0x94, 0x4d, + 0xa7, 0x8d, 0xfd, 0xa4, 0xc6, 0x76, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, }; const BITMAP_OPAQUE load_module_lib_xpm[1] = {{ png, sizeof( png ), "load_module_lib_xpm" }}; diff --git a/bitmaps_png/sources/load_module_lib.svg b/bitmaps_png/sources/load_module_lib.svg index e9d88ee7bd..6f30d5e6d7 100644 --- a/bitmaps_png/sources/load_module_lib.svg +++ b/bitmaps_png/sources/load_module_lib.svg @@ -1,839 +1,242 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - diff --git a/eeschema/dialogs/dialog_print_using_printer.cpp b/eeschema/dialogs/dialog_print_using_printer.cpp index d77fe74f07..4f945f598e 100644 --- a/eeschema/dialogs/dialog_print_using_printer.cpp +++ b/eeschema/dialogs/dialog_print_using_printer.cpp @@ -326,9 +326,12 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) old_org = aScreen->m_DrawOrg; oldClipBox = *panel->GetClipBox(); - /* Change scale factor, offsets, and clip box to print the whole page. */ - panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) ); + // Change clip box to print the whole page. + #define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer + // and that allows calculations without overflow + panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) ); + // Change scale factor and offset to print the whole page. bool printReference = parent->GetPrintSheetReference(); if( printReference ) diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index 4cccee89e3..d2270ff2c5 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -91,9 +91,13 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) ); PlaceModule( aModule, NULL ); + // Put it on FRONT layer, + // because this is the default in ModEdit, and in libs if( aModule->GetLayer() != LAYER_N_FRONT ) aModule->Flip( aModule->m_Pos ); + // Put it in orientation 0, + // because this is the default orientation in ModEdit, and in libs Rotate_Module( NULL, aModule, 0, false ); GetScreen()->ClrModify(); Zoom_Automatique( false ); @@ -189,15 +193,15 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC* module->SetTimeStamp( GetNewTimeStamp() ); GetBoard()->m_Status_Pcb = 0; module->SetPosition( curspos ); + // Put it on FRONT layer, + // (Can be stored on BACK layer if the lib is an archive built from a board) + if( module->GetLayer() != LAYER_N_FRONT ) + module->Flip( module->m_Pos ); + // Put in in orientation 0, + // even if it is not saved with with orientation 0 in lib + // (Can happen if the lib is an archive built from a board) + Rotate_Module( NULL, module, 0, false ); - /* TODO: call RecalculateAllTracksNetcode() only if some pads pads have - * a netname. - * If all pads are not connected (usually the case in module libraries, - * rebuild only the pad and list of nets ( faster) - */ - - -// GetBoard()->m_Pcb->m_NetInfo.BuildListOfNets(); RecalculateAllTracksNetcode(); if( DC ) diff --git a/pcbnew/zones_polygons_test_connections.cpp b/pcbnew/zones_polygons_test_connections.cpp index 9b970ef7f6..3ce13e3c63 100644 --- a/pcbnew/zones_polygons_test_connections.cpp +++ b/pcbnew/zones_polygons_test_connections.cpp @@ -22,6 +22,16 @@ using namespace std; static bool CmpZoneSubnetValue( const BOARD_CONNECTED_ITEM* a, const BOARD_CONNECTED_ITEM* b ); void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode ); +// This helper function sort a list of zones by netcode, +// and for a given netcode by zone size +// zone size = size of the m_FilledPolysList buffer +bool sort_areas( const ZONE_CONTAINER* ref, const ZONE_CONTAINER* tst ) +{ + if( ref->GetNet() == tst->GetNet() ) + return ref->m_FilledPolysList.size() < tst->m_FilledPolysList.size(); + else + return ref->GetNet() < tst->GetNet(); +} /** * Function Test_Connection_To_Copper_Areas @@ -34,7 +44,6 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) // It is static to avoid multiple memory realloc. static std::vector Candidates; - // clear .m_ZoneSubnet parameter for pads for( MODULE* module = m_Modules; module; module = module->Next() ) { @@ -52,46 +61,65 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) // examine all zones, net by net: int subnet = 0; + + // Build zones candidates list + std::vector zones_candidates; for( int index = 0; index < GetAreaCount(); index++ ) { ZONE_CONTAINER* curr_zone = GetArea( index ); if( !curr_zone->IsOnCopperLayer() ) continue; - - int netcode = curr_zone->GetNet(); - if( (aNetcode >= 0) && !( aNetcode == netcode ) ) + if( (aNetcode >= 0) && ( aNetcode != curr_zone->GetNet() ) ) continue; - if( curr_zone->m_FilledPolysList.size() == 0 ) continue; + zones_candidates.push_back(curr_zone); + } + // sort them by netcode then vertices count. + // For a given net, examine the smaller zones first slightly speed up calculation + // (25% faster) + // this is only noticeable with very large boards and depends on board zones topology + // This is due to the fact some items are connected bt small zones ares, + // before examining large zones areas and these items are not tested after a connection is found + sort(zones_candidates.begin(), zones_candidates.end(), sort_areas ); + + int oldnetcode = -1; + for( unsigned idx = 0; idx < zones_candidates.size(); idx++ ) + { + ZONE_CONTAINER* curr_zone = zones_candidates[idx]; + + int netcode = curr_zone->GetNet(); // Build a list of candidates connected to the net: - Candidates.clear(); - // At this point, layers are not considered, because areas on different layers can // be connected by a via or a pad. - - // Build the list of pads candidates connected to the net: + // (because zones are sorted by netcode, there is made only once per net) NETINFO_ITEM* net = FindNet( netcode ); wxASSERT( net ); if( net == NULL ) continue; - Candidates.reserve( net->m_PadInNetList.size() ); - for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ ) - Candidates.push_back( net->m_PadInNetList[ii] ); - - // Build the list of track candidates connected to the net: - TRACK* track = m_Track.GetFirst()->GetStartNetCode( netcode ); - for( ; track; track = track->Next() ) + if( oldnetcode != netcode ) { - if( track->GetNet() != netcode ) - break; - Candidates.push_back( track ); + oldnetcode = netcode; + Candidates.clear(); + + // Build the list of pads candidates connected to the net: + Candidates.reserve( net->m_PadInNetList.size() ); + for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ ) + Candidates.push_back( net->m_PadInNetList[ii] ); + + // Build the list of track candidates connected to the net: + TRACK* track = m_Track.GetFirst()->GetStartNetCode( netcode ); + for( ; track; track = track->Next() ) + { + if( track->GetNet() != netcode ) + break; + Candidates.push_back( track ); + } } // test if a candidate is inside a filled area of this zone unsigned indexstart = 0, indexend; - for( indexend = 0; indexend < curr_zone->m_FilledPolysList.size(); indexend++ ) { // end of a filled sub-area found @@ -104,6 +132,9 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) { // test if this area is connected to a board item: BOARD_CONNECTED_ITEM* item = Candidates[ic]; + if( item->GetZoneSubNet() == subnet ) // Already merged + continue; + if( !item->IsOnLayer( curr_zone->GetLayer() ) ) continue; @@ -138,17 +169,19 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) if( !connected && (pos1 != pos2 ) ) { if( bbox.Contains( pos2 ) ) - if( TestPointInsidePolygon( curr_zone->m_FilledPolysList, indexstart, - indexend, pos2.x, pos2.y ) ) + { + if( TestPointInsidePolygon( curr_zone->m_FilledPolysList, + indexstart, indexend, + pos2.x, pos2.y ) ) connected = true; + } } if( connected ) { // Set ZoneSubnet to the current subnet value. // If the previous subnet is not 0, merge all items with old subnet // to the new one - int old_subnet = 0; - old_subnet = item->GetZoneSubNet(); + int old_subnet = item->GetZoneSubNet(); item->SetZoneSubNet( subnet ); // Merge previous subnet with the current @@ -170,8 +203,8 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) // (if exists). End read one area in // curr_zone->m_FilledPolysList } - } // End read all segments in zone. - } // End read all zones in board + } // End read all segments in zone + } // End read all zones candidates } From 152b8d91e39321ae99af788992cb6a65f0b8bc69 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 4 Jan 2012 17:08:46 -0500 Subject: [PATCH 12/12] Eeschema schematic object improvements. * Move SCH_ITEM::Place() code into SCH_EDIT_FRAME so schematic item objects no longer have any knowledge of the schematic frame window or undo/redo containers. --- common/sch_item_struct.cpp | 31 --------------- eeschema/busentry.cpp | 16 ++++---- eeschema/onleftclick.cpp | 78 ++++++++++++++------------------------ eeschema/sch_sheet.cpp | 24 ------------ eeschema/sch_sheet.h | 4 -- eeschema/sch_sheet_pin.cpp | 26 ------------- eeschema/schedit.cpp | 10 ++--- eeschema/schframe.cpp | 77 +++++++++++++++++++++++++++++++++++++ include/sch_item_struct.h | 9 ----- include/wxEeschemaStruct.h | 8 ++++ 10 files changed, 126 insertions(+), 157 deletions(-) diff --git a/common/sch_item_struct.cpp b/common/sch_item_struct.cpp index e6cff77782..90f88bf652 100644 --- a/common/sch_item_struct.cpp +++ b/common/sch_item_struct.cpp @@ -80,37 +80,6 @@ SCH_ITEM::~SCH_ITEM() } -void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC ) -{ - SCH_SCREEN* screen = aFrame->GetScreen(); - - if( IsNew() ) - { - if( !screen->CheckIfOnDrawList( this ) ) // don't want a loop! - screen->AddToDrawList( this ); - - aFrame->SetRepeatItem( this ); - aFrame->SaveCopyInUndoList( this, UR_NEW ); - } - else - { - aFrame->SaveUndoItemInUndoList( this ); - } - - m_Flags = 0; - screen->SetModify(); - screen->SetCurItem( NULL ); - aFrame->GetCanvas()->SetMouseCapture( NULL, NULL ); - aFrame->GetCanvas()->EndMouseCapture(); - - if( aDC ) - { - EDA_CROSS_HAIR_MANAGER( aFrame->GetCanvas(), aDC ); // Erase schematic cursor - Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); - } -} - - bool SCH_ITEM::IsConnected( const wxPoint& aPosition ) const { if( m_Flags & STRUCT_DELETED || m_Flags & SKIP_STRUCT ) diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp index 9cf60b3304..cf9ea84ed7 100644 --- a/eeschema/busentry.cpp +++ b/eeschema/busentry.cpp @@ -43,15 +43,17 @@ static int s_LastShape = '\\'; -SCH_BUS_ENTRY* SCH_EDIT_FRAME::CreateBusEntry( wxDC* DC, int entry_type ) +SCH_BUS_ENTRY* SCH_EDIT_FRAME::CreateBusEntry( wxDC* aDC, int aType ) { + SCH_SCREEN* screen = GetScreen(); + // Create and place a new bus entry at cursor position - SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->GetCrossHairPosition(), s_LastShape, - entry_type ); - BusEntry->SetFlags( IS_NEW ); - BusEntry->Place( this, DC ); - OnModify(); - return BusEntry; + SCH_BUS_ENTRY* busEntry = new SCH_BUS_ENTRY( screen->GetCrossHairPosition(), s_LastShape, + aType ); + busEntry->SetFlags( IS_NEW ); + GetScreen()->SetCurItem( busEntry ); + addCurrentItemToList( aDC ); + return busEntry; } diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index d6618e046c..3e28088fb5 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -76,10 +76,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) case SCH_FIELD_T: case SCH_BITMAP_T: case SCH_NO_CONNECT_T: - item->Place( this, aDC ); - GetScreen()->SetCurItem( NULL ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); return; case SCH_LINE_T: // May already be drawing segment. @@ -133,12 +130,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); + addCurrentItemToList( aDC ); } - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); break; case ID_JUNCTION_BUTT: @@ -150,30 +144,22 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); + addCurrentItemToList( aDC ); } - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); break; case ID_WIRETOBUS_ENTRY_BUTT: case ID_BUSTOBUS_ENTRY_BUTT: if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) { - item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ? - WIRE_TO_BUS : BUS_TO_BUS ); - GetScreen()->SetCurItem( item ); + CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ? + WIRE_TO_BUS : BUS_TO_BUS ); m_canvas->SetAutoPanRequest( true ); } else { - item->Place( this, aDC ); - GetScreen()->SetCurItem( NULL ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); - m_canvas->SetAutoPanRequest( false ); + addCurrentItemToList( aDC ); } break; @@ -204,9 +190,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); + addCurrentItemToList( aDC ); } + break; case ID_ADD_IMAGE_BUTT: @@ -217,9 +203,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); + addCurrentItemToList( aDC ); } + break; case ID_LABEL_BUTT: @@ -230,11 +216,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); } + break; case ID_GLABEL_BUTT: @@ -251,26 +235,27 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); } + break; case ID_SHEET_SYMBOL_BUTT: if( ( item == NULL ) || ( item->GetFlags() == 0 ) ) { - GetScreen()->SetCurItem( CreateSheet( aDC ) ); - m_canvas->SetAutoPanRequest( true ); + item = CreateSheet( aDC ); + + if( item != NULL ) + { + GetScreen()->SetCurItem( item ); + m_canvas->SetAutoPanRequest( true ); + } } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); } + break; case ID_IMPORT_HLABEL_BUTT: @@ -290,10 +275,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else if( (item->Type() == SCH_SHEET_PIN_T) && (item->GetFlags() != 0) ) { - item->Place( this, aDC ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); } + break; case ID_SCH_PLACE_COMPONENT: @@ -304,11 +288,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); } + break; case ID_PLACE_POWER_BUTT: @@ -320,11 +302,9 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) } else { - item->Place( this, aDC ); - m_canvas->SetAutoPanRequest( false ); - GetScreen()->TestDanglingEnds(); - m_canvas->Refresh( true ); + addCurrentItemToList( aDC ); } + break; default: diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 4ead3f3bf7..572668221c 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -477,30 +477,6 @@ int SCH_SHEET::GetMinHeight() const } -void SCH_SHEET::Place( SCH_EDIT_FRAME* frame, wxDC* DC ) -{ - /* Place list structures for new sheet. */ - if( IsNew() ) - { - // fix size and position of the new sheet - // using the last values set by the m_mouseCaptureCallback function - frame->GetCanvas()->SetMouseCapture( NULL, NULL ); - - if( !frame->EditSheet( this, DC ) ) - { - frame->GetScreen()->SetCurItem( NULL ); - Draw( frame->GetCanvas(), DC, wxPoint( 0, 0 ), g_XorMode ); - delete this; - return; - } - - frame->SetSheetNumberAndCount(); - } - - SCH_ITEM::Place( frame, DC ); //puts it on the GetDrawItems(). -} - - /** * Delete sheet labels which do not have corresponding hierarchical label. */ diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h index b427da8eb8..1b378347dd 100644 --- a/eeschema/sch_sheet.h +++ b/eeschema/sch_sheet.h @@ -148,8 +148,6 @@ public: */ SCH_SHEET* GetParent() const { return (SCH_SHEET*) m_Parent; } - void Place( SCH_EDIT_FRAME* frame, wxDC* DC ); - /** * Function Save * writes the data structures for this object out to a FILE in "*.sch" @@ -342,8 +340,6 @@ public: */ virtual bool Load( LINE_READER& aLine, wxString& aErrorMsg ); - void Place( SCH_EDIT_FRAME* frame, wxDC* DC ); - void DisplayInfo( EDA_DRAW_FRAME* frame ); /* there is no member for orientation in sch_sheet, to preserve file diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index 58f208cb9b..442dfd44a6 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -126,32 +126,6 @@ void SCH_SHEET_PIN::SetNumber( int aNumber ) } -void SCH_SHEET_PIN::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC ) -{ - SCH_SHEET* sheet = (SCH_SHEET*) GetParent(); - - wxCHECK_RET( (sheet != NULL) && (sheet->Type() == SCH_SHEET_T), - wxT( "Cannot place sheet pin in invalid schematic sheet object." ) ); - - if( IsNew() ) - { - aFrame->SaveCopyInUndoList( sheet, UR_CHANGED ); - sheet->AddPin( this ); - } - else // Sheet pin already existed and was only moved. - { - aFrame->SaveUndoItemInUndoList( sheet ); - } - - ClearFlags(); - sheet->Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); - - // Make sure we don't call the abort move function. - aFrame->GetCanvas()->SetMouseCapture( NULL, NULL ); - aFrame->GetCanvas()->EndMouseCapture(); -} - - void SCH_SHEET_PIN::SetEdge( int aEdge ) { SCH_SHEET* Sheet = (SCH_SHEET*) GetParent(); diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index 647c420241..232c942e46 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -1,4 +1,4 @@ -/* + /* * 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 @@ -204,7 +204,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_SCH_END_SHEET: m_canvas->MoveCursorToCrossHair(); - item->Place( this, &dc ); + addCurrentItemToList( &dc ); break; case ID_POPUP_SCH_RESIZE_SHEET: @@ -330,11 +330,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) item = screen->GetCurItem(); if( item ) - { - item->Place( this, &dc ); - screen->TestDanglingEnds( m_canvas, &dc ); - screen->SetCurItem( NULL ); - } + addCurrentItemToList( &dc ); break; diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index c9a1447711..c4fa729df3 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -902,3 +902,80 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const return SheetList.IsAutoSaveRequired(); } + + +void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC ) +{ + SCH_SCREEN* screen = GetScreen(); + SCH_ITEM* item = screen->GetCurItem(); + + wxCHECK_RET( item != NULL, wxT( "Cannot add current item to list." ) ); + + m_canvas->SetAutoPanRequest( false ); + + SCH_ITEM* undoItem = item; + + if( item->Type() == SCH_SHEET_PIN_T ) + { + SCH_SHEET* sheet = (SCH_SHEET*) item->GetParent(); + + wxCHECK_RET( (sheet != NULL) && (sheet->Type() == SCH_SHEET_T), + wxT( "Cannot place sheet pin in invalid schematic sheet object." ) ); + + undoItem = sheet; + } + + if( item->IsNew() ) + { + if( item->Type() == SCH_SHEET_T ) + { + // Fix the size and position of the new sheet using the last values set by + // the m_mouseCaptureCallback function. + m_canvas->SetMouseCapture( NULL, NULL ); + + if( !EditSheet( (SCH_SHEET*)item, aDC ) ) + { + screen->SetCurItem( NULL ); + item->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode ); + delete item; + return; + } + + SetSheetNumberAndCount(); + } + + if( undoItem == item ) + { + if( !screen->CheckIfOnDrawList( item ) ) // don't want a loop! + screen->AddToDrawList( item ); + + SetRepeatItem( item ); + + SaveCopyInUndoList( undoItem, UR_NEW ); + } + else + { + SaveCopyInUndoList( undoItem, UR_CHANGED ); + ( (SCH_SHEET*)undoItem )->AddPin( (SCH_SHEET_PIN*) item ); + } + } + else + { + SaveUndoItemInUndoList( undoItem ); + } + + item->ClearFlags(); + screen->SetModify(); + screen->SetCurItem( NULL ); + m_canvas->SetMouseCapture( NULL, NULL ); + m_canvas->EndMouseCapture(); + + if( item->IsConnectable() ) + screen->TestDanglingEnds(); + + if( aDC ) + { + EDA_CROSS_HAIR_MANAGER( m_canvas, aDC ); // Erase schematic cursor + undoItem->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); + } +} diff --git a/include/sch_item_struct.h b/include/sch_item_struct.h index e459759588..42c1e3717e 100644 --- a/include/sch_item_struct.h +++ b/include/sch_item_struct.h @@ -179,15 +179,6 @@ public: int aDrawMode, int aColor = -1 ) = 0; - /** - * Function Place - * place the schematic item into the draw list. - *

- * If the schematic item is a new item or is modified, it is added to undo list. - *

- */ - virtual void Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC ); - /** * Function Move * moves the item by \a aMoveVector to a new position. diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index 65f09de0bb..b165d75c6e 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -181,6 +181,14 @@ protected: */ virtual bool isAutoSaveRequired() const; + /** + * Function addCurrentItemToList + * adds the item currently being edited to the schematic and adds the changes to + * the undo/redo container. + * + * @param aDC A pointer the device context to draw on when not NULL. + */ + void addCurrentItemToList( wxDC* aDC ); public: SCH_EDIT_FRAME( wxWindow* father,