KiCad PCB EDA Suite
panel_eeschema_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 <sch_edit_frame.h>
28 
30 
31 
34  m_frame( aFrame )
35 {}
36 
37 
39 {
40  m_choiceUnits->SetSelection( m_frame->GetUserUnits() == EDA_UNITS::INCHES ? 0 : 1 );
41 
42  m_textSizeCtrl->SetValue(
44  m_hPitchCtrl->SetValue(
46  m_vPitchCtrl->SetValue(
49 
53 
57 
59 
61 
62  return true;
63 }
64 
65 
67 {
69  m_choiceUnits->GetSelection() == 0 ? EDA_UNITS::INCHES : EDA_UNITS::MILLIMETRES );
70 
71  int textSize = (int) ValueFromString( EDA_UNITS::INCHES, m_textSizeCtrl->GetValue(), true );
72 
73  if( textSize != GetDefaultTextSize() )
74  {
75  SetDefaultTextSize( textSize );
77  }
78 
80  wxPoint( (int) ValueFromString( EDA_UNITS::INCHES, m_hPitchCtrl->GetValue(), true ),
81  (int) ValueFromString( EDA_UNITS::INCHES, m_vPitchCtrl->GetValue(), true ) ) );
83 
87 
91 
93 
95 
96  return true;
97 }
98 
99 
bool GetAutoplaceJustify() const
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
void SetForceHVLines(bool aForceHVdirection)
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
void SetAutoplaceAlign(bool aEnable)
bool GetShowFootprintPreviews() const
void SetNavigatorStaysOpen(bool aEnable)
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:234
Schematic editor (Eeschema) main window.
bool GetAutoplaceFields() const
void SetAutoplaceJustify(bool aEnable)
void SetDragActionIsMove(bool aValue)
Class PANEL_EESCHEMA_SETTINGS_BASE.
void SetDefaultTextSize(int aTextSize)
bool GetForceHVLines() const
bool GetDragActionIsMove() const
PANEL_EESCHEMA_SETTINGS(SCH_EDIT_FRAME *aFrame, wxWindow *aWindow)
bool GetNavigatorStaysOpen() const
const wxPoint GetRepeatStep() const
void SetShowFootprintPreviews(bool aEnable)
void SetAutoplaceFields(bool aEnable)
int GetRepeatDeltaLabel() const
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
void SetUserUnits(EDA_UNITS aUnits)
bool GetAutoplaceAlign() const
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:444
bool GetSelectPinSelectSymbol() const override
Allow some frames to select the parent symbol when trying to select a pin.
BASE_SCREEN class implementation.
void SetSelectPinSelectSymbol(bool aEnable)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
int GetDefaultTextSize()
Default size for text in general.