2017-01-21 21:06:18 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2021-07-21 21:37:49 +00:00
|
|
|
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-01-21 21:06:18 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
#include <dialog_push_pad_properties.h>
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <pad.h>
|
2020-04-24 23:44:09 +00:00
|
|
|
#include <macros.h>
|
2018-01-29 20:58:58 +00:00
|
|
|
#include <pcb_edit_frame.h>
|
2017-01-21 21:06:18 +00:00
|
|
|
|
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
// Class DIALOG_PUSH_PAD_PROPERTIES static variables
|
|
|
|
bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Shape_Filter = true;
|
|
|
|
bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Layer_Filter = true;
|
|
|
|
bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Orient_Filter = true;
|
2019-09-08 22:50:17 +00:00
|
|
|
bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Type_Filter = true;
|
2018-07-05 16:14:19 +00:00
|
|
|
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES( PCB_BASE_FRAME* aParent ) :
|
|
|
|
DIALOG_PUSH_PAD_PROPERTIES_BASE( aParent ),
|
|
|
|
m_parent( aParent )
|
|
|
|
{
|
2017-01-21 21:06:18 +00:00
|
|
|
// Pad filter selection.
|
|
|
|
m_Pad_Shape_Filter_CB->SetValue( m_Pad_Shape_Filter );
|
|
|
|
m_Pad_Layer_Filter_CB->SetValue( m_Pad_Layer_Filter );
|
|
|
|
m_Pad_Orient_Filter_CB->SetValue( m_Pad_Orient_Filter );
|
2019-09-08 22:50:17 +00:00
|
|
|
m_Pad_Type_Filter_CB->SetValue( m_Pad_Type_Filter );
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but
|
|
|
|
// that requires us to correct the button labels here.
|
|
|
|
m_sdbSizer1OK->SetLabel( _( "Change Pads on Current Footprint" ) );
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2019-09-05 22:00:47 +00:00
|
|
|
if( aParent->IsType( FRAME_FOOTPRINT_EDITOR ) )
|
2018-07-05 16:14:19 +00:00
|
|
|
m_sdbSizer1Apply->Show( false );
|
|
|
|
else
|
|
|
|
m_sdbSizer1Apply->SetLabel( _( "Change Pads on Identical Footprints" ) );
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
m_sdbSizer1->Layout();
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
m_sdbSizer1OK->SetDefault();
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2020-11-16 11:16:44 +00:00
|
|
|
finishDialogSettings();
|
2017-01-21 21:06:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
void DIALOG_PUSH_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
|
2017-01-21 21:06:18 +00:00
|
|
|
{
|
|
|
|
int returncode = 0;
|
|
|
|
|
|
|
|
switch( event.GetId() )
|
|
|
|
{
|
2018-07-05 16:14:19 +00:00
|
|
|
case wxID_APPLY:
|
2017-01-21 21:06:18 +00:00
|
|
|
returncode = 1;
|
2020-04-24 23:44:09 +00:00
|
|
|
KI_FALLTHROUGH;
|
2017-01-21 21:06:18 +00:00
|
|
|
|
2018-07-05 16:14:19 +00:00
|
|
|
case wxID_OK:
|
2017-01-21 21:06:18 +00:00
|
|
|
m_Pad_Shape_Filter = m_Pad_Shape_Filter_CB->GetValue();
|
|
|
|
m_Pad_Layer_Filter = m_Pad_Layer_Filter_CB->GetValue();
|
|
|
|
m_Pad_Orient_Filter = m_Pad_Orient_Filter_CB->GetValue();
|
2019-09-08 22:50:17 +00:00
|
|
|
m_Pad_Type_Filter = m_Pad_Type_Filter_CB->GetValue();
|
2021-07-21 21:37:49 +00:00
|
|
|
|
|
|
|
if( IsQuasiModal() )
|
|
|
|
EndQuasiModal( returncode );
|
|
|
|
else
|
|
|
|
EndDialog( returncode );
|
|
|
|
|
2017-01-21 21:06:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_parent->OnModify();
|
|
|
|
}
|