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 <pgm_base.h>
30 #include <eeschema_settings.h>
32 
33 
35  wxWindow* aWindow ) :
37  m_frame( aFrame ),
38  m_hPitch( aFrame, m_hPitchLabel, m_hPitchCtrl, m_hPitchUnits ),
39  m_vPitch( aFrame, m_vPitchLabel, m_vPitchCtrl, m_vPitchUnits )
40 {
41  // Make the color swatch show "Clear Color" instead
42  m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
43  m_backgroundColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
44 
45 #ifdef __WXOSX_MAC__
46  m_leftClickCmdsBook->SetSelection( 1 );
47 #else
48  m_leftClickCmdsBook->SetSelection( 0 );
49 #endif
50 }
51 
52 
54 {
56 
60 
62  COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
63 
64  m_borderColorSwatch->SetSwatchBackground( schematicBackground );
66 
67  m_backgroundColorSwatch->SetSwatchBackground( schematicBackground );
69 
73 
77 
78  m_mouseDragIsDrag->SetValue( !cfg->m_Input.drag_is_move );
80 
82 
83  return true;
84 }
85 
86 
88 {
90 
93 
94  cfg->m_Drawing.default_repeat_offset_x = Iu2Mils( (int) m_hPitch.GetValue() );
95  cfg->m_Drawing.default_repeat_offset_y = Iu2Mils( (int) m_vPitch.GetValue() );
97 
98  cfg->m_Drawing.hv_lines_only = m_checkHVOrientation->GetValue();
101 
105 
106  cfg->m_Input.drag_is_move = !m_mouseDragIsDrag->GetValue();
108 
109  cfg->m_Drawing.auto_start_wires = m_cbAutoStartWires->GetValue();
110 
112 
113  return true;
114 }
115 
116 
void SetSwatchColor(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.
void SetDefaultColor(KIGFX::COLOR4D aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
Schematic editor (Eeschema) main window.
void SetSwatchBackground(KIGFX::COLOR4D aBackground)
Set the swatch background color.
EESCHEMA_SETTINGS * eeconfig() const
Class PANEL_EESCHEMA_EDITING_OPTIONS_BASE.
AUTOPLACE_FIELDS m_AutoplaceFields
COLOR_SETTINGS * GetColorSettings() const override
Returns a pointer to the active color theme settings.
COLOR4D GetColor(int aLayer) const
see class PGM_BASE
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)
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98