diff --git a/cvpcb/cvpcb.cpp b/cvpcb/cvpcb.cpp index 839ec65ba2..439fef2586 100644 --- a/cvpcb/cvpcb.cpp +++ b/cvpcb/cvpcb.cpp @@ -15,6 +15,7 @@ #include "protos.h" #include "cvstruct.h" #include "colors_selection.h" +#include "cvpcb_id.h" #include "build_version.h" diff --git a/eeschema/load_one_schematic_file.cpp b/eeschema/load_one_schematic_file.cpp index d204ba6a27..ca7c1ce857 100644 --- a/eeschema/load_one_schematic_file.cpp +++ b/eeschema/load_one_schematic_file.cpp @@ -71,10 +71,14 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F return FALSE; } - // get the file version here. TODO: Support version numbers > 9 - char version = line[9 + sizeof(SCHEMATIC_HEAD_STRING)]; - int ver = version - '0'; - if( ver > EESCHEMA_VERSION ) + // get the file version here. + char *strversion = line + 9 + sizeof(SCHEMATIC_HEAD_STRING); + // Skip blanks + while( *strversion && *strversion < '0' ) + strversion++; + int version = atoi(strversion); + + if( version > EESCHEMA_VERSION ) { MsgDiag = FullFileName + _( " was created by a more recent \ version of EESchema and may not load correctly. Please consider updating!" ); @@ -83,7 +87,7 @@ version of EESchema and may not load correctly. Please consider updating!" ); #if 0 // Compile it if the new version is unreadable by previous eeschema versions - else if( ver < EESCHEMA_VERSION ) + else if( version < EESCHEMA_VERSION ) { MsgDiag = FullFileName + _( " was created by an older version of \ EESchema. It will be stored in the new file format when you save this file \ @@ -159,9 +163,9 @@ again." ); } else if( Name1[0] == 'L' ) item = new SCH_LABEL(); - else if( Name1[0] == 'G' && ver > '1' ) + else if( Name1[0] == 'G' && version > 1 ) item = new SCH_GLOBALLABEL(); - else if( (Name1[0] == 'H') || (Name1[0] == 'G' && ver == '1') ) + else if( (Name1[0] == 'H') || (Name1[0] == 'G' && version == 1) ) item = new SCH_HIERLABEL(); else item = new SCH_TEXT(); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 265c5719f1..a4e09a43df 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -4,6 +4,7 @@ add_definitions(-DPCBNEW) # Includes ### include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs ${Boost_INCLUDE_DIR} ../3d-viewer ../common @@ -41,6 +42,7 @@ set(PCBNEW_SRCS cross-probing.cpp debug_kbool_key_file_fct.cpp deltrack.cpp + dialogs/dialog_block_options_base.cpp dialog_copper_zones.cpp dialog_copper_zones_base.cpp dialog_design_rules.cpp diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index 4363c7bdba..c99ced6302 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -16,6 +16,8 @@ #include "pcbplot.h" #include "trigo.h" +#include "dialog_block_options_base.h" + #include "protos.h" #define BLOCK_OUTLINE_COLOR YELLOW @@ -29,6 +31,7 @@ **/ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, wxPoint aOffset ); + /** * Function drawMovingBlock * handles drawing of a moving block @@ -40,184 +43,89 @@ static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC, bool aErase ); -static bool Block_Include_Modules = TRUE; -static bool BlockIncludeLockedModules = TRUE; -static bool Block_Include_Tracks = TRUE; -static bool Block_Include_Zones = TRUE; -static bool Block_Include_Draw_Items = TRUE; -static bool Block_Include_Edges_Items = TRUE; -static bool Block_Include_PcbTextes = TRUE; -static bool BlockDrawItems = TRUE; +static bool Block_Include_Modules = true; +static bool BlockIncludeLockedModules = true; +static bool Block_Include_Tracks = true; +static bool Block_Include_Zones = true; +static bool Block_Include_Draw_Items = true; +static bool Block_Include_Edges_Items = true; +static bool Block_Include_PcbTextes = true; +static bool BlockDrawItems = true; /************************************/ -/* class WinEDA_ExecBlockCmdFrame */ +/* class DIALOG_BLOCK_OPTIONS */ /************************************/ -class WinEDA_ExecBlockCmdFrame : public wxDialog +class DIALOG_BLOCK_OPTIONS : public DIALOG_BLOCK_OPTIONS_BASE { private: - WinEDA_BasePcbFrame* m_Parent; - wxCheckBox* m_Include_Modules; - wxCheckBox* m_IncludeLockedModules; - wxCheckBox* m_Include_Tracks; - wxCheckBox* m_Include_Zones; - wxCheckBox* m_Include_Draw_Items; - wxCheckBox* m_Include_Edges_Items; - wxCheckBox* m_Include_PcbTextes; - wxCheckBox* m_DrawBlockItems; public: - WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, - const wxString& title ); - ~WinEDA_ExecBlockCmdFrame() + DIALOG_BLOCK_OPTIONS( WinEDA_BasePcbFrame* parent, + const wxString& title ); + ~DIALOG_BLOCK_OPTIONS() { } private: void ExecuteCommand( wxCommandEvent& event ); - void Cancel( wxCommandEvent& event ); + void OnCancel( wxCommandEvent& event ); void checkBoxClicked( wxCommandEvent& aEvent ); - - DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE( WinEDA_ExecBlockCmdFrame, wxDialog ) - EVT_BUTTON( wxID_OK, WinEDA_ExecBlockCmdFrame::ExecuteCommand ) - EVT_BUTTON( wxID_CANCEL, WinEDA_ExecBlockCmdFrame::Cancel ) - EVT_CHECKBOX( wxID_ANY, WinEDA_ExecBlockCmdFrame::checkBoxClicked ) -END_EVENT_TABLE() - - -static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent, - const wxString& title ) +static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent, const wxString& title ) { int nocmd; wxPoint oldpos = parent->GetScreen()->m_Curseur; - parent->DrawPanel->m_IgnoreMouseEvents = TRUE; - WinEDA_ExecBlockCmdFrame* frame = - new WinEDA_ExecBlockCmdFrame( parent, title ); + parent->DrawPanel->m_IgnoreMouseEvents = true; + DIALOG_BLOCK_OPTIONS dlg( parent, title ); - nocmd = frame->ShowModal(); - frame->Destroy(); + nocmd = dlg.ShowModal(); parent->GetScreen()->m_Curseur = oldpos; parent->DrawPanel->MouseToCursorSchema(); - parent->DrawPanel->m_IgnoreMouseEvents = FALSE; + parent->DrawPanel->m_IgnoreMouseEvents = false; parent->DrawPanel->SetCursor( parent->DrawPanel->m_PanelCursor = - parent->DrawPanel->m_PanelDefaultCursor ); + parent->DrawPanel->m_PanelDefaultCursor ); - return nocmd ? FALSE : TRUE; + return nocmd ? false : true; } -WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, - const wxString& title ) : - wxDialog( parent, -1, title, wxPoint( -1, -1 ), wxDefaultSize, - DIALOG_STYLE ) +DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( WinEDA_BasePcbFrame* parent, + const wxString& title ) : + DIALOG_BLOCK_OPTIONS_BASE( parent, -1, title ) { - wxPoint pos; - wxButton* m_button1; - wxButton* m_button2; - m_Parent = parent; - Centre(); - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - this->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, - false, wxEmptyString ) ); - - /* Sizer 1 creation */ - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 7, 1, 0, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_Include_Modules = new wxCheckBox( this, -1, _( "Include Modules" ), - wxDefaultPosition, wxDefaultSize, - 0 ); - m_Include_Modules->SetValue( Block_Include_Modules ); - fgSizer1->Add( m_Include_Modules, 0, wxALL, 5 ); - m_IncludeLockedModules = new wxCheckBox( this, -1, _( "Include Locked Modules" ), - wxDefaultPosition, wxDefaultSize, - 0 ); + m_Include_Modules->SetValue( Block_Include_Modules ); m_IncludeLockedModules->SetValue( BlockIncludeLockedModules ); - if( m_Include_Modules->GetValue() ) - m_IncludeLockedModules->Enable(); - else - m_IncludeLockedModules->Disable(); - fgSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 ); - - m_Include_Tracks = new wxCheckBox( this, -1, _( "Include Tracks" ), - wxDefaultPosition, wxDefaultSize, 0 ); m_Include_Tracks->SetValue( Block_Include_Tracks ); - fgSizer1->Add( m_Include_Tracks, 0, wxALL, 5 ); - - m_Include_Zones = new wxCheckBox( this, -1, _( "Include Zones" ), - wxDefaultPosition, wxDefaultSize, 0 ); m_Include_Zones->SetValue( Block_Include_Zones ); - fgSizer1->Add( m_Include_Zones, 0, wxALL, 5 ); - - m_Include_PcbTextes = new wxCheckBox( this, -1, - _( "Include Text Items" ), - wxDefaultPosition, - wxDefaultSize, 0 ); - m_Include_PcbTextes->SetValue( Block_Include_PcbTextes ); - fgSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 ); - - m_Include_Draw_Items = new wxCheckBox( this, -1, _( "Include Drawings" ), - wxDefaultPosition, - wxDefaultSize, 0 ); m_Include_Draw_Items->SetValue( Block_Include_Draw_Items ); - fgSizer1->Add( m_Include_Draw_Items, 0, wxALL, 5 ); - - m_Include_Edges_Items = new wxCheckBox( this, -1, - _( "Include Board Outline Layer" ), - wxDefaultPosition, - wxDefaultSize, 0 ); m_Include_Edges_Items->SetValue( Block_Include_Edges_Items ); - fgSizer1->Add( m_Include_Edges_Items, 0, wxALL, 5 ); - - m_DrawBlockItems = new wxCheckBox( this, -1, - _( "Draw Block Items" ), - wxDefaultPosition, - wxDefaultSize, 0 ); + m_Include_PcbTextes->SetValue( Block_Include_PcbTextes ); m_DrawBlockItems->SetValue( BlockDrawItems ); - fgSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 ); - - /* Sizer 2 creation */ - wxFlexGridSizer* fgSizer2; - fgSizer2 = new wxFlexGridSizer( 1, 2, 0, 0 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); - fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_button2 = new wxButton( this, wxID_CANCEL, _( "Cancel" ), - wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_button2, 0, wxALL, 5 ); - m_button1 = new wxButton( this, wxID_OK, _( "OK" ), wxDefaultPosition, - wxDefaultSize, 0 ); - m_button1->SetDefault(); - fgSizer2->Add( m_button1, 0, wxALL, 5 ); - - fgSizer1->Add( fgSizer2, 1, wxALIGN_RIGHT, 5 ); - this->SetSizer( fgSizer1 ); - this->Layout(); - fgSizer1->Fit( this ); + SetFocus(); + GetSizer()->SetSizeHints( this ); + Centre(); } -void WinEDA_ExecBlockCmdFrame::Cancel( wxCommandEvent& WXUNUSED (event) ) +void DIALOG_BLOCK_OPTIONS::OnCancel( wxCommandEvent& WXUNUSED (event) ) { EndModal( -1 ); } -void WinEDA_ExecBlockCmdFrame::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent) ) + +void DIALOG_BLOCK_OPTIONS::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent) ) { if( m_Include_Modules->GetValue() ) m_IncludeLockedModules->Enable(); @@ -225,7 +133,8 @@ void WinEDA_ExecBlockCmdFrame::checkBoxClicked( wxCommandEvent& WXUNUSED (aEvent m_IncludeLockedModules->Disable(); } -void WinEDA_ExecBlockCmdFrame::ExecuteCommand( wxCommandEvent& event ) + +void DIALOG_BLOCK_OPTIONS::ExecuteCommand( wxCommandEvent& event ) { Block_Include_Modules = m_Include_Modules->GetValue(); BlockIncludeLockedModules = m_IncludeLockedModules->GetValue(); @@ -234,7 +143,7 @@ void WinEDA_ExecBlockCmdFrame::ExecuteCommand( wxCommandEvent& event ) Block_Include_Draw_Items = m_Include_Draw_Items->GetValue(); Block_Include_Edges_Items = m_Include_Edges_Items->GetValue(); Block_Include_PcbTextes = m_Include_PcbTextes->GetValue(); - BlockDrawItems = m_DrawBlockItems->GetValue(); + BlockDrawItems = m_DrawBlockItems->GetValue(); EndModal( 0 ); } @@ -285,11 +194,11 @@ int WinEDA_PcbFrame::ReturnBlockCommand( int key ) /* Routine to handle the BLOCK PLACE command */ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) { - bool err = FALSE; + bool err = false; if( DrawPanel->ManageCurseur == NULL ) { - err = TRUE; + err = true; DisplayError( this, wxT( "Error in HandleBlockPLace : ManageCurseur = NULL" ) ); } GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; @@ -297,21 +206,21 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) switch( GetScreen()->m_BlockLocate.m_Command ) { case BLOCK_IDLE: - err = TRUE; + err = true; break; case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( DrawPanel->ManageCurseur ) - DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); + DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Move(); GetScreen()->m_BlockLocate.ClearItemsList(); break; case BLOCK_COPY: /* Copy */ if( DrawPanel->ManageCurseur ) - DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); + DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Duplicate(); GetScreen()->m_BlockLocate.ClearItemsList(); break; @@ -349,13 +258,13 @@ void WinEDA_PcbFrame::HandleBlockPlace( wxDC* DC ) */ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) { - int endcommande = TRUE; + int endcommande = true; // If coming here after cancel block, clean up and exit if( GetScreen()->m_BlockLocate.m_State == STATE_NO_BLOCK ) { DrawPanel->ManageCurseur = NULL; - DrawPanel->ForceCloseManageCurseur = NULL; + DrawPanel->ForceCloseManageCurseur = NULL; GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.ClearItemsList(); @@ -365,29 +274,29 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) // Show dialog if there are no selected items and // we're not zooming - if ( !GetScreen()->m_BlockLocate.GetCount() && - GetScreen()->m_BlockLocate.m_Command != BLOCK_ZOOM ) + if( !GetScreen()->m_BlockLocate.GetCount() + && GetScreen()->m_BlockLocate.m_Command != BLOCK_ZOOM ) { if( !InstallBlockCmdFrame( this, _( "Block Operation" ) ) ) { DrawPanel->ManageCurseur = NULL; - DrawPanel->ForceCloseManageCurseur = NULL; + DrawPanel->ForceCloseManageCurseur = NULL; GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.ClearItemsList(); DisplayToolMsg( wxEmptyString ); - DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); + DrawAndSizingBlockOutlines( DrawPanel, DC, false ); return 0; } - - DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); + DrawAndSizingBlockOutlines( DrawPanel, DC, false ); Block_SelectItems(); // Exit if no items found - if( !GetScreen()->m_BlockLocate.GetCount() ) { + if( !GetScreen()->m_BlockLocate.GetCount() ) + { DrawPanel->ManageCurseur = NULL; - DrawPanel->ForceCloseManageCurseur = NULL; + DrawPanel->ForceCloseManageCurseur = NULL; GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; @@ -396,22 +305,26 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) return 0; } - // Move cursor to the center of the smallest rectangle + wxPoint blockCenter; + + // Move cursor to the best position in selected rect: + // can be the block locate rect or the the smallest rectangle // containing the centers of all selected items. + // Unfortunately, this option gives unpredicatble results when flipping or mirroring blocks +#if 0 // set to 1 to use smallest rectangle center + // Move cursor to the center of // Also set m_BlockLocate to the size of the rectangle. PICKED_ITEMS_LIST* itemsList = &DrawPanel->GetScreen()->m_BlockLocate.m_ItemsSelection; - wxPoint blockCenter; int minX, minY, maxX, maxY; int tempX, tempY; - BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( 0 ); - + BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( 0 ); minX = item->GetPosition().x; minY = item->GetPosition().y; maxX = minX; maxY = minY; for( unsigned ii = 1; ii < itemsList->GetCount(); ii++ ) { - item = (BOARD_ITEM*) itemsList->GetPickedItem( ii ); + item = (BOARD_ITEM*) itemsList->GetPickedItem( ii ); tempX = item->GetPosition().x; tempY = item->GetPosition().y; if( tempX > maxX ) @@ -426,17 +339,19 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) blockCenter.x = ( minX + maxX ) / 2; blockCenter.y = ( minY + maxY ) / 2; + GetScreen()->m_BlockLocate.SetOrigin( minX, minY ); + GetScreen()->m_BlockLocate.SetEnd( maxX, maxY ); +#else + blockCenter = GetScreen()->m_BlockLocate.Centre(); +#endif DrawPanel->CursorOff( DC ); GetScreen()->m_Curseur = blockCenter; GetScreen()->m_BlockLocate.SetLastCursorPosition( blockCenter ); - GetScreen()->m_BlockLocate.SetOrigin( minX, minY ); - GetScreen()->m_BlockLocate.SetEnd( maxX, maxY ); DrawPanel->MouseToCursorSchema(); DrawPanel->CursorOn( DC ); } if( DrawPanel->ManageCurseur ) - { switch( GetScreen()->m_BlockLocate.m_Command ) { case BLOCK_IDLE: @@ -448,9 +363,9 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_COPY: /* Copy */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; - endcommande = FALSE; + endcommande = false; DrawPanel->ManageCurseur = drawMovingBlock; - DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); + DrawPanel->ManageCurseur( DrawPanel, DC, false ); break; case BLOCK_DELETE: /* Delete */ @@ -493,9 +408,8 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) default: break; } - } - if( endcommande == TRUE ) + if( endcommande == true ) { GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; @@ -521,7 +435,7 @@ int WinEDA_PcbFrame::HandleBlockEnd( wxDC* DC ) */ void WinEDA_PcbFrame::Block_SelectItems() { - int masque_layer; + int masque_layer; GetScreen()->m_BlockLocate.Normalize(); @@ -531,10 +445,10 @@ void WinEDA_PcbFrame::Block_SelectItems() if( Block_Include_Modules ) { for( MODULE* module = m_Pcb->m_Modules; module != NULL; - module = module->Next() ) + module = module->Next() ) { - if( module->HitTest( GetScreen()->m_BlockLocate ) && - ( !module->IsLocked() || BlockIncludeLockedModules ) ) + if( module->HitTest( GetScreen()->m_BlockLocate ) + && ( !module->IsLocked() || BlockIncludeLockedModules ) ) { picker.m_PickedItem = module; picker.m_PickedItemType = module->Type(); @@ -547,7 +461,7 @@ void WinEDA_PcbFrame::Block_SelectItems() if( Block_Include_Tracks ) { for( TRACK* pt_segm = m_Pcb->m_Track; pt_segm != NULL; - pt_segm = pt_segm->Next() ) + pt_segm = pt_segm->Next() ) { if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) ) { @@ -568,7 +482,7 @@ void WinEDA_PcbFrame::Block_SelectItems() masque_layer &= ~EDGE_LAYER; for( BOARD_ITEM* PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; - PtStruct = PtStruct->Next() ) + PtStruct = PtStruct->Next() ) { bool select_me = false; switch( PtStruct->Type() ) @@ -621,13 +535,15 @@ void WinEDA_PcbFrame::Block_SelectItems() if( Block_Include_Zones ) { #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 */ + pt_segm = pt_segm->Next() ) + { + /* Segments used in Zone filling selection */ if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) ) { @@ -636,6 +552,7 @@ void WinEDA_PcbFrame::Block_SelectItems() itemsList->PushItem( picker ); } } + #endif for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) { @@ -650,13 +567,14 @@ void WinEDA_PcbFrame::Block_SelectItems() } } + static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, wxPoint aOffset ) { - PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection; - WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); - g_Offset_Module = -aOffset; + PICKED_ITEMS_LIST* itemsList = &aPanel->GetScreen()->m_BlockLocate.m_ItemsSelection; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) aPanel->GetParent(); + g_Offset_Module = -aOffset; for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ ) { BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii ); @@ -664,23 +582,26 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, { case TYPE_MODULE: { - MODULE* module = (MODULE*) item; + MODULE* module = (MODULE*) item; frame->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; DrawModuleOutlines( aPanel, aDC, module ); break; } + case TYPE_DRAWSEGMENT: { DRAWSEGMENT* segment = (DRAWSEGMENT*) item; segment->Draw( aPanel, aDC, GR_XOR, aOffset ); break; } + case TYPE_TEXTE: { TEXTE_PCB* text = (TEXTE_PCB*) item; text->Draw( aPanel, aDC, GR_XOR, aOffset ); break; } + case TYPE_TRACK: case TYPE_VIA: { @@ -688,18 +609,21 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, track->Draw( aPanel, aDC, GR_XOR, aOffset ); break; } + case TYPE_MIRE: { MIREPCB* mire = (MIREPCB*) item; mire->Draw( aPanel, aDC, GR_XOR, aOffset ); break; } + case TYPE_DIMENSION: { DIMENSION* dimension = (DIMENSION*) item; dimension->Draw( aPanel, aDC, GR_XOR, aOffset ); break; } + case TYPE_ZONE_CONTAINER: { ZONE_CONTAINER* zoneContainer = (ZONE_CONTAINER*) item; @@ -707,6 +631,7 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, zoneContainer->DrawFilledArea( aPanel, aDC, GR_XOR, aOffset ); break; } + // Currently markers are not affected by block commands case TYPE_MARKER_PCB: { @@ -719,9 +644,11 @@ static void drawPickedItems( WinEDA_DrawPanel* aPanel, wxDC* aDC, break; } } + g_Offset_Module = wxPoint( 0, 0 ); } + static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC, bool aErase ) { @@ -732,30 +659,26 @@ static void drawMovingBlock( WinEDA_DrawPanel* aPanel, wxDC* aDC, if( screen->m_BlockLocate.m_MoveVector.x || screen->m_BlockLocate.m_MoveVector.y ) { - if( !BlockDrawItems ) - screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, - GR_XOR, BLOCK_OUTLINE_COLOR ); - else + screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, + GR_XOR, BLOCK_OUTLINE_COLOR ); + if( BlockDrawItems ) drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector ); } } if( screen->m_BlockLocate.m_State != STATE_BLOCK_STOP ) { - screen->m_BlockLocate.m_MoveVector.x = screen->m_Curseur.x - - screen->m_BlockLocate.m_BlockLastCursorPosition.x; - screen->m_BlockLocate.m_MoveVector.y = screen->m_Curseur.y - - screen->m_BlockLocate.m_BlockLastCursorPosition.y; + screen->m_BlockLocate.m_MoveVector = screen->m_Curseur - + screen->m_BlockLocate.m_BlockLastCursorPosition; } if( screen->m_BlockLocate.m_MoveVector.x || screen->m_BlockLocate.m_MoveVector.y ) { - if( !BlockDrawItems ) - screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, - GR_XOR, BLOCK_OUTLINE_COLOR ); - else - drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector ); + screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, + GR_XOR, BLOCK_OUTLINE_COLOR ); + if( BlockDrawItems ) + drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector ); } } @@ -791,18 +714,18 @@ void WinEDA_PcbFrame::Block_Delete() m_Pcb->Remove( item ); break; - case TYPE_DRAWSEGMENT: // a segment not on copper layers - case TYPE_TEXTE: // a text on a layer - case TYPE_TRACK: // a track segment (segment on a copper layer) - case TYPE_VIA: // a via (like atrack segment on a copper layer) - case TYPE_DIMENSION: // a dimension (graphic item) - case TYPE_MIRE: // a target (graphic item) + case TYPE_DRAWSEGMENT: // a segment not on copper layers + case TYPE_TEXTE: // a text on a layer + case TYPE_TRACK: // a track segment (segment on a copper layer) + case TYPE_VIA: // a via (like atrack segment on a copper layer) + case TYPE_DIMENSION: // a dimension (graphic item) + case TYPE_MIRE: // a target (graphic item) item->UnLink(); break; // These items are deleted, but not put in undo list - case TYPE_MARKER_PCB: // a marker used to show something - case TYPE_ZONE: // SEG_ZONE items are now deprecated + case TYPE_MARKER_PCB: // a marker used to show something + case TYPE_ZONE: // SEG_ZONE items are now deprecated item->UnLink(); itemsList->RemovePicker( ii ); ii--; @@ -817,8 +740,8 @@ void WinEDA_PcbFrame::Block_Delete() SaveCopyInUndoList( *itemsList, UR_DELETED ); - Compile_Ratsnest( NULL, TRUE ); - DrawPanel->Refresh( TRUE ); + Compile_Ratsnest( NULL, true ); + DrawPanel->Refresh( true ); } @@ -832,7 +755,7 @@ void WinEDA_PcbFrame::Block_Rotate() { wxPoint oldpos; wxPoint centre; // rotation cent-re for the rotation transform - int rotAngle = 900; // rotation angle in 0.1 deg. + int rotAngle = 900; // rotation angle in 0.1 deg. oldpos = GetScreen()->m_Curseur; centre = GetScreen()->m_BlockLocate.Centre(); @@ -845,22 +768,21 @@ void WinEDA_PcbFrame::Block_Rotate() for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ ) { BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii ); - wxASSERT(item); + wxASSERT( item ); itemsList->SetPickedItemStatus( UR_ROTATED, ii ); - item->Rotate(centre, rotAngle); - + item->Rotate( centre, rotAngle ); switch( item->Type() ) { case TYPE_MODULE: - ((MODULE*) item)->m_Flags = 0; + ( (MODULE*) item )->m_Flags = 0; m_Pcb->m_Status_Pcb = 0; - break; + break; /* Move and rotate the track segments */ - case TYPE_TRACK: // a track segment (segment on a copper layer) - case TYPE_VIA: // a via (like atrack segment on a copper layer) + case TYPE_TRACK: // a track segment (segment on a copper layer) + case TYPE_VIA: // a via (like atrack segment on a copper layer) m_Pcb->m_Status_Pcb = 0; - break; + break; case TYPE_ZONE_CONTAINER: case TYPE_DRAWSEGMENT: @@ -883,14 +805,14 @@ void WinEDA_PcbFrame::Block_Rotate() SaveCopyInUndoList( *itemsList, UR_ROTATED, centre ); - Compile_Ratsnest( NULL, TRUE ); - DrawPanel->Refresh( TRUE ); + Compile_Ratsnest( NULL, true ); + DrawPanel->Refresh( true ); } /** * Function Block_Flip - * flips items within the selected block. + * Flip items within the selected block. * The flip center is the center of the block * @param none */ @@ -912,16 +834,15 @@ void WinEDA_PcbFrame::Block_Flip() for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ ) { BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii ); - wxASSERT(item); + wxASSERT( item ); itemsList->SetPickedItemStatus( UR_FLIPPED, ii ); - item->Flip(center); - + item->Flip( center ); switch( item->Type() ) { case TYPE_MODULE: - ((MODULE*) item)->m_Flags = 0; + ( (MODULE*) item )->m_Flags = 0; m_Pcb->m_Status_Pcb = 0; - break; + break; /* Move and rotate the track segments */ case TYPE_TRACK: // a track segment (segment on a copper layer) @@ -950,8 +871,8 @@ void WinEDA_PcbFrame::Block_Flip() } SaveCopyInUndoList( *itemsList, UR_FLIPPED, center ); - Compile_Ratsnest( NULL, TRUE ); - DrawPanel->Refresh( TRUE ); + Compile_Ratsnest( NULL, true ); + DrawPanel->Refresh( true ); } @@ -966,7 +887,7 @@ void WinEDA_PcbFrame::Block_Move() { OnModify(); - wxPoint MoveVector = GetScreen()->m_BlockLocate.m_MoveVector; + wxPoint MoveVector = GetScreen()->m_BlockLocate.m_MoveVector; PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection; itemsList->m_Status = UR_MOVED; @@ -980,15 +901,15 @@ void WinEDA_PcbFrame::Block_Move() switch( item->Type() ) { case TYPE_MODULE: - m_Pcb->m_Status_Pcb = 0; - ((MODULE*) item)->m_Flags = 0; - break; + m_Pcb->m_Status_Pcb = 0; + ( (MODULE*) item )->m_Flags = 0; + break; /* Move track segments */ - case TYPE_TRACK: // a track segment (segment on a copper layer) - case TYPE_VIA: // a via (like a track segment on a copper layer) + case TYPE_TRACK: // a track segment (segment on a copper layer) + case TYPE_VIA: // a via (like a track segment on a copper layer) m_Pcb->m_Status_Pcb = 0; - break; + break; case TYPE_ZONE_CONTAINER: case TYPE_DRAWSEGMENT: @@ -1011,14 +932,14 @@ void WinEDA_PcbFrame::Block_Move() SaveCopyInUndoList( *itemsList, UR_MOVED, MoveVector ); - Compile_Ratsnest( NULL, TRUE ); - DrawPanel->Refresh( TRUE ); + Compile_Ratsnest( NULL, true ); + DrawPanel->Refresh( true ); } /** * Function Block_Duplicate - * duplicates all items within the selected block. + * Duplicate all items within the selected block. * New location is determined by the current offset from the selected block's * original location. * @param none @@ -1031,11 +952,11 @@ void WinEDA_PcbFrame::Block_Duplicate() PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.m_ItemsSelection; - PICKED_ITEMS_LIST newList; + PICKED_ITEMS_LIST newList; newList.m_Status = UR_NEW; - ITEM_PICKER picker(NULL, UR_NEW); - BOARD_ITEM * newitem; + ITEM_PICKER picker( NULL, UR_NEW ); + BOARD_ITEM* newitem; for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ ) { @@ -1044,78 +965,78 @@ void WinEDA_PcbFrame::Block_Duplicate() switch( item->Type() ) { case TYPE_MODULE: - { - MODULE* module = (MODULE*) item; - MODULE* new_module; - m_Pcb->m_Status_Pcb = 0; - module->m_Flags = 0; - newitem = new_module = new MODULE( m_Pcb ); - new_module->Copy( module ); - new_module->m_TimeStamp = GetTimeStamp(); - m_Pcb->m_Modules.PushFront( new_module ); - } - break; + { + MODULE* module = (MODULE*) item; + MODULE* new_module; + m_Pcb->m_Status_Pcb = 0; + module->m_Flags = 0; + newitem = new_module = new MODULE( m_Pcb ); + new_module->Copy( module ); + new_module->m_TimeStamp = GetTimeStamp(); + m_Pcb->m_Modules.PushFront( new_module ); + } + break; case TYPE_TRACK: case TYPE_VIA: - { - TRACK* track = (TRACK*) item; - m_Pcb->m_Status_Pcb = 0; - TRACK* new_track = track->Copy(); - newitem = new_track; - m_Pcb->m_Track.PushFront( new_track ); - } - break; + { + TRACK* track = (TRACK*) item; + m_Pcb->m_Status_Pcb = 0; + TRACK* new_track = track->Copy(); + newitem = new_track; + m_Pcb->m_Track.PushFront( new_track ); + } + break; case TYPE_ZONE: // SEG_ZONE items are now deprecated break; case TYPE_ZONE_CONTAINER: - { - ZONE_CONTAINER* new_zone = - new ZONE_CONTAINER( (BOARD*) item->GetParent() ); - new_zone->Copy( (ZONE_CONTAINER*) item ); - new_zone->m_TimeStamp = GetTimeStamp(); - newitem = new_zone; - m_Pcb->Add( new_zone ); - } - break; + { + ZONE_CONTAINER* new_zone = + new ZONE_CONTAINER( (BOARD*) item->GetParent() ); + new_zone->Copy( (ZONE_CONTAINER*) item ); + new_zone->m_TimeStamp = GetTimeStamp(); + newitem = new_zone; + m_Pcb->Add( new_zone ); + } + break; case TYPE_DRAWSEGMENT: - { - DRAWSEGMENT* new_drawsegment = new DRAWSEGMENT( m_Pcb ); - new_drawsegment->Copy( (DRAWSEGMENT*) item ); - m_Pcb->Add( new_drawsegment ); - newitem = new_drawsegment; - } - break; + { + DRAWSEGMENT* new_drawsegment = new DRAWSEGMENT( m_Pcb ); + new_drawsegment->Copy( (DRAWSEGMENT*) item ); + m_Pcb->Add( new_drawsegment ); + newitem = new_drawsegment; + } + break; case TYPE_TEXTE: - { - TEXTE_PCB* new_pcbtext = new TEXTE_PCB( m_Pcb ); - new_pcbtext->Copy( (TEXTE_PCB*) item ); - m_Pcb->Add( new_pcbtext ); - newitem = new_pcbtext; - } - break; + { + TEXTE_PCB* new_pcbtext = new TEXTE_PCB( m_Pcb ); + new_pcbtext->Copy( (TEXTE_PCB*) item ); + m_Pcb->Add( new_pcbtext ); + newitem = new_pcbtext; + } + break; case TYPE_MIRE: - { - MIREPCB* new_mire = new MIREPCB( m_Pcb ); - new_mire->Copy( (MIREPCB*) item ); - m_Pcb->Add( new_mire ); - newitem = new_mire; - } - break; + { + MIREPCB* new_mire = new MIREPCB( m_Pcb ); + new_mire->Copy( (MIREPCB*) item ); + m_Pcb->Add( new_mire ); + newitem = new_mire; + } + break; case TYPE_DIMENSION: - { - DIMENSION* new_cotation = new DIMENSION( m_Pcb ); - new_cotation->Copy( (DIMENSION*) item ); - m_Pcb->Add( new_cotation ); - newitem = new_cotation; - } - break; + { + DIMENSION* new_cotation = new DIMENSION( m_Pcb ); + new_cotation->Copy( (DIMENSION*) item ); + m_Pcb->Add( new_cotation ); + newitem = new_cotation; + } + break; default: wxMessageBox( wxT( "WinEDA_PcbFrame::Block_Duplicate( ) error: unexpected type" ) ); @@ -1125,15 +1046,15 @@ void WinEDA_PcbFrame::Block_Duplicate() if( newitem ) { newitem->Move( MoveVector ); - picker.m_PickedItem = newitem; + picker.m_PickedItem = newitem; picker.m_PickedItemType = newitem->Type(); - newList.PushItem(picker); + newList.PushItem( picker ); } } if( newList.GetCount() ) SaveCopyInUndoList( newList, UR_NEW ); - Compile_Ratsnest( NULL, TRUE ); - DrawPanel->Refresh( TRUE ); + Compile_Ratsnest( NULL, true ); + DrawPanel->Refresh( true ); } diff --git a/pcbnew/dialogs/dialog_block_options_base.cpp b/pcbnew/dialogs/dialog_block_options_base.cpp new file mode 100644 index 0000000000..3206e7c27f --- /dev/null +++ b/pcbnew/dialogs/dialog_block_options_base.cpp @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 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 ); + + 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 Texts on Copper Layers"), 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 Block Items while Moving"), wxDefaultPosition, wxDefaultSize, 0 ); + gSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 ); + + bSizerMain->Add( gSizer1, 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, 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 ); + +} diff --git a/pcbnew/dialogs/dialog_block_options_base.fbp b/pcbnew/dialogs/dialog_block_options_base.fbp new file mode 100644 index 0000000000..0a256d2d49 --- /dev/null +++ b/pcbnew/dialogs/dialog_block_options_base.fbp @@ -0,0 +1,640 @@ + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_block_options_base + 1000 + none + 1 + dialog_block_options_base + + . + + 1 + 1 + 0 + 0 + + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_BLOCK_OPTIONS_BASE + + 397,171 + wxDEFAULT_DIALOG_STYLE + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + 2 + 0 + + gSizer1 + none + 4 + 0 + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Modules + + + m_Include_Modules + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Texts on Copper Layers + + + m_Include_PcbTextes + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Locked Modules + + + m_IncludeLockedModules + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Drawings + + + m_Include_Draw_Items + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Tracks + + + m_Include_Tracks + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Board Outline Layer + + + m_Include_Edges_Items + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Zones + + + m_Include_Zones + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Draw Block Items while Moving + + + m_DrawBlockItems + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + checkBoxClicked + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..267534e3ee --- /dev/null +++ b/pcbnew/dialogs/dialog_block_options_base.h @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 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; + wxStaticLine* m_staticline1; + 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__ diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index 691e9dfb40..e80d45a847 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -67,8 +67,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, /* Plot pads (creates pads outlines, for pads on silkscreen layers) */ int layersmask_plotpads = masque_layer; // Calculate the mask layers of allowed layers for pads - if( !g_pcb_plot_options.PlotPadsOnSilkLayer ) - layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK || SILKSCREEN_LAYER_FRONT); + if( !g_pcb_plot_options.PlotPadsOnSilkLayer ) // Do not plot pads on silk screen layers + layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK | SILKSCREEN_LAYER_FRONT ); if( layersmask_plotpads ) { for( MODULE* Module = m_Pcb->m_Modules; Module; Module = Module->Next() )