KiCad PCB EDA Suite
panel_libedit_settings.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) 2009 Wayne Stambaugh <stambaughw@verizon.net>
5  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <fctsys.h>
26 #include <base_screen.h>
27 #include <lib_edit_frame.h>
28 #include <sch_view.h>
29 #include <sch_painter.h>
30 
31 #include "panel_libedit_settings.h"
32 
33 
35  PANEL_LIBEDIT_SETTINGS_BASE( aWindow ),
36  m_frame( aFrame )
37 {}
38 
39 
41 {
42  m_lineWidthCtrl->SetValue(
44  m_pinLengthCtrl->SetValue(
46  m_pinNumSizeCtrl->SetValue(
48  m_pinNameSizeCtrl->SetValue(
50  m_hPitchCtrl->SetValue(
52  m_vPitchCtrl->SetValue(
54  m_choicePinDisplacement->SetSelection( m_frame->GetRepeatPinStep() == Iu2Mils( 50 ) ? 1 : 0 );
56 
58 
59  return true;
60 }
61 
62 
64 {
66  ValueFromString( EDA_UNITS::INCHES, m_lineWidthCtrl->GetValue(), true ) );
68  ValueFromString( EDA_UNITS::INCHES, m_pinLengthCtrl->GetValue(), true ) );
70  ValueFromString( EDA_UNITS::INCHES, m_pinNumSizeCtrl->GetValue(), true ) );
72  ValueFromString( EDA_UNITS::INCHES, m_pinNameSizeCtrl->GetValue(), true ) );
75  ValueFromString( EDA_UNITS::INCHES, m_vPitchCtrl->GetValue(), true ) ) );
76  m_frame->SetRepeatPinStep( m_choicePinDisplacement->GetSelection() == 1 ?
77  Mils2iu( 50 ) : Mils2iu( 100 ) );
79 
81 
84 
85  return true;
86 }
87 
88 
static void SetPinNameDefaultSize(int aSize)
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
void SetRepeatPinStep(int aStep)
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
static int GetDefaultPinLength()
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:219
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
void SetShowElectricalType(bool aShow)
bool TransferDataFromWindow() override
void SetDefaultLineThickness(int aThickness)
static int GetPinNumDefaultSize()
Class PANEL_LIBEDIT_SETTINGS_BASE.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
static void SetPinNumDefaultSize(int aSize)
const wxPoint GetRepeatStep() const
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
The symbol library editor main window.
static int GetPinNameDefaultSize()
int GetRepeatDeltaLabel() const
PANEL_LIBEDIT_SETTINGS(LIB_EDIT_FRAME *aFrame, wxWindow *aWindow)
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, bool aUseMils)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: base_units.cpp:429
int GetRepeatPinStep() const
static void SetDefaultPinLength(int aLength)
BASE_SCREEN class implementation.
bool GetShowElectricalType()
Allow some frames to show/hide pin electrical type names.