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 The 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#include "dialog_enum_pads.h"
23
26 DIALOG_ENUM_PADS_BASE( aParent ),
27 m_params( aParams )
28{
29 // Transfer data from the params to the dialog
30 m_padStartNum->SetValue( m_params.m_start_number );
31 m_padNumStep->SetValue( m_params.m_step );
32 m_padPrefix->SetValue( m_params.m_prefix.value_or( "" ) );
33
35
36 if( m_stdButtons->GetAffirmativeButton() )
37 m_stdButtons->GetAffirmativeButton()->SetDefault();
38
39 // Now all widgets have the size fixed, call FinishDialogSettings
41}
42
44{
45 // Transfer data from the dialog to the params
46 m_params.m_start_number = m_padStartNum->GetValue();
47 m_params.m_step = m_padNumStep->GetValue();
48 m_params.m_prefix = m_padPrefix->GetValue();
49
50 // No other validation implemented
51 return true;
52}
wxStdDialogButtonSizer * m_stdButtons
DIALOG_ENUM_PADS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Pad Enumeration Settings"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
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:79
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.