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-2018 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( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) );
43  m_pinLengthCtrl->SetValue( StringFromValue( INCHES, m_frame->GetDefaultPinLength(), false, true ) );
44  m_pinNumSizeCtrl->SetValue( StringFromValue( INCHES, m_frame->GetPinNumDefaultSize(), false, true ) );
45  m_pinNameSizeCtrl->SetValue( StringFromValue( INCHES, m_frame->GetPinNameDefaultSize(), false, true ) );
46  m_hPitchCtrl->SetValue( StringFromValue( INCHES, m_frame->GetRepeatStep().x, false, true ) );
47  m_vPitchCtrl->SetValue( StringFromValue( INCHES, m_frame->GetRepeatStep().y, false, true ) );
48  m_choicePinDisplacement->SetSelection( m_frame->GetRepeatPinStep() == 50 ? 1 : 0 );
50 
52 
53  return true;
54 }
55 
56 
58 {
64  ValueFromString( INCHES, m_vPitchCtrl->GetValue(), true ) ) );
65  m_frame->SetRepeatPinStep( m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100 );
67 
69 
72 
73  return true;
74 }
75 
76 
static void SetPinNameDefaultSize(int aSize)
int GetRepeatPinStep() const
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
void SetRepeatPinStep(int aStep)
Sets the repeat step value for pins repeat command.
const wxPoint GetRepeatStep() const
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
static int GetDefaultPinLength()
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
bool TransferDataFromWindow() override
int GetRepeatDeltaLabel() const
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...
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue, bool aUseMils)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:409
void SetDefaultLineThickness(int aThickness)
static int GetPinNumDefaultSize()
Class PANEL_LIBEDIT_SETTINGS_BASE.
Definition: common.h:160
SCH_DRAW_PANEL * GetCanvas() const override
static void SetPinNumDefaultSize(int aSize)
void SetShowElectricalType(bool aShow)
The symbol library editor main window.
static int GetPinNameDefaultSize()
PANEL_LIBEDIT_SETTINGS(LIB_EDIT_FRAME *aFrame, wxWindow *aWindow)
wxString StringFromValue(EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:210
Definition of class LIB_EDIT_FRAME.
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
static void SetDefaultPinLength(int aLength)
Set the default pin len.
BASE_SCREEN class implementation.
bool GetShowElectricalType()