Browse Source
Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting - removed several global config settings (such as g_Drc_On) - wrapped most of global config settings in PCB_GENERAL_SETTINGS class - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas - new GAL feature for legacy users: double-click (or E) to change track width available as an option. Fixes: lp:1530543 * https://bugs.launchpad.net/kicad/+bug/1530543 Fixes: lp:1707145 * https://bugs.launchpad.net/kicad/+bug/1707145pull/7/merge
116 changed files with 1038 additions and 842 deletions
-
53d-viewer/3d_canvas/cinfo3d_visu.cpp
-
1bitmap2component/bitmap2cmp_gui.cpp
-
1common/CMakeLists.txt
-
50common/class_colors_design_settings.cpp
-
1common/class_layer_box_selector.cpp
-
4common/draw_panel_gal.cpp
-
2common/gal/cairo/cairo_compositor.cpp
-
11common/gal/cairo/cairo_gal.cpp
-
11common/gal/opengl/antialiasing.cpp
-
8common/gal/opengl/opengl_compositor.cpp
-
11common/gal/opengl/opengl_gal.cpp
-
44common/preview_items/arc_assistant.cpp
-
10common/preview_items/centreline_rect_item.cpp
-
14common/preview_items/polygon_item.cpp
-
41common/preview_items/preview_utils.cpp
-
31common/preview_items/ruler_item.cpp
-
60common/preview_items/selection_area.cpp
-
2common/preview_items/simple_overlay_item.cpp
-
36common/settings.cpp
-
1cvpcb/CMakeLists.txt
-
2cvpcb/class_DisplayFootprintsFrame.cpp
-
2cvpcb/class_DisplayFootprintsFrame.h
-
1cvpcb/cvpcb.cpp
-
2gerbview/CMakeLists.txt
-
1gerbview/class_gbr_layer_box_selector.cpp
-
1gerbview/gerbview_config.cpp
-
5gerbview/gerbview_frame.cpp
-
7gerbview/gerbview_frame.h
-
15include/class_colors_design_settings.h
-
118include/core/settings.h
-
2include/draw_frame.h
-
2include/gal/cairo/cairo_compositor.h
-
2include/gal/cairo/cairo_gal.h
-
4include/gal/compositor.h
-
13include/gal/graphics_abstraction_layer.h
-
2include/gal/opengl/opengl_compositor.h
-
2include/gal/opengl/opengl_gal.h
-
3include/layers_id_colors_and_visibility.h
-
3include/preview_items/centreline_rect_item.h
-
3include/preview_items/polygon_item.h
-
17include/preview_items/preview_utils.h
-
6include/preview_items/selection_area.h
-
4include/preview_items/simple_overlay_item.h
-
4include/tool/tool_settings.h
-
15include/wxBasePcbFrame.h
-
4include/wxPcbStruct.h
-
1pcb_calculator/pcb_calculator.cpp
-
1pcbnew/CMakeLists.txt
-
1pcbnew/autorouter/auto_place_footprints.cpp
-
1pcbnew/basepcbframe.cpp
-
69pcbnew/class_board.cpp
-
24pcbnew/class_board.h
-
6pcbnew/class_dimension.cpp
-
7pcbnew/class_drawsegment.cpp
-
7pcbnew/class_edge_mod.cpp
-
5pcbnew/class_mire.cpp
-
6pcbnew/class_module.cpp
-
1pcbnew/class_netinfo_item.cpp
-
16pcbnew/class_pad_draw_functions.cpp
-
6pcbnew/class_pcb_layer_box_selector.cpp
-
21pcbnew/class_pcb_layer_widget.cpp
-
8pcbnew/class_pcb_text.cpp
-
12pcbnew/class_text_mod.cpp
-
11pcbnew/class_track.cpp
-
14pcbnew/class_zone.cpp
-
2pcbnew/controle.cpp
-
4pcbnew/deltrack.cpp
-
2pcbnew/dialogs/dialog_copper_zones.cpp
-
32pcbnew/dialogs/dialog_general_options.cpp
-
73pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp
-
357pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp
-
13pcbnew/dialogs/dialog_general_options_BoardEditor_base.h
-
2pcbnew/dialogs/dialog_keepout_area_properties.cpp
-
1pcbnew/dialogs/dialog_netlist.cpp
-
3pcbnew/dialogs/dialog_non_copper_zones_properties.cpp
-
7pcbnew/dialogs/dialog_pad_properties.cpp
-
2pcbnew/edit.cpp
-
2pcbnew/edit_track_width.cpp
-
4pcbnew/editedge.cpp
-
8pcbnew/editrack-part2.cpp
-
33pcbnew/editrack.cpp
-
4pcbnew/footprint_preview_panel.cpp
-
2pcbnew/footprint_preview_panel.h
-
1pcbnew/layer_widget.cpp
-
4pcbnew/layer_widget.h
-
12pcbnew/magnetic_tracks_functions.cpp
-
6pcbnew/modedit.cpp
-
2pcbnew/module_editor_frame.h
-
4pcbnew/moduleframe.cpp
-
10pcbnew/modview_frame.cpp
-
2pcbnew/modview_frame.h
-
2pcbnew/move_or_drag_track.cpp
-
1pcbnew/pcb_base_edit_frame.cpp
-
6pcbnew/pcb_draw_panel_gal.cpp
-
49pcbnew/pcb_general_settings.cpp
-
68pcbnew/pcb_general_settings.h
-
7pcbnew/pcb_painter.cpp
-
7pcbnew/pcb_painter.h
-
24pcbnew/pcbframe.cpp
-
14pcbnew/pcbnew.cpp
@ -0,0 +1,118 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2015 CERN |
|||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch> |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
|
|||
#ifndef __SETTINGS_H |
|||
#define __SETTINGS_H |
|||
|
|||
#include <wx/confbase.h> |
|||
#include <config_params.h> |
|||
|
|||
|
|||
/** |
|||
* Class TOOL_SETTINGS |
|||
* |
|||
* Manages persistent settings for a tool (just a simple wrapper to wxConfigBase) |
|||
*/ |
|||
class SETTINGS |
|||
{ |
|||
public: |
|||
SETTINGS() |
|||
{} |
|||
|
|||
~SETTINGS() |
|||
{} |
|||
|
|||
void SetConfigPrefix ( const wxString& aPrefix ) |
|||
{ |
|||
m_prefix = aPrefix; |
|||
} |
|||
|
|||
virtual void Load( wxConfigBase *aConfig ); |
|||
virtual void Save( wxConfigBase *aConfig ); |
|||
|
|||
#if 0 |
|||
template<class T> |
|||
T Get( const wxString& aName, T aDefaultValue ) const |
|||
{ |
|||
wxConfigBase* config = getConfigBase(); |
|||
|
|||
if( !config ) |
|||
return aDefaultValue; |
|||
|
|||
T tmp = aDefaultValue; |
|||
|
|||
config->Read( getKeyName( aName ), &tmp ); |
|||
return tmp; |
|||
} |
|||
|
|||
template<class T> |
|||
void Set( const wxString& aName, const T &aValue ) |
|||
{ |
|||
wxConfigBase* config = getConfigBase(); |
|||
|
|||
if( !config ) |
|||
return; |
|||
|
|||
config->Write( getKeyName( aName ), aValue ); |
|||
} |
|||
#endif |
|||
|
|||
|
|||
void Add ( const wxString& name, int* aPtr, int aDefaultValue ) |
|||
{ |
|||
m_params.push_back ( new PARAM_CFG_INT ( name, aPtr, aDefaultValue ) ); |
|||
} |
|||
|
|||
void Add ( const wxString& name, bool* aPtr, bool aDefaultValue ) |
|||
{ |
|||
m_params.push_back ( new PARAM_CFG_BOOL ( name, aPtr, aDefaultValue ) ); |
|||
} |
|||
|
|||
void Add ( const wxString& name, KIGFX::COLOR4D* aPtr, KIGFX::COLOR4D aDefaultValue ) |
|||
{ |
|||
m_params.push_back ( new PARAM_CFG_SETCOLOR ( name, aPtr, aDefaultValue ) ); |
|||
} |
|||
|
|||
void Add ( const wxString& name, KIGFX::COLOR4D* aPtr, EDA_COLOR_T aDefaultValue ) |
|||
{ |
|||
m_params.push_back ( new PARAM_CFG_SETCOLOR ( name, aPtr, aDefaultValue ) ); |
|||
} |
|||
|
|||
|
|||
protected: |
|||
|
|||
virtual wxString getKeyName( const wxString& aEntryName ) const |
|||
{ |
|||
return aEntryName; |
|||
} |
|||
|
|||
private: |
|||
wxString m_prefix; |
|||
PARAM_CFG_ARRAY m_params; |
|||
}; |
|||
|
|||
|
|||
|
|||
#endif |
@ -0,0 +1,49 @@ |
|||
/*
|
|||
* This program source code file is part of KICAD, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2012-2017 Kicad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <pcb_general_settings.h>
|
|||
|
|||
PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS() |
|||
{ |
|||
Add( "LegacyDRCOn", &m_legacyDrcOn, true ); |
|||
Add( "LegacyAutoDeleteOldTrack", &m_legacyAutoDeleteOldTrack, true ); |
|||
Add( "LegacyUse45DegreeTracks",&m_legacyUse45DegreeTracks, true); |
|||
Add( "LegacyUseTwoSegmentTracks", &m_legacyUseTwoSegmentTracks, true); |
|||
Add( "Use45DegreeGraphicSegments", &m_use45DegreeGraphicSegments, false); |
|||
Add( "MagneticPads", reinterpret_cast<int*>( &m_magneticPads ), CAPTURE_CURSOR_IN_TRACK_TOOL ); |
|||
Add( "MagneticTracks", reinterpret_cast<int*>( &m_magneticTracks ), CAPTURE_CURSOR_IN_TRACK_TOOL ); |
|||
Add( "EditActionChangesTrackWidth", &m_editActionChangesTrackWidth, false ); |
|||
} |
|||
|
|||
void PCB_GENERAL_SETTINGS::Load( wxConfigBase* aCfg ) |
|||
{ |
|||
m_colorsSettings.Load( aCfg ); |
|||
SETTINGS::Load( aCfg ); |
|||
} |
|||
|
|||
|
|||
void PCB_GENERAL_SETTINGS::Save( wxConfigBase* aCfg ) |
|||
{ |
|||
m_colorsSettings.Save( aCfg ); |
|||
SETTINGS::Save( aCfg ); |
|||
} |
@ -0,0 +1,68 @@ |
|||
/* |
|||
* This program source code file is part of KICAD, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2012-2017 Kicad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef __PCBNEW_GENERAL_SETTINGS_H |
|||
#define __PCBNEW_GENERAL_SETTINGS_H |
|||
|
|||
#include <class_colors_design_settings.h> |
|||
|
|||
class wxConfigBase; |
|||
class wxString; |
|||
|
|||
enum MAGNETIC_PAD_OPTION_VALUES |
|||
{ |
|||
NO_EFFECT, |
|||
CAPTURE_CURSOR_IN_TRACK_TOOL, |
|||
CAPTURE_ALWAYS |
|||
}; |
|||
|
|||
class PCB_GENERAL_SETTINGS : public SETTINGS |
|||
{ |
|||
public: |
|||
PCB_GENERAL_SETTINGS(); |
|||
|
|||
void Load ( wxConfigBase* aCfg ); |
|||
void Save( wxConfigBase* aCfg ); |
|||
|
|||
COLORS_DESIGN_SETTINGS m_colorsSettings; |
|||
|
|||
COLORS_DESIGN_SETTINGS& Colors() |
|||
{ |
|||
return m_colorsSettings; |
|||
} |
|||
|
|||
bool m_legacyDrcOn = true; |
|||
bool m_legacyAutoDeleteOldTrack = true; |
|||
bool m_legacyAlternateTrackPosture = false; |
|||
bool m_legacyUse45DegreeTracks = true; // True to allow horiz, vert. and 45deg only tracks |
|||
bool m_use45DegreeGraphicSegments = false; // True to allow horiz, vert. and 45deg only graphic segments |
|||
bool m_legacyUseTwoSegmentTracks = true; |
|||
|
|||
bool m_editActionChangesTrackWidth = false; |
|||
bool m_showFilterDialogAfterEachSelection = false; |
|||
|
|||
MAGNETIC_PAD_OPTION_VALUES m_magneticPads = CAPTURE_CURSOR_IN_TRACK_TOOL; |
|||
MAGNETIC_PAD_OPTION_VALUES m_magneticTracks = CAPTURE_CURSOR_IN_TRACK_TOOL; |
|||
}; |
|||
|
|||
#endif |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue