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-2024 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
39
40 if( m_stdButtons->GetAffirmativeButton() )
41 m_stdButtons->GetAffirmativeButton()->SetDefault();
42
43 // Now all widgets have the size fixed, call FinishDialogSettings
45}
46
48{
49 // Transfer data from the dialog to the params
51 m_params.m_step = m_padNumStep->GetValue();
52 m_params.m_prefix = m_padPrefix->GetValue();
53
54 // No other validation implemented
55 return true;
56}
Class DIALOG_ENUM_PADS_BASE.
wxStdDialogButtonSizer * m_stdButtons
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 SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:102
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.