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 <sch_edit_frame.h>
29 #include <painter.h>
30 #include <pgm_base.h>
31 #include <eeschema_settings.h>
33 
34 
37  m_frame( aFrame ),
38  m_hPitch( aFrame, m_hPitchLabel, m_hPitchCtrl, m_hPitchUnits, true ),
39  m_vPitch( aFrame, m_vPitchLabel, m_vPitchCtrl, m_vPitchUnits, true )
40 {}
41 
42 
44 {
46 
47  m_choiceUnits->SetSelection( m_frame->GetUserUnits() == EDA_UNITS::INCHES ? 0 : 1 );
48 
52 
54  COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
55 
56  m_borderColorSwatch->SetSwatchBackground( schematicBackground );
58 
59  m_backgroundColorSwatch->SetSwatchBackground( schematicBackground );
61 
65 
69 
70  m_mouseDragIsDrag->SetValue( !cfg->m_Input.drag_is_move );
72 
73  return true;
74 }
75 
76 
78 {
80 
81  m_frame->SetUserUnits( m_choiceUnits->GetSelection() == 0 ? EDA_UNITS::INCHES
83 
86 
87  cfg->m_Drawing.default_repeat_offset_x = Iu2Mils( (int) m_hPitch.GetValue() );
88  cfg->m_Drawing.default_repeat_offset_y = Iu2Mils( (int) m_vPitch.GetValue() );
90 
91  cfg->m_Drawing.hv_lines_only = m_checkHVOrientation->GetValue();
94 
98 
99  cfg->m_Input.drag_is_move = !m_mouseDragIsDrag->GetValue();
101 
103 
104  return true;
105 }
106 
107 
KIGFX::COLOR4D GetSwatchColor() const
void SetSwatchColor(KIGFX::COLOR4D aColor, bool sendEvent)
Set the current swatch color directly.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
Schematic editor (Eeschema) main window.
void SetSwatchBackground(KIGFX::COLOR4D aBackground)
Set the swatch background color.
COLOR_SETTINGS * GetColorSettings() override
Returns a pointer to the active color theme settings.
Class PANEL_EESCHEMA_SETTINGS_BASE.
EESCHEMA_SETTINGS * eeconfig() const
AUTOPLACE_FIELDS m_AutoplaceFields
PANEL_EESCHEMA_SETTINGS(SCH_EDIT_FRAME *aFrame, wxWindow *aWindow)
COLOR4D GetColor(int aLayer) const
see class PGM_BASE
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetUserUnits(EDA_UNITS aUnits)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99