From 38a3f1b871eb4b1744305c27037362b84e80653e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 7 Mar 2011 13:28:14 +0100 Subject: [PATCH] Pcbnew: Fix a very minor issue in left toolbar. Add option in dialog bloc to move,copy ... items on invisible layers or not. --- pcbnew/block.cpp | 70 +- pcbnew/dialogs/dialog_block_options_base.cpp | 195 +- pcbnew/dialogs/dialog_block_options_base.fbp | 1873 ++++++++++-------- pcbnew/dialogs/dialog_block_options_base.h | 123 +- pcbnew/pcbframe.cpp | 1 + 5 files changed, 1214 insertions(+), 1048 deletions(-) diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index 42b1ded3b2..0f6c5c9889 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -49,6 +49,7 @@ static bool blockIncludeItemsOnTechLayers = true; static bool blockIncludeBoardOutlineLayer = true; static bool blockIncludePcbTexts = true; static bool blockDrawItems = true; +static bool blockIncludeItemsOnInvisibleLayers = false; /************************************/ /* class DIALOG_BLOCK_OPTIONS */ @@ -118,6 +119,7 @@ DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( PCB_BASE_FRAME* aParent, const wxStr m_Include_Edges_Items->SetValue( blockIncludeBoardOutlineLayer ); m_Include_PcbTextes->SetValue( blockIncludePcbTexts ); m_DrawBlockItems->SetValue( blockDrawItems ); + m_checkBoxIncludeInvisible->SetValue( blockIncludeItemsOnInvisibleLayers ); m_sdbSizer1OK->SetDefault(); SetFocus(); GetSizer()->SetSizeHints( this ); @@ -135,6 +137,7 @@ void DIALOG_BLOCK_OPTIONS::ExecuteCommand( wxCommandEvent& event ) blockIncludeBoardOutlineLayer = m_Include_Edges_Items->GetValue(); blockIncludePcbTexts = m_Include_PcbTextes->GetValue(); blockDrawItems = m_DrawBlockItems->GetValue(); + blockIncludeItemsOnInvisibleLayers = m_checkBoxIncludeInvisible->GetValue(); EndModal( 0 ); } @@ -297,8 +300,6 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) // Exit if no items found if( !GetScreen()->m_BlockLocate.GetCount() ) cancelCmd = true; -// else -// nextcmd = true; } } @@ -399,12 +400,14 @@ void PCB_EDIT_FRAME::Block_SelectItems() int layer = module->GetLayer(); if( module->HitTest( GetScreen()->m_BlockLocate ) - && ( !module->IsLocked() || blockIncludeLockedModules ) - && m_Pcb->IsModuleLayerVisible( layer ) ) + && ( !module->IsLocked() || blockIncludeLockedModules ) ) { - picker.m_PickedItem = module; - picker.m_PickedItemType = module->Type(); - itemsList->PushItem( picker ); + if( blockIncludeItemsOnInvisibleLayers || m_Pcb->IsModuleLayerVisible( layer ) ) + { + picker.m_PickedItem = module; + picker.m_PickedItemType = module->Type(); + itemsList->PushItem( picker ); + } } } } @@ -415,12 +418,14 @@ void PCB_EDIT_FRAME::Block_SelectItems() for( TRACK* pt_segm = m_Pcb->m_Track; pt_segm != NULL; pt_segm = pt_segm->Next() ) { - if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) - && m_Pcb->IsLayerVisible( pt_segm->GetLayer() ) ) + if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) ) { - picker.m_PickedItem = pt_segm; - picker.m_PickedItemType = pt_segm->Type(); - itemsList->PushItem( picker ); + if( blockIncludeItemsOnInvisibleLayers || m_Pcb->IsLayerVisible( pt_segm->GetLayer() ) ) + { + picker.m_PickedItem = pt_segm; + picker.m_PickedItemType = pt_segm->Type(); + itemsList->PushItem( picker ); + } } } } @@ -437,13 +442,13 @@ void PCB_EDIT_FRAME::Block_SelectItems() for( BOARD_ITEM* PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() ) { - if( !m_Pcb->IsLayerVisible( PtStruct->GetLayer() ) ) + if( !m_Pcb->IsLayerVisible( PtStruct->GetLayer() ) && ! blockIncludeItemsOnInvisibleLayers) continue; bool select_me = false; switch( PtStruct->Type() ) { case TYPE_DRAWSEGMENT: - if( (g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer) == 0 ) + if( (g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer) == 0 ) break; if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) ) @@ -461,7 +466,7 @@ void PCB_EDIT_FRAME::Block_SelectItems() break; case TYPE_MIRE: - if( ( g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer ) == 0 ) + if( ( g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer ) == 0 ) break; if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) ) @@ -493,38 +498,19 @@ void PCB_EDIT_FRAME::Block_SelectItems() // Add zones if( blockIncludeZones ) { -#if 0 - - /* This section can creates problems if selected: - * m_Pcb->m_Zone can have a *lot* of items (100 000 is easily possible) - * so it is not selected (and TODO: will be removed, one day) - */ - for( SEGZONE* pt_segm = m_Pcb->m_Zone; pt_segm != NULL; - pt_segm = pt_segm->Next() ) - { - /* Segments used in Zone filling selection */ - - if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) - && m_Pcb->IsLayerVisible( pt_segm->GetLayer() ) ) - { - picker.m_PickedItem = pt_segm; - picker.m_PickedItemType = pt_segm->Type(); - itemsList->PushItem( picker ); - } - } - -#endif for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) { ZONE_CONTAINER* area = m_Pcb->GetArea( ii ); - if( area->HitTest( GetScreen()->m_BlockLocate ) - && m_Pcb->IsLayerVisible( area->GetLayer() ) ) + if( area->HitTest( GetScreen()->m_BlockLocate ) ) { - BOARD_ITEM* zone_c = (BOARD_ITEM*) area; - picker.m_PickedItem = zone_c; - picker.m_PickedItemType = zone_c->Type(); - itemsList->PushItem( picker ); + if( blockIncludeItemsOnInvisibleLayers || m_Pcb->IsLayerVisible( area->GetLayer() ) ) + { + BOARD_ITEM* zone_c = (BOARD_ITEM*) area; + picker.m_PickedItem = zone_c; + picker.m_PickedItemType = zone_c->Type(); + itemsList->PushItem( picker ); + } } } } diff --git a/pcbnew/dialogs/dialog_block_options_base.cpp b/pcbnew/dialogs/dialog_block_options_base.cpp index 737ae273db..ff5d1afd49 100644 --- a/pcbnew/dialogs/dialog_block_options_base.cpp +++ b/pcbnew/dialogs/dialog_block_options_base.cpp @@ -1,93 +1,102 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 18 2010) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_block_options_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_BLOCK_OPTIONS_BASE::DIALOG_BLOCK_OPTIONS_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* bSizerMain; - bSizerMain = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer1; - sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - - wxGridSizer* gSizer1; - gSizer1 = new wxGridSizer( 4, 2, 0, 0 ); - - m_Include_Modules = new wxCheckBox( this, wxID_ANY, _("Include modules"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_Include_Modules, 0, wxALL, 5 ); - - m_Include_PcbTextes = new wxCheckBox( this, wxID_ANY, _("Include text items"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 ); - - m_IncludeLockedModules = new wxCheckBox( this, wxID_ANY, _("Include locked modules"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 ); - - m_Include_Draw_Items = new wxCheckBox( this, wxID_ANY, _("Include drawings"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_Include_Draw_Items, 0, wxALL, 5 ); - - m_Include_Tracks = new wxCheckBox( this, wxID_ANY, _("Include tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_Include_Tracks, 0, wxALL, 5 ); - - m_Include_Edges_Items = new wxCheckBox( this, wxID_ANY, _("Include board outline layer"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_Include_Edges_Items, 0, wxALL, 5 ); - - m_Include_Zones = new wxCheckBox( this, wxID_ANY, _("Include zones"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_Include_Zones, 0, wxALL, 5 ); - - m_DrawBlockItems = new wxCheckBox( this, wxID_ANY, _("Draw selected items while moving"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 ); - - sbSizer1->Add( gSizer1, 0, wxEXPAND, 5 ); - - bSizerMain->Add( sbSizer1, 1, wxALL|wxEXPAND, 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, wxALIGN_RIGHT|wxALL, 5 ); - - this->SetSizer( bSizerMain ); - this->Layout(); - - this->Centre( wxBOTH ); - - // Connect Events - m_Include_Modules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_PcbTextes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_IncludeLockedModules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Draw_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Tracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Edges_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Zones->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_DrawBlockItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this ); -} - -DIALOG_BLOCK_OPTIONS_BASE::~DIALOG_BLOCK_OPTIONS_BASE() -{ - // Disconnect Events - m_Include_Modules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_PcbTextes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_IncludeLockedModules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Draw_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Tracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Edges_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_Include_Zones->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_DrawBlockItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this ); - -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Nov 17 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_block_options_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_BLOCK_OPTIONS_BASE::DIALOG_BLOCK_OPTIONS_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* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer1; + sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); + + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 4, 2, 0, 0 ); + + m_Include_Modules = new wxCheckBox( this, wxID_ANY, _("Include modules"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_Include_Modules, 0, wxALL, 5 ); + + m_Include_PcbTextes = new wxCheckBox( this, wxID_ANY, _("Include text items"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Include_PcbTextes->SetValue(true); + gSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 ); + + m_IncludeLockedModules = new wxCheckBox( this, wxID_ANY, _("Include locked modules"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 ); + + m_Include_Draw_Items = new wxCheckBox( this, wxID_ANY, _("Include drawings"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_Include_Draw_Items, 0, wxALL, 5 ); + + m_Include_Tracks = new wxCheckBox( this, wxID_ANY, _("Include tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_Include_Tracks, 0, wxALL, 5 ); + + m_Include_Edges_Items = new wxCheckBox( this, wxID_ANY, _("Include board outline layer"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_Include_Edges_Items, 0, wxALL, 5 ); + + m_Include_Zones = new wxCheckBox( this, wxID_ANY, _("Include zones"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_Include_Zones, 0, wxALL, 5 ); + + m_DrawBlockItems = new wxCheckBox( this, wxID_ANY, _("Draw selected items while moving"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 ); + + sbSizer1->Add( gSizer1, 0, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizer1->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_checkBoxIncludeInvisible = new wxCheckBox( this, wxID_ANY, _("Include items on invisible layers"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_checkBoxIncludeInvisible, 0, wxALL, 5 ); + + bSizerMain->Add( sbSizer1, 1, wxALL|wxEXPAND, 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, wxALIGN_RIGHT|wxALL, 5 ); + + this->SetSizer( bSizerMain ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + m_Include_Modules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_PcbTextes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_IncludeLockedModules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Draw_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Tracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Edges_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Zones->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_DrawBlockItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_checkBoxIncludeInvisible->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this ); +} + +DIALOG_BLOCK_OPTIONS_BASE::~DIALOG_BLOCK_OPTIONS_BASE() +{ + // Disconnect Events + m_Include_Modules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_PcbTextes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_IncludeLockedModules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Draw_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Tracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Edges_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_Include_Zones->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_DrawBlockItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_checkBoxIncludeInvisible->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_block_options_base.fbp b/pcbnew/dialogs/dialog_block_options_base.fbp index 232453c3c2..afad8ab928 100644 --- a/pcbnew/dialogs/dialog_block_options_base.fbp +++ b/pcbnew/dialogs/dialog_block_options_base.fbp @@ -1,853 +1,1020 @@ - - - - - - C++ - 1 - source_name - 0 - UTF-8 - connect - dialog_block_options_base - 1000 - none - 1 - dialog_block_options_base - - . - - 1 - 1 - 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_BLOCK_OPTIONS_BASE - 1 - - - 1 - - - Resizable - - 1 - 397,171 - wxDEFAULT_DIALOG_STYLE - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerMain - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - wxID_ANY - Options - - sbSizer1 - wxVERTICAL - none - - - 5 - wxEXPAND - 0 - - 2 - 0 - - gSizer1 - none - 4 - 0 - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include modules - - 0 - - 0 - - 1 - m_Include_Modules - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include text items - - 0 - - 0 - - 1 - m_Include_PcbTextes - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include locked modules - - 0 - - 0 - - 1 - m_IncludeLockedModules - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include drawings - - 0 - - 0 - - 1 - m_Include_Draw_Items - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include tracks - - 0 - - 0 - - 1 - m_Include_Tracks - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include board outline layer - - 0 - - 0 - - 1 - m_Include_Edges_Items - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Include zones - - 0 - - 0 - - 1 - m_Include_Zones - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Draw selected items while moving - - 0 - - 0 - - 1 - m_DrawBlockItems - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_RIGHT|wxALL - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - OnCancel - - - - ExecuteCommand - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_block_options_base + 1000 + none + 1 + dialog_block_options_base + + . + + 1 + 1 + 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_BLOCK_OPTIONS_BASE + 1 + + + 1 + + + Resizable + + 1 + 397,226 + wxDEFAULT_DIALOG_STYLE + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + Options + + sbSizer1 + wxVERTICAL + none + + + 5 + wxEXPAND + 0 + + 2 + 0 + + gSizer1 + none + 4 + 0 + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include modules + + 0 + + 0 + + 1 + m_Include_Modules + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include text items + + 0 + + 0 + + 1 + m_Include_PcbTextes + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include locked modules + + 0 + + 0 + + 1 + m_IncludeLockedModules + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include drawings + + 0 + + 0 + + 1 + m_Include_Draw_Items + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include tracks + + 0 + + 0 + + 1 + m_Include_Tracks + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include board outline layer + + 0 + + 0 + + 1 + m_Include_Edges_Items + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include zones + + 0 + + 0 + + 1 + m_Include_Zones + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Draw selected items while moving + + 0 + + 0 + + 1 + m_DrawBlockItems + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Include items on invisible layers + + 0 + + 0 + + 1 + m_checkBoxIncludeInvisible + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + OnCancel + + + + ExecuteCommand + + + + + + + + diff --git a/pcbnew/dialogs/dialog_block_options_base.h b/pcbnew/dialogs/dialog_block_options_base.h index 59134578d4..2d2dff2abc 100644 --- a/pcbnew/dialogs/dialog_block_options_base.h +++ b/pcbnew/dialogs/dialog_block_options_base.h @@ -1,60 +1,63 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 18 2010) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_block_options_base__ -#define __dialog_block_options_base__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_BLOCK_OPTIONS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_BLOCK_OPTIONS_BASE : public wxDialog -{ - private: - - protected: - wxCheckBox* m_Include_Modules; - wxCheckBox* m_Include_PcbTextes; - wxCheckBox* m_IncludeLockedModules; - wxCheckBox* m_Include_Draw_Items; - wxCheckBox* m_Include_Tracks; - wxCheckBox* m_Include_Edges_Items; - wxCheckBox* m_Include_Zones; - wxCheckBox* m_DrawBlockItems; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void checkBoxClicked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - virtual void ExecuteCommand( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 397,171 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~DIALOG_BLOCK_OPTIONS_BASE(); - -}; - -#endif //__dialog_block_options_base__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Nov 17 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_block_options_base__ +#define __dialog_block_options_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_BLOCK_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_BLOCK_OPTIONS_BASE : public wxDialog +{ + private: + + protected: + wxCheckBox* m_Include_Modules; + wxCheckBox* m_Include_PcbTextes; + wxCheckBox* m_IncludeLockedModules; + wxCheckBox* m_Include_Draw_Items; + wxCheckBox* m_Include_Tracks; + wxCheckBox* m_Include_Edges_Items; + wxCheckBox* m_Include_Zones; + wxCheckBox* m_DrawBlockItems; + wxStaticLine* m_staticline1; + wxCheckBox* m_checkBoxIncludeInvisible; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + + // Virtual event handlers, overide them in your derived class + virtual void checkBoxClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + virtual void ExecuteCommand( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 397,226 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~DIALOG_BLOCK_OPTIONS_BASE(); + +}; + +#endif //__dialog_block_options_base__ diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 7d2dd2a4d4..5a04af4c74 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -228,6 +228,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::OnUpdateLayerSelectBox ) EVT_UPDATE_UI( ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnUpdateDrcEnable ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest ) + EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowModuleRatsnest ) EVT_UPDATE_UI( ID_TB_OPTIONS_AUTO_DEL_TRACK, PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, PCB_EDIT_FRAME::OnUpdateViaDrawMode ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, PCB_EDIT_FRAME::OnUpdateTraceDrawMode )