KiCad PCB EDA Suite
dialog_pns_diff_pair_dimensions.cpp
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2014-2015 CERN
5  * Copyright (C) 2016-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
27 #include <widgets/text_ctrl_eval.h>
29 
32  m_traceWidth( this, m_traceWidthText, m_traceWidthUnit ),
33  m_traceGap( this, m_traceGapText, m_traceGapUnit ),
34  m_viaGap( this, m_viaGapText, m_viaGapUnit ),
35  m_sizes( aSizes )
36 {
37  Layout();
38  GetSizer()->SetSizeHints( this );
39  Centre();
40 
41  m_stdButtonsOK->SetDefault();
42 }
43 
44 
46 {
47  if( !wxDialog::TransferDataToWindow() )
48  return false;
49 
50  // Save widgets' values to settings
54 
55  return true;
56 }
57 
58 
60 {
61  if( !wxDialog::TransferDataFromWindow() )
62  return false;
63 
69 
70  return true;
71 }
72 
73 
75 {
77  m_viaGapText->Enable( !m_viaTraceGapEqual->GetValue() );
78  m_viaGapLabel->Enable( !m_viaTraceGapEqual->GetValue() );
79  m_viaGapUnit->Enable( !m_viaTraceGapEqual->GetValue() );
80 }
81 
82 
84 {
86 }
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
DIALOG_PNS_DIFF_PAIR_DIMENSIONS(wxWindow *aParent, PNS::SIZES_SETTINGS &aSizes)
Push and Shove diff pair dimensions (gap) settings dialog.
virtual int GetValue() const
Function GetValue Returns the current value in Internal Units.
Definition: unit_binder.cpp:64
void SetDiffPairViaGap(int aGap)
int DiffPairViaGap() const
virtual void OnViaTraceGapEqualCheck(wxCommandEvent &event) override
Class DIALOG_PNS_DIFF_PAIR_DIMENSIONS_BASE.
bool DiffPairViaGapSameAsTraceGap() const
void SetDiffPairGap(int aGap)
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
Definition: unit_binder.cpp:54
int DiffPairWidth() const
void SetDiffPairWidth(int aWidth)