KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_enum_pads.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2014 CERN
5 * @author Maciej Suminski <[email protected]>
6 * Copyright (C) 2014-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include "dialog_enum_pads.h"
27
30 DIALOG_ENUM_PADS_BASE( aParent ),
31 m_params( aParams )
32{
33 // Transfer data from the params to the dialog
35 m_padNumStep->SetValue( m_params.m_step );
36 m_padPrefix->SetValue( m_params.m_prefix.value_or( "" ) );
37
38 // Now all widgets have the size fixed, call FinishDialogSettings
40}
41
43{
44 // Transfer data from the dialog to the params
46 m_params.m_step = m_padNumStep->GetValue();
47 m_params.m_prefix = m_padPrefix->GetValue();
48
49 // No other validation implemented
50 return true;
51}
Class DIALOG_ENUM_PADS_BASE.
SEQUENTIAL_PAD_ENUMERATION_PARAMS & m_params
The parameters that will be updated when the dialog is closed with OK.
DIALOG_ENUM_PADS(wxWindow *aParent, SEQUENTIAL_PAD_ENUMERATION_PARAMS &aParams)
bool TransferDataFromWindow() override
Transfer data from the dialog to the params.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Parameters for sequential pad numbering.
std::optional< wxString > m_prefix
Optional prefix for pad names.
int m_start_number
Starting number for pad names.
int m_step
Step between pad numbers.