From 4565308d635be669742f83b9a54c705b6ca865f0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 21 Jan 2012 16:02:49 +0100 Subject: [PATCH] Eeschema: fix bug #919636 Pcbnew: 2 minor enhancements --- eeschema/help_common_strings.h | 5 + eeschema/menubar.cpp | 28 +- eeschema/tool_sch.cpp | 10 +- pcbnew/dialogs/dialog_global_deletion.cpp | 51 +- pcbnew/dialogs/dialog_global_deletion.h | 3 + .../dialogs/dialog_global_deletion_base.cpp | 75 +- .../dialogs/dialog_global_deletion_base.fbp | 1997 ++++++++++++----- pcbnew/dialogs/dialog_global_deletion_base.h | 33 +- pcbnew/drc.cpp | 4 +- pcbnew/tr_modif.cpp | 3 +- 10 files changed, 1544 insertions(+), 665 deletions(-) diff --git a/eeschema/help_common_strings.h b/eeschema/help_common_strings.h index 6ab4e28728..cae95da625 100644 --- a/eeschema/help_common_strings.h +++ b/eeschema/help_common_strings.h @@ -49,6 +49,11 @@ #define HELP_PLACE_GRAPHICLINES _( "Place graphic lines or polygons" ) #define HELP_PLACE_GRAPHICTEXTS _( "Place graphic text (comment)" ) +#define HELP_ANNOTATE _( "Annotate the components in the schematic" ) +#define HELP_RUN_LIB_EDITOR _( "Library editor - Create and edit components" ) +#define HELP_RUN_LIB_VIEWER _( "Library browser - Browse components" ) +#define HELP_GENERATE_BOM _( "Generate bill of materials and/or cross references" ) +#define HELP_IMPORT_FOOTPRINTS _( "Import footprint selection from CvPcb in components footprint field" ) // Component editor: #define HELP_ADD_PIN _( "Add pins to the component" ) diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 226a5e4baa..450af98bef 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -458,29 +458,25 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() // Menu Tools: wxMenu* toolsMenu = new wxMenu; - // Library viewer - AddMenuItem( toolsMenu, - ID_TO_LIBRARY, - _( "Library &Browser" ), - _( "Library browser" ), - KiBitmap( library_browse_xpm ) ); - - // Library editor AddMenuItem( toolsMenu, ID_TO_LIBRARY, - _( "Library &Editor" ), - _( "Library editor" ), + _( "Library &Editor" ), HELP_RUN_LIB_EDITOR, KiBitmap( libedit_xpm ) ); + // Library viewer + AddMenuItem( toolsMenu, + ID_TO_LIBVIEW, + _( "Library &Browser" ), HELP_RUN_LIB_VIEWER, + KiBitmap( library_browse_xpm ) ); + // Separator toolsMenu->AppendSeparator(); // Annotate AddMenuItem( toolsMenu, ID_GET_ANNOTATE, - _( "&Annotate" ), - _( "Annotate the components in the schematic" ), + _( "&Annotate" ), HELP_ANNOTATE, KiBitmap( annotate_xpm ) ); // ERC @@ -501,8 +497,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() AddMenuItem( toolsMenu, ID_GET_TOOLS, _( "Generate Bill of &Materials" ), - _( "Generate bill of materials" ), - KiBitmap( tools_xpm ) ); + HELP_GENERATE_BOM, + KiBitmap( bom_xpm ) ); // Separator toolsMenu->AppendSeparator(); @@ -521,6 +517,10 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() _( "Run Pcbnew" ), KiBitmap( pcbnew_xpm ) ); + AddMenuItem( toolsMenu, ID_BACKANNO_ITEMS, + _( "Import Footprint Selection" ), + HELP_IMPORT_FOOTPRINTS, + KiBitmap( import_footprint_names_xpm ) ); // Help Menu: wxMenu* helpMenu = new wxMenu; diff --git a/eeschema/tool_sch.cpp b/eeschema/tool_sch.cpp index 21bd8f0720..9b7984f0b4 100644 --- a/eeschema/tool_sch.cpp +++ b/eeschema/tool_sch.cpp @@ -134,17 +134,17 @@ void SCH_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddTool( ID_TO_LIBRARY, wxEmptyString, KiBitmap( libedit_xpm ), - _( "Library editor - Create and edit components" ) ); + HELP_RUN_LIB_EDITOR ); m_mainToolBar->AddTool( ID_TO_LIBVIEW, wxEmptyString, KiBitmap( library_browse_xpm ), - _( "Library browser - Browse components" ) ); + HELP_RUN_LIB_VIEWER ); m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( ID_GET_ANNOTATE, wxEmptyString, KiBitmap( annotate_xpm ), - _( "Annotate schematic" ) ); + HELP_ANNOTATE ); m_mainToolBar->AddTool( ID_GET_ERC, wxEmptyString, KiBitmap( erc_xpm ), _( "Perform electric rules check" ) ); @@ -153,7 +153,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar() _( "Generate netlist" ) ); m_mainToolBar->AddTool( ID_GET_TOOLS, wxEmptyString, KiBitmap( bom_xpm ), - _( "Generate bill of materials and/or cross references" ) ); + HELP_GENERATE_BOM ); m_mainToolBar->AddSeparator(); @@ -167,7 +167,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddTool( ID_BACKANNO_ITEMS, wxEmptyString, KiBitmap( import_footprint_names_xpm ), - _( "Back annotate component foot prints" ) ); + HELP_IMPORT_FOOTPRINTS ); // set icon paddings m_mainToolBar->SetToolBorderPadding(3); // padding diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 1906a578fd..5b0aca7006 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -22,6 +22,11 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ) : DIALOG_GLOBAL_DELETION_BASE( parent ) { m_Parent = parent; + m_currentLayer = 0; + m_TrackFilterAR->Enable( m_DelTracks->GetValue() ); + m_TrackFilterLocked->Enable( m_DelTracks->GetValue() ); + m_TrackFilterNormal->Enable( m_DelTracks->GetValue() ); + m_TrackFilterVias->Enable( m_DelTracks->GetValue() ); SetFocus(); GetSizer()->SetSizeHints(this); @@ -32,9 +37,24 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ) void PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame( const wxPoint& pos ) { DIALOG_GLOBAL_DELETION dlg( this ); + dlg.SetCurrentLayer( getActiveLayer() ); + dlg.ShowModal(); } +void DIALOG_GLOBAL_DELETION::SetCurrentLayer( int aLayer ) +{ + m_currentLayer = aLayer; + m_textCtrlCurrLayer->SetValue( m_Parent->GetBoard()->GetLayerName( aLayer ) ); +} + +void DIALOG_GLOBAL_DELETION::OnCheckDeleteTracks( wxCommandEvent& event ) +{ + m_TrackFilterAR->Enable( m_DelTracks->GetValue() ); + m_TrackFilterLocked->Enable( m_DelTracks->GetValue() ); + m_TrackFilterNormal->Enable( m_DelTracks->GetValue() ); + m_TrackFilterVias->Enable( m_DelTracks->GetValue() ); +} void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( ) { @@ -60,7 +80,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( ) { gen_rastnest = true; - /* ZEG_ZONE items used in Zone filling selection are now deprecated : + /* SEG_ZONE items used in Zone filling selection are now deprecated : * and are deleted but not put in undo buffer if exist */ pcb->m_Zone.DeleteAll(); @@ -75,13 +95,19 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( ) } int masque_layer = 0; + int layers_filter = ALL_LAYERS; + if( m_rbLayersOption->GetSelection() != 0 ) // Use current layer only + layers_filter = 1 << m_currentLayer; + if( m_DelDrawings->GetValue() ) - masque_layer = (~EDGE_LAYER) & 0x1FFF0000; + masque_layer = (~EDGE_LAYER) & ALL_NO_CU_LAYERS; if( m_DelBoardEdges->GetValue() ) masque_layer |= EDGE_LAYER; + layers_filter &= layers_filter; + for( item = pcb->m_Drawings; item != NULL; item = nextitem ) { nextitem = item->Next(); @@ -121,16 +147,27 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( ) if( !m_TrackFilterAR->GetValue() ) track_mask_filter |= TRACK_AR; - for( item = pcb->m_Track; item != NULL; item = nextitem ) + TRACK * nexttrack; + for( TRACK *track = pcb->m_Track; track != NULL; track = nexttrack ) { - nextitem = item->Next(); + nexttrack = track->Next(); - if( (item->GetState( TRACK_LOCKED | TRACK_AR ) & track_mask_filter) != 0 ) + if( (track->GetState( TRACK_LOCKED | TRACK_AR ) & track_mask_filter) != 0 ) continue; - itemPicker.m_PickedItem = item; + if( (track->GetState( TRACK_LOCKED | TRACK_AR ) == 0) && + !m_TrackFilterNormal->GetValue() ) + continue; + + if( (track->Type() == PCB_VIA_T) && !m_TrackFilterVias->GetValue() ) + continue; + + if( (track->ReturnMaskLayer() & layers_filter) == 0 ) + continue; + + itemPicker.m_PickedItem = track; pickersList.PushItem( itemPicker ); - item->UnLink(); + track->UnLink(); gen_rastnest = true; } } diff --git a/pcbnew/dialogs/dialog_global_deletion.h b/pcbnew/dialogs/dialog_global_deletion.h index f6c1a85187..53995b0645 100644 --- a/pcbnew/dialogs/dialog_global_deletion.h +++ b/pcbnew/dialogs/dialog_global_deletion.h @@ -11,9 +11,11 @@ class DIALOG_GLOBAL_DELETION: public DIALOG_GLOBAL_DELETION_BASE { private: PCB_EDIT_FRAME * m_Parent; + int m_currentLayer; public: DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ); + void SetCurrentLayer( int aLayer ); private: void OnOkClick( wxCommandEvent& event ) @@ -27,6 +29,7 @@ private: } void AcceptPcbDelete(); + void OnCheckDeleteTracks( wxCommandEvent& event ); }; diff --git a/pcbnew/dialogs/dialog_global_deletion_base.cpp b/pcbnew/dialogs/dialog_global_deletion_base.cpp index 71a3b3eca0..53f5d5b01c 100644 --- a/pcbnew/dialogs/dialog_global_deletion_base.cpp +++ b/pcbnew/dialogs/dialog_global_deletion_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! @@ -14,7 +14,10 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer* bSizerMain; - bSizerMain = new wxBoxSizer( wxHORIZONTAL ); + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizerUpper; + bSizerUpper = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizerLeft; sbSizerLeft = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Items to delete") ), wxVERTICAL ); @@ -43,33 +46,57 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi m_DelAlls = new wxCheckBox( this, wxID_ANY, _("Clear Board"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerLeft->Add( m_DelAlls, 0, wxALL, 5 ); - bSizerMain->Add( sbSizerLeft, 1, wxEXPAND|wxALL, 5 ); + bSizerUpper->Add( sbSizerLeft, 1, wxEXPAND|wxALL, 5 ); - wxBoxSizer* bSizer2; - bSizer2 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); - wxStaticBoxSizer* sbSizerTrackFilter; - sbSizerTrackFilter = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Track Filter") ), wxVERTICAL ); + sbTrackFilter = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Track Filter") ), wxVERTICAL ); - m_TrackFilterAR = new wxCheckBox( this, wxID_ANY, _("Include AutoRouted Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerTrackFilter->Add( m_TrackFilterAR, 0, wxALL, 5 ); + m_TrackFilterAR = new wxCheckBox( this, wxID_ANY, _("AutoRouted Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TrackFilterAR->SetValue(true); + sbTrackFilter->Add( m_TrackFilterAR, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_TrackFilterLocked = new wxCheckBox( this, wxID_ANY, _("Include Locked Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerTrackFilter->Add( m_TrackFilterLocked, 0, wxALL, 5 ); + m_TrackFilterLocked = new wxCheckBox( this, wxID_ANY, _("Locked Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + sbTrackFilter->Add( m_TrackFilterLocked, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - bSizer2->Add( sbSizerTrackFilter, 0, wxALL|wxEXPAND, 5 ); + m_TrackFilterNormal = new wxCheckBox( this, wxID_ANY, _("Normal Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TrackFilterNormal->SetValue(true); + sbTrackFilter->Add( m_TrackFilterNormal, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_TrackFilterVias = new wxCheckBox( this, wxID_ANY, _("Vias"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TrackFilterVias->SetValue(true); + sbTrackFilter->Add( m_TrackFilterVias, 0, wxALL, 5 ); - bSizer2->Add( 0, 10, 0, 0, 5 ); + bSizerRight->Add( sbTrackFilter, 0, wxALL|wxEXPAND, 5 ); - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOK->SetDefault(); - bSizer2->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 ); + wxString m_rbLayersOptionChoices[] = { _("All Layers"), _("Current Layer Only") }; + int m_rbLayersOptionNChoices = sizeof( m_rbLayersOptionChoices ) / sizeof( wxString ); + m_rbLayersOption = new wxRadioBox( this, wxID_ANY, _("Layers Filter"), wxDefaultPosition, wxDefaultSize, m_rbLayersOptionNChoices, m_rbLayersOptionChoices, 1, wxRA_SPECIFY_COLS ); + m_rbLayersOption->SetSelection( 0 ); + bSizerRight->Add( m_rbLayersOption, 0, wxALL|wxEXPAND, 5 ); - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer2->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 ); + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Current layer:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + bSizerRight->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - bSizerMain->Add( bSizer2, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + m_textCtrlCurrLayer = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + bSizerRight->Add( m_textCtrlCurrLayer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizerUpper->Add( bSizerRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + bSizerMain->Add( bSizerUpper, 0, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + bSizerMain->Add( m_sdbSizer1, 0, wxEXPAND, 5 ); this->SetSizer( bSizerMain ); this->Layout(); @@ -77,14 +104,16 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi this->Centre( wxBOTH ); // Connect Events - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this ); + m_DelTracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCheckDeleteTracks ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this ); } DIALOG_GLOBAL_DELETION_BASE::~DIALOG_GLOBAL_DELETION_BASE() { // Disconnect Events - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this ); + m_DelTracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCheckDeleteTracks ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_global_deletion_base.fbp b/pcbnew/dialogs/dialog_global_deletion_base.fbp index 714e9cfa69..b2d308aff3 100644 --- a/pcbnew/dialogs/dialog_global_deletion_base.fbp +++ b/pcbnew/dialogs/dialog_global_deletion_base.fbp @@ -7,6 +7,7 @@ 1 source_name 0 + res UTF-8 connect dialog_global_deletion_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_GLOBAL_DELETION_BASE + 1 + + + 1 - 365,242 + + Resizable + + 1 + 365,292 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + 0 wxFILTER_NONE @@ -51,6 +84,12 @@ + + + + + + @@ -82,496 +121,26 @@ bSizerMain - wxHORIZONTAL + wxVERTICAL none 5 - wxEXPAND|wxALL - 1 - - wxID_ANY - Items to delete - - sbSizerLeft - wxVERTICAL - none - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Zones - - - m_DelZones - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Texts - - - m_DelTexts - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Board Outlines - - - m_DelBoardEdges - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Drawings - - - m_DelDrawings - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Modules - - - m_DelModules - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Tracks - - - m_DelTracks - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Delete Markers - - - m_DelMarkers - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - 1 - - - 0 - wxID_ANY - Clear Board - - - m_DelAlls - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 1 + wxEXPAND + 0 - bSizer2 - wxVERTICAL + bSizerUpper + wxHORIZONTAL none 5 - wxALL|wxEXPAND - 0 + wxEXPAND|wxALL + 1 wxID_ANY - Track Filter + Items to delete - sbSizerTrackFilter + sbSizerLeft wxVERTICAL none @@ -580,24 +149,55 @@ wxALL 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY - Include AutoRouted Tracks + Delete Zones + + + 0 + + 0 - m_TrackFilterAR + 1 + m_DelZones + 1 + + protected + 1 + + Resizable + + 1 + 0 wxFILTER_NONE @@ -637,24 +237,583 @@ wxALL 0 + 1 + 1 + 1 + 1 + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY - Include Locked Tracks + Delete Texts + + + 0 + + 0 - m_TrackFilterLocked + 1 + m_DelTexts + 1 + + protected + 1 + + Resizable + + 1 + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete Board Outlines + + + 0 + + + 0 + + 1 + m_DelBoardEdges + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete Drawings + + + 0 + + + 0 + + 1 + m_DelDrawings + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete Modules + + + 0 + + + 0 + + 1 + m_DelModules + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete Tracks + + + 0 + + + 0 + + 1 + m_DelTracks + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnCheckDeleteTracks + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete Markers + + + 0 + + + 0 + + 1 + m_DelMarkers + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Clear Board + + + 0 + + + 0 + + 1 + m_DelAlls + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 wxFILTER_NONE @@ -693,130 +852,762 @@ 5 - - 0 - - 10 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 - - - - 1 - 1 - 1 - - - 0 - wxID_OK - &OK - + wxALIGN_CENTER_VERTICAL|wxEXPAND + 1 + - m_buttonOK - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 1 - 0 - 1 - - - 0 - wxID_CANCEL - &Cancel - - - m_buttonCancel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - + bSizerRight + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Track Filter + + sbTrackFilter + wxVERTICAL + protected + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + AutoRouted Tracks + + + 0 + + + 0 + + 1 + m_TrackFilterAR + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Locked Tracks + + + 0 + + + 0 + + 1 + m_TrackFilterLocked + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Normal Tracks + + + 0 + + + 0 + + 1 + m_TrackFilterNormal + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Vias + + + 0 + + + 0 + + 1 + m_TrackFilterVias + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + "All Layers" "Current Layer Only" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layers Filter + + 1 + + 0 + + + 0 + + 1 + m_rbLayersOption + 1 + + + protected + 1 + + + Resizable + + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Current layer: + + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + 0 + + 1 + m_textCtrlCurrLayer + 1 + + + protected + 1 + + + Resizable + + 1 + + wxTE_READONLY + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + + Resizable + + 1 + + wxLI_HORIZONTAL + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + OnCancelClick + + + + OnOkClick + + + + diff --git a/pcbnew/dialogs/dialog_global_deletion_base.h b/pcbnew/dialogs/dialog_global_deletion_base.h index 4b08fae6b9..241a3e2bee 100644 --- a/pcbnew/dialogs/dialog_global_deletion_base.h +++ b/pcbnew/dialogs/dialog_global_deletion_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_global_deletion_base__ -#define __dialog_global_deletion_base__ +#ifndef __DIALOG_GLOBAL_DELETION_BASE_H__ +#define __DIALOG_GLOBAL_DELETION_BASE_H__ +#include +#include #include - #include #include #include @@ -18,6 +19,10 @@ #include #include #include +#include +#include +#include +#include #include #include @@ -40,22 +45,30 @@ class DIALOG_GLOBAL_DELETION_BASE : public wxDialog wxCheckBox* m_DelTracks; wxCheckBox* m_DelMarkers; wxCheckBox* m_DelAlls; + wxStaticBoxSizer* sbTrackFilter; wxCheckBox* m_TrackFilterAR; wxCheckBox* m_TrackFilterLocked; - - wxButton* m_buttonOK; - wxButton* m_buttonCancel; + wxCheckBox* m_TrackFilterNormal; + wxCheckBox* m_TrackFilterVias; + wxRadioBox* m_rbLayersOption; + wxStaticText* m_staticText1; + wxTextCtrl* m_textCtrlCurrLayer; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCheckDeleteTracks( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 365,242 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 365,292 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_GLOBAL_DELETION_BASE(); }; -#endif //__dialog_global_deletion_base__ +#endif //__DIALOG_GLOBAL_DELETION_BASE_H__ diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index 3c17c76976..47343c5194 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -508,6 +508,7 @@ void DRC::testUnconnected() if( m_pcb->GetRatsnestsCount() == 0 ) return; + wxString msg; for( unsigned ii = 0; ii < m_pcb->GetRatsnestsCount(); ++ii ) { RATSNEST_ITEM& rat = m_pcb->m_FullRatsnest[ii]; @@ -518,8 +519,9 @@ void DRC::testUnconnected() D_PAD* padStart = rat.m_PadStart; D_PAD* padEnd = rat.m_PadEnd; + msg = padStart->GetSelectMenuText() + wxT( " net " ) + padStart->GetNetname(); DRC_ITEM* uncItem = new DRC_ITEM( DRCE_UNCONNECTED_PADS, - padStart->GetSelectMenuText(), + msg, padEnd->GetSelectMenuText(), padStart->GetPosition(), padEnd->GetPosition() ); diff --git a/pcbnew/tr_modif.cpp b/pcbnew/tr_modif.cpp index dc9fa9e6c0..e05907c996 100644 --- a/pcbnew/tr_modif.cpp +++ b/pcbnew/tr_modif.cpp @@ -97,8 +97,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, /* Flags for cleaning the net. */ for( pt_del = bufStart; pt_del; pt_del = pt_del->Next() ) { - //D( printf( "track %p turning off BUSY | IN_EDIT | IS_LINKED\n", pt_del ); ) - D( std::cout<<"track "<SetState( BUSY | IN_EDIT | IS_LINKED, OFF ); if( pt_del == bufEnd ) // Last segment reached