KiCad PCB EDA Suite
panel_eeschema_editing_options.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-2020 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 <sch_edit_frame.h>
28 #include <painter.h>
29 #include <eeschema_settings.h>
31 
32 
34  wxWindow* aWindow ) :
36  m_frame( aFrame ),
37  m_hPitch( aFrame, m_hPitchLabel, m_hPitchCtrl, m_hPitchUnits ),
38  m_vPitch( aFrame, m_vPitchLabel, m_vPitchCtrl, m_vPitchUnits )
39 {
40  // Make the color swatch show "Clear Color" instead
41  m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
42  m_backgroundColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
43 
44 #ifdef __WXOSX_MAC__
45  m_leftClickCmdsBook->SetSelection( 1 );
46 #else
47  m_leftClickCmdsBook->SetSelection( 0 );
48 #endif
49 }
50 
51 
53 {
55 
59 
61  COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
62 
63  m_borderColorSwatch->SetSwatchBackground( schematicBackground );
65 
66  m_backgroundColorSwatch->SetSwatchBackground( schematicBackground );
68 
72 
76 
77  m_mouseDragIsDrag->SetValue( !cfg->m_Input.drag_is_move );
79 
81 
82  return true;
83 }
84 
85 
87 {
89 
92 
93  cfg->m_Drawing.default_repeat_offset_x = Iu2Mils( (int) m_hPitch.GetValue() );
94  cfg->m_Drawing.default_repeat_offset_y = Iu2Mils( (int) m_vPitch.GetValue() );
96 
97  cfg->m_Drawing.hv_lines_only = m_checkHVOrientation->GetValue();
100 
104 
105  cfg->m_Input.drag_is_move = !m_mouseDragIsDrag->GetValue();
107 
108  cfg->m_Drawing.auto_start_wires = m_cbAutoStartWires->GetValue();
109 
111 
112  return true;
113 }
114 
115 
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
Schematic editor (Eeschema) main window.
EESCHEMA_SETTINGS * eeconfig() const
Class PANEL_EESCHEMA_EDITING_OPTIONS_BASE.
AUTOPLACE_FIELDS m_AutoplaceFields
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
COLOR_SETTINGS * GetColorSettings() const override
Returns a pointer to the active color theme settings.
COLOR4D GetColor(int aLayer) const
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual long long int GetValue()
Return 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...
PANEL_EESCHEMA_EDITING_OPTIONS(SCH_EDIT_FRAME *aFrame, wxWindow *aWindow)
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103