KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
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
29#include <eda_draw_frame.h>
30#include <confirm.h>
31
33 PNS::SIZES_SETTINGS& aSizes ) :
35 m_traceWidth( aParent, m_traceWidthLabel, m_traceWidthText, m_traceWidthUnit ),
36 m_traceGap( aParent, m_traceGapLabel, m_traceGapText, m_traceGapUnit ),
37 m_viaGap( aParent, m_viaGapLabel, m_viaGapText, m_viaGapUnit ),
38 m_sizes( aSizes )
39{
41
42 Layout();
43 GetSizer()->SetSizeHints( this );
44 Centre();
45}
46
47
49{
50 if( !wxDialog::TransferDataFromWindow() )
51 return false;
52
53 if( m_traceGap.GetValue() <= 0 )
54 {
55 DisplayErrorMessage( this, _( "Trace gap must be greater than 0." ) );
56 m_traceGapText->SetFocus();
57 return false;
58 }
59
60 // Save widgets' values to settings
64
65 m_sizes.SetDiffPairGapSource( _( "user choice" ) );
66 m_sizes.SetDiffPairWidthSource( _( "user choice" ) );
67
68 return true;
69}
70
71
73{
74 if( !wxDialog::TransferDataToWindow() )
75 return false;
76
82
83 return true;
84}
85
86
88{
90 m_viaGapText->Enable( !m_viaTraceGapEqual->GetValue() );
91 m_viaGapLabel->Enable( !m_viaTraceGapEqual->GetValue() );
92 m_viaGapUnit->Enable( !m_viaTraceGapEqual->GetValue() );
93}
94
95
97{
99}
Class DIALOG_PNS_DIFF_PAIR_DIMENSIONS_BASE.
DIALOG_PNS_DIFF_PAIR_DIMENSIONS(EDA_DRAW_FRAME *aParent, PNS::SIZES_SETTINGS &aSizes)
Push and Shove diff pair dimensions (gap) settings dialog.
virtual void OnViaTraceGapEqualCheck(wxCommandEvent &event) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
The base class for create windows for drawing purpose.
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
bool DiffPairViaGapSameAsTraceGap() const
void SetDiffPairWidth(int aWidth)
void SetDiffPairWidthSource(const wxString &aSource)
void SetDiffPairGapSource(const wxString &aSource)
void SetDiffPairGap(int aGap)
void SetDiffPairViaGap(int aGap)
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:186
This file is part of the common library.
#define _(s)