diff --git a/pcbnew/dialogs/dialog_layer_selection_base.cpp b/pcbnew/dialogs/dialog_layer_selection_base.cpp index e9c092f699..c77d02d723 100644 --- a/pcbnew/dialogs/dialog_layer_selection_base.cpp +++ b/pcbnew/dialogs/dialog_layer_selection_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "dialog_layer_selection_base.h" @@ -26,7 +26,7 @@ DIALOG_LAYER_SELECTION_BASE::DIALOG_LAYER_SELECTION_BASE( wxWindow* parent, wxWi m_leftGridLayers->EnableEditing( false ); m_leftGridLayers->EnableGridLines( true ); m_leftGridLayers->EnableDragGridSize( false ); - m_leftGridLayers->SetMargins( 0, 3 ); + m_leftGridLayers->SetMargins( 5, 3 ); // Columns m_leftGridLayers->EnableDragColMove( false ); @@ -56,7 +56,7 @@ DIALOG_LAYER_SELECTION_BASE::DIALOG_LAYER_SELECTION_BASE( wxWindow* parent, wxWi m_rightGridLayers->EnableEditing( false ); m_rightGridLayers->EnableGridLines( true ); m_rightGridLayers->EnableDragGridSize( false ); - m_rightGridLayers->SetMargins( 0, 3 ); + m_rightGridLayers->SetMargins( 5, 3 ); // Columns m_rightGridLayers->EnableDragColMove( false ); @@ -77,7 +77,7 @@ DIALOG_LAYER_SELECTION_BASE::DIALOG_LAYER_SELECTION_BASE( wxWindow* parent, wxWi bSizerUpper->Add( m_rightGridLayers, 1, wxALL|wxEXPAND, 5 ); - bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 ); + bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 5 ); this->SetSizer( bSizerMain ); diff --git a/pcbnew/dialogs/dialog_layer_selection_base.fbp b/pcbnew/dialogs/dialog_layer_selection_base.fbp index f588115404..7581c37ffe 100644 --- a/pcbnew/dialogs/dialog_layer_selection_base.fbp +++ b/pcbnew/dialogs/dialog_layer_selection_base.fbp @@ -45,7 +45,7 @@ DIALOG_LAYER_SELECTION_BASE -1,-1 - wxDEFAULT_DIALOG_STYLE + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Select Layer @@ -95,7 +95,7 @@ none 5 - wxEXPAND + wxEXPAND|wxALL 1 @@ -158,7 +158,7 @@ 3 - 0 + 5 0 @@ -301,7 +301,7 @@ 3 - 0 + 5 0 @@ -411,7 +411,7 @@ DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE -1,-1 - wxDEFAULT_DIALOG_STYLE + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Select Copper Layer Pair: diff --git a/pcbnew/dialogs/dialog_layer_selection_base.h b/pcbnew/dialogs/dialog_layer_selection_base.h index cafffca860..0756cbd173 100644 --- a/pcbnew/dialogs/dialog_layer_selection_base.h +++ b/pcbnew/dialogs/dialog_layer_selection_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_LAYER_SELECTION_BASE_H__ @@ -47,7 +47,7 @@ class DIALOG_LAYER_SELECTION_BASE : public wxDialog public: - DIALOG_LAYER_SELECTION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Layer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + DIALOG_LAYER_SELECTION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Layer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_LAYER_SELECTION_BASE(); }; @@ -78,7 +78,7 @@ class DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE : public wxDialog public: - DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Copper Layer Pair:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Copper Layer Pair:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE(); }; diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 9be4234a21..20944d74ec 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -573,14 +573,14 @@ void prepareEditMenu( wxMenu* aParentMenu, bool aUseGal ) KiBitmap( exchange_xpm ) ); AddMenuItem( aParentMenu, ID_MENU_PCB_SWAP_LAYERS, - _( "&Swap Layers..." ), - _( "Swap tracks on copper layers or drawings on other layers" ), + _( "&Move and Swap Layers..." ), + _( "Move tracks or drawings from a layer to an other layer" ), KiBitmap( swap_layer_xpm ) ); aParentMenu->AppendSeparator(); AddMenuItem( aParentMenu, ID_PCB_GLOBAL_DELETE, _( "&Global Deletions..." ), - _( "Delete tracks, footprints and texts on board" ), + _( "Delete tracks, footprints and graphic items from board" ), KiBitmap( general_deletions_xpm ) ); AddMenuItem( aParentMenu, ID_MENU_PCB_CLEAN, diff --git a/pcbnew/swap_layers.cpp b/pcbnew/swap_layers.cpp index b1e5dc990d..a5cb5893ff 100644 --- a/pcbnew/swap_layers.cpp +++ b/pcbnew/swap_layers.cpp @@ -51,11 +51,11 @@ enum swap_layer_id { }; -class SWAP_LAYERS_DIALOG : public DIALOG_SHIM +class MOVE_SWAP_LAYER_DIALOG : public DIALOG_SHIM { public: - SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent, PCB_LAYER_ID* aArray ); - // ~SWAP_LAYERS_DIALOG() { }; + MOVE_SWAP_LAYER_DIALOG( PCB_BASE_FRAME* parent, PCB_LAYER_ID* aArray ); + // ~MOVE_SWAP_LAYER_DIALOG() { }; private: PCB_BASE_FRAME* m_Parent; @@ -79,18 +79,18 @@ private: }; -BEGIN_EVENT_TABLE( SWAP_LAYERS_DIALOG, wxDialog ) +BEGIN_EVENT_TABLE( MOVE_SWAP_LAYER_DIALOG, wxDialog ) EVT_COMMAND_RANGE( ID_BUTTON_0, ID_BUTTON_0 + PCB_LAYER_ID_COUNT - 1, - wxEVT_COMMAND_BUTTON_CLICKED, SWAP_LAYERS_DIALOG::Sel_Layer ) + wxEVT_COMMAND_BUTTON_CLICKED, MOVE_SWAP_LAYER_DIALOG::Sel_Layer ) - EVT_BUTTON( wxID_OK, SWAP_LAYERS_DIALOG::OnOkClick ) + EVT_BUTTON( wxID_OK, MOVE_SWAP_LAYER_DIALOG::OnOkClick ) - EVT_BUTTON( wxID_CANCEL, SWAP_LAYERS_DIALOG::OnCancelClick ) + EVT_BUTTON( wxID_CANCEL, MOVE_SWAP_LAYER_DIALOG::OnCancelClick ) END_EVENT_TABLE() -SWAP_LAYERS_DIALOG::SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent, PCB_LAYER_ID* aArray ) : - DIALOG_SHIM( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ), +MOVE_SWAP_LAYER_DIALOG::MOVE_SWAP_LAYER_DIALOG( PCB_BASE_FRAME* parent, PCB_LAYER_ID* aArray ) : + DIALOG_SHIM( parent, -1, _( "Move Layers:" ), wxPoint( -1, -1 ), wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), m_callers_nlayers( aArray ) { @@ -260,7 +260,7 @@ SWAP_LAYERS_DIALOG::SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent, PCB_LAYER_ID* aA } /* Provide spacers to occupy otherwise blank cells within the second - * FlexGrid sizer. (Becuse there are three columns, three spacers + * FlexGrid sizer. (Because there are three columns, three spacers * are thus required for each unused row.) for( int ii = 3 * NB_PCB_LAYERS; ii < 96; ii++ ) { @@ -291,16 +291,13 @@ SWAP_LAYERS_DIALOG::SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent, PCB_LAYER_ID* aA StdDialogButtonSizer->Realize(); // Resize the dialog - if( GetSizer() ) - { - GetSizer()->SetSizeHints( this ); - } + GetSizer()->SetSizeHints( this ); Center(); } -void SWAP_LAYERS_DIALOG::Sel_Layer( wxCommandEvent& event ) +void MOVE_SWAP_LAYER_DIALOG::Sel_Layer( wxCommandEvent& event ) { int ii; @@ -340,19 +337,21 @@ void SWAP_LAYERS_DIALOG::Sel_Layer( wxCommandEvent& event ) // that this layer *is* being swapped) layer_list[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) ); } + + layer_list[ii]->Refresh(); } } -void SWAP_LAYERS_DIALOG::OnCancelClick( wxCommandEvent& event ) +void MOVE_SWAP_LAYER_DIALOG::OnCancelClick( wxCommandEvent& event ) { - EndModal( -1 ); + EndModal( wxID_CANCEL ); } -void SWAP_LAYERS_DIALOG::OnOkClick( wxCommandEvent& event ) +void MOVE_SWAP_LAYER_DIALOG::OnOkClick( wxCommandEvent& event ) { - EndModal( 1 ); + EndModal( wxID_OK ); } @@ -363,9 +362,9 @@ void PCB_EDIT_FRAME::Swap_Layers( wxCommandEvent& event ) for( unsigned i = 0; i < DIM( new_layer ); ++i ) new_layer[i] = NO_CHANGE; - SWAP_LAYERS_DIALOG dlg( this, new_layer ); + MOVE_SWAP_LAYER_DIALOG dlg( this, new_layer ); - if( dlg.ShowModal() != 1 ) + if( dlg.ShowModal() != wxID_OK ) return; // (Canceled dialog box returns -1 instead) // Change traces.