ADDED: Appearance panel for footprint editor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5643
This commit is contained in:
Jon Evans 2020-09-29 23:29:58 -04:00
parent 626bcea8ce
commit 7c003f98d5
14 changed files with 341 additions and 257 deletions

View File

@ -437,6 +437,7 @@ set( COMMON_SRCS
settings/nested_settings.cpp settings/nested_settings.cpp
settings/settings_manager.cpp settings/settings_manager.cpp
project/board_project_settings.cpp
project/net_settings.cpp project/net_settings.cpp
project/project_archiver.cpp project/project_archiver.cpp
project/project_file.cpp project/project_file.cpp

View File

@ -0,0 +1,130 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include <functional>
#include <project/board_project_settings.h>
using namespace std::placeholders;
PARAM_LAYER_PRESET::PARAM_LAYER_PRESET( const std::string& aPath,
std::vector<LAYER_PRESET>* aPresetList ) :
PARAM_LAMBDA<nlohmann::json>( aPath,
std::bind( &PARAM_LAYER_PRESET::presetsToJson, this ),
std::bind( &PARAM_LAYER_PRESET::jsonToPresets, this, _1 ),
{} ),
m_presets( aPresetList )
{
wxASSERT( aPresetList );
}
nlohmann::json PARAM_LAYER_PRESET::presetsToJson()
{
nlohmann::json ret = nlohmann::json::array();
for( const LAYER_PRESET& preset : *m_presets )
{
nlohmann::json js = {
{ "name", preset.name },
{ "activeLayer", preset.activeLayer }
};
nlohmann::json layers = nlohmann::json::array();
for( PCB_LAYER_ID layer : preset.layers.Seq() )
layers.push_back( static_cast<int>( layer ) );
js["layers"] = layers;
nlohmann::json renderLayers = nlohmann::json::array();
for( GAL_LAYER_ID layer : preset.renderLayers.Seq() )
renderLayers.push_back( static_cast<int>( layer ) );
js["renderLayers"] = renderLayers;
ret.push_back( js );
}
return ret;
}
void PARAM_LAYER_PRESET::jsonToPresets( const nlohmann::json& aJson )
{
if( aJson.empty() || !aJson.is_array() )
return;
m_presets->clear();
for( const nlohmann::json& preset : aJson )
{
if( preset.contains( "name" ) )
{
LAYER_PRESET p( preset.at( "name" ).get<wxString>() );
if( preset.contains( "activeLayer" ) &&
preset.at( "activeLayer" ).is_number_integer() )
{
int active = preset.at( "activeLayer" ).get<int>();
if( active >= 0 && active < PCB_LAYER_ID_COUNT )
p.activeLayer = static_cast<PCB_LAYER_ID>( active );
}
if( preset.contains( "layers" ) && preset.at( "layers" ).is_array() )
{
p.layers.reset();
for( const nlohmann::json& layer : preset.at( "layers" ) )
{
if( layer.is_number_integer() )
{
int layerNum = layer.get<int>();
if( layerNum >= 0 && layerNum < PCB_LAYER_ID_COUNT )
p.layers.set( layerNum );
}
}
}
if( preset.contains( "renderLayers" )
&& preset.at( "renderLayers" ).is_array() )
{
p.renderLayers.reset();
for( const nlohmann::json& layer : preset.at( "renderLayers" ) )
{
if( layer.is_number_integer() )
{
int layerNum = layer.get<int>();
if( layerNum >= GAL_LAYER_ID_START
&& layerNum < GAL_LAYER_ID_END )
p.renderLayers.set( static_cast<GAL_LAYER_ID>( layerNum ) );
}
}
}
m_presets->emplace_back( p );
}
}
}

View File

@ -106,98 +106,7 @@ PROJECT_FILE::PROJECT_FILE( const wxString& aFullPath ) :
m_NetSettings = std::make_shared<NET_SETTINGS>( this, "net_settings" ); m_NetSettings = std::make_shared<NET_SETTINGS>( this, "net_settings" );
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.layer_presets", m_params.emplace_back( new PARAM_LAYER_PRESET( "board.layer_presets", &m_LayerPresets ) );
[&]() -> nlohmann::json
{
nlohmann::json ret = nlohmann::json::array();
for( const LAYER_PRESET& preset : m_LayerPresets )
{
nlohmann::json js = {
{ "name", preset.name },
{ "activeLayer", preset.activeLayer }
};
nlohmann::json layers = nlohmann::json::array();
for( PCB_LAYER_ID layer : preset.layers.Seq() )
layers.push_back( static_cast<int>( layer ) );
js["layers"] = layers;
nlohmann::json renderLayers = nlohmann::json::array();
for( GAL_LAYER_ID layer : preset.renderLayers.Seq() )
renderLayers.push_back( static_cast<int>( layer ) );
js["renderLayers"] = renderLayers;
ret.push_back( js );
}
return ret;
},
[&]( const nlohmann::json& aVal )
{
if( aVal.empty() || !aVal.is_array() )
return;
m_LayerPresets.clear();
for( const nlohmann::json& preset : aVal )
{
if( preset.contains( "name" ) )
{
LAYER_PRESET p( preset.at( "name" ).get<wxString>() );
if( preset.contains( "activeLayer" ) &&
preset.at( "activeLayer" ).is_number_integer() )
{
int active = preset.at( "activeLayer" ).get<int>();
if( active >= 0 && active < PCB_LAYER_ID_COUNT )
p.activeLayer = static_cast<PCB_LAYER_ID>( active );
}
if( preset.contains( "layers" ) && preset.at( "layers" ).is_array() )
{
p.layers.reset();
for( const nlohmann::json& layer : preset.at( "layers" ) )
{
if( layer.is_number_integer() )
{
int layerNum = layer.get<int>();
if( layerNum >= 0 && layerNum < PCB_LAYER_ID_COUNT )
p.layers.set( layerNum );
}
}
}
if( preset.contains( "renderLayers" )
&& preset.at( "renderLayers" ).is_array() )
{
p.renderLayers.reset();
for( const nlohmann::json& layer : preset.at( "renderLayers" ) )
{
if( layer.is_number_integer() )
{
int layerNum = layer.get<int>();
if( layerNum >= GAL_LAYER_ID_START
&& layerNum < GAL_LAYER_ID_END )
p.renderLayers.set( static_cast<GAL_LAYER_ID>( layerNum ) );
}
}
}
m_LayerPresets.emplace_back( p );
}
}
},
{} ) );
} }

View File

@ -69,6 +69,10 @@ public:
SELECTION_FILTER_OPTIONS m_SelectionFilter; SELECTION_FILTER_OPTIONS m_SelectionFilter;
std::vector<LAYER_PRESET> m_LayerPresets;
wxString m_ActiveLayerPreset;
protected: protected:
virtual std::string getLegacyFrameName() const override { return "ModEditFrame"; } virtual std::string getLegacyFrameName() const override { return "ModEditFrame"; }

View File

@ -22,6 +22,7 @@
#define KICAD_BOARD_PROJECT_SETTINGS_H #define KICAD_BOARD_PROJECT_SETTINGS_H
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <settings/parameters.h>
/** /**
* This file contains data structures that are saved in the project file or project local settings * This file contains data structures that are saved in the project file or project local settings
@ -159,4 +160,18 @@ struct LAYER_PRESET
} }
}; };
class PARAM_LAYER_PRESET : public PARAM_LAMBDA<nlohmann::json>
{
public:
PARAM_LAYER_PRESET( const std::string& aPath, std::vector<LAYER_PRESET>* aPresetList );
private:
nlohmann::json presetsToJson();
void jsonToPresets( const nlohmann::json& aJson );
std::vector<LAYER_PRESET>* m_presets;
};
#endif // KICAD_BOARD_PROJECT_SETTINGS_H #endif // KICAD_BOARD_PROJECT_SETTINGS_H

View File

@ -53,7 +53,6 @@
#include <panel_hotkeys_editor.h> #include <panel_hotkeys_editor.h>
#include <pcb_draw_panel_gal.h> #include <pcb_draw_panel_gal.h>
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <pcb_layer_widget.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <pcbnew_id.h> #include <pcbnew_id.h>
#include <pgm_base.h> #include <pgm_base.h>
@ -69,6 +68,7 @@
#include <tools/pcb_editor_conditions.h> #include <tools/pcb_editor_conditions.h>
#include <tools/pcb_viewer_tools.h> #include <tools/pcb_viewer_tools.h>
#include <tools/position_relative_tool.h> #include <tools/position_relative_tool.h>
#include <widgets/appearance_controls.h>
#include <widgets/infobar.h> #include <widgets/infobar.h>
#include <widgets/lib_tree.h> #include <widgets/lib_tree.h>
#include <widgets/paged_dialog.h> #include <widgets/paged_dialog.h>
@ -135,7 +135,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
SetCanvas( drawPanel ); SetCanvas( drawPanel );
SetBoard( new BOARD() ); SetBoard( new BOARD() );
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), true );
// In modedit, the default net clearance is not known (it depends on the actual board). // In modedit, the default net clearance is not known (it depends on the actual board).
// So we do not show the default clearance, by setting it to 0. // So we do not show the default clearance, by setting it to 0.
@ -177,6 +176,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
ReCreateOptToolbar(); ReCreateOptToolbar();
m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this ); m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas(), true );
// LoadSettings() *after* creating m_LayersManager, because LoadSettings() initialize // LoadSettings() *after* creating m_LayersManager, because LoadSettings() initialize
// parameters in m_LayersManager // parameters in m_LayersManager
@ -192,12 +192,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() ); GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() );
GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) ); GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
m_Layers->ReFill(); SetActiveLayer( F_SilkS );
m_Layers->ReFillRender();
GetScreen()->m_Active_Layer = F_SilkS;
m_Layers->SelectLayer( F_SilkS );
m_Layers->OnLayerSelected();
// Create the infobar // Create the infobar
m_infoBar = new WX_INFOBAR( this, &m_auimgr ); m_infoBar = new WX_INFOBAR( this, &m_auimgr );
@ -218,10 +213,11 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
.BestSize( m_defaultLibWidth, -1 ) ); .BestSize( m_defaultLibWidth, -1 ) );
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) ); m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
m_auimgr.AddPane( m_Layers, EDA_PANE().Palette().Name( "LayersManager" ).Right().Layer(3)
.Caption( _( "Layers Manager" ) ).PaneBorder( false )
.MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) );
m_auimgr.AddPane( m_appearancePanel,
EDA_PANE().Name( "LayersManager" ).Right().Layer( 3 )
.Caption( _( "Appearance" ) ).PaneBorder( false )
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
m_auimgr.AddPane( m_selectionFilterPanel, m_auimgr.AddPane( m_selectionFilterPanel,
EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 3 ) EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 3 )
.Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 ) .Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 )
@ -242,6 +238,11 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_auimgr.GetPane( "InfoBar" ).Hide(); m_auimgr.GetPane( "InfoBar" ).Hide();
m_auimgr.Update(); m_auimgr.Update();
// Apply saved visibility stuff at the end
FOOTPRINT_EDITOR_SETTINGS* cfg = GetSettings();
m_appearancePanel->SetUserLayerPresets( cfg->m_LayerPresets );
m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );
updateTitle(); updateTitle();
InitExitKey(); InitExitKey();
@ -265,7 +266,7 @@ FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME()
retainLastFootprint(); retainLastFootprint();
delete m_selectionFilterPanel; delete m_selectionFilterPanel;
delete m_Layers; delete m_appearancePanel;
} }
@ -481,6 +482,8 @@ void FOOTPRINT_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
cfg->m_Display = m_DisplayOptions; cfg->m_Display = m_DisplayOptions;
cfg->m_LibWidth = m_treePane->GetSize().x; cfg->m_LibWidth = m_treePane->GetSize().x;
cfg->m_SelectionFilter = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter(); cfg->m_SelectionFilter = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter();
cfg->m_LayerPresets = m_appearancePanel->GetUserLayerPresets();
cfg->m_ActiveLayerPreset = m_appearancePanel->GetActiveLayerPreset();
GetSettingsManager()->SaveColorSettings( GetColorSettings(), "board" ); GetSettingsManager()->SaveColorSettings( GetColorSettings(), "board" );
} }
@ -639,28 +642,6 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent
} }
void FOOTPRINT_EDIT_FRAME::ReFillLayerWidget()
{
m_Layers->Freeze();
m_Layers->ReFill();
m_Layers->Thaw();
wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );
wxSize bestz = m_Layers->GetBestSize();
lyrs.MinSize( bestz );
lyrs.BestSize( bestz );
lyrs.FloatingSize( bestz );
if( lyrs.IsDocked() )
m_auimgr.Update();
else
m_Layers->SetSize( bestz );
}
void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage() void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage()
{ {
// call my base class // call my base class
@ -673,12 +654,12 @@ void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage()
bool tree_shown = tree_pane_info.IsShown(); bool tree_shown = tree_pane_info.IsShown();
tree_pane_info.Caption( _( "Libraries" ) ); tree_pane_info.Caption( _( "Libraries" ) );
wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_Layers ); wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_appearancePanel );
bool lm_shown = lm_pane_info.IsShown(); bool lm_shown = lm_pane_info.IsShown();
lm_pane_info.Caption( _( "Layers Manager" ) ); lm_pane_info.Caption( _( "Appearance" ) );
// update the layer manager // update the layer manager
m_Layers->SetLayersManagerTabsText(); m_appearancePanel->OnBoardChanged();
UpdateUserInterface(); UpdateUserInterface();
// Now restore the visibility: // Now restore the visibility:
@ -740,21 +721,7 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
void FOOTPRINT_EDIT_FRAME::UpdateUserInterface() void FOOTPRINT_EDIT_FRAME::UpdateUserInterface()
{ {
// Update the layer manager and other widgets from the board setup m_appearancePanel->OnBoardChanged();
// (layer and items visibility, colors ...)
// Update the layer manager
m_Layers->Freeze();
ReFillLayerWidget();
m_Layers->ReFillRender();
// update the layer widget to match board visibility states.
m_Layers->SyncLayerVisibilities();
GetCanvas()->SyncLayersVisibility( m_Pcb );
m_Layers->SelectLayer( GetActiveLayer() );
m_Layers->OnLayerSelected();
m_Layers->Thaw();
} }
@ -847,23 +814,9 @@ void FOOTPRINT_EDIT_FRAME::FocusOnLibID( const LIB_ID& aLibID )
} }
bool FOOTPRINT_EDIT_FRAME::IsElementVisible( GAL_LAYER_ID aElement ) const
{
return GetBoard()->IsElementVisible( aElement );
}
void FOOTPRINT_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState )
{
GetCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
GetBoard()->SetElementVisibility( aElement, aNewState );
m_Layers->SetRenderState( aElement, aNewState );
}
void FOOTPRINT_EDIT_FRAME::OnUpdateLayerAlpha( wxUpdateUIEvent & ) void FOOTPRINT_EDIT_FRAME::OnUpdateLayerAlpha( wxUpdateUIEvent & )
{ {
m_Layers->SyncLayerAlphaIndicators(); m_appearancePanel->OnLayerAlphaChanged();
} }

View File

@ -260,24 +260,6 @@ public:
*/ */
bool DeleteModuleFromLibrary( const LIB_ID& aFPID, bool aConfirm ); bool DeleteModuleFromLibrary( const LIB_ID& aFPID, bool aConfirm );
/**
* Test whether a given element category is visible.
*
* @param aElement is from the enum by the same name
* @return bool - true if the element is visible.
* @see enum PCB_LAYER_ID
*/
bool IsElementVisible( GAL_LAYER_ID aElement ) const;
/**
* Function SetElementVisibility
* changes the visibility of an element category
* @param aElement is from the enum by the same name
* @param aNewState = The new visibility state of the element category
* @see enum PCB_LAYER_ID
*/
void SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState );
/** /**
* @return the color of the grid * @return the color of the grid
*/ */
@ -314,8 +296,6 @@ public:
*/ */
void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override; void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override;
void ReFillLayerWidget();
/** /**
* Update visible items after a language change. * Update visible items after a language change.
*/ */

View File

@ -77,6 +77,11 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill", m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
&m_Display.m_DisplayPadFill, true ) ); &m_Display.m_DisplayPadFill, true ) );
m_params.emplace_back( new PARAM_LAYER_PRESET( "pcb_display.layer_presets", &m_LayerPresets ) );
m_params.emplace_back( new PARAM<wxString>( "pcb_display.active_layer_preset",
&m_ActiveLayerPreset, "" ) );
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>(
"design_settings.default_footprint_text_items", "design_settings.default_footprint_text_items",
[&] () -> nlohmann::json [&] () -> nlohmann::json

View File

@ -39,7 +39,6 @@
#include <kiway.h> #include <kiway.h>
#include <kiway_express.h> #include <kiway_express.h>
#include <pcb_layer_box_selector.h> #include <pcb_layer_box_selector.h>
#include <pcb_layer_widget.h>
#include <pcbnew_id.h> #include <pcbnew_id.h>
#include <ratsnest/ratsnest_data.h> #include <ratsnest/ratsnest_data.h>
#include <pgm_base.h> #include <pgm_base.h>
@ -47,6 +46,7 @@
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <tools/pcb_actions.h> #include <tools/pcb_actions.h>
#include <trigo.h> #include <trigo.h>
#include <widgets/appearance_controls.h>
#include <widgets/lib_tree.h> #include <widgets/lib_tree.h>
using namespace std::placeholders; using namespace std::placeholders;
@ -427,8 +427,7 @@ void FOOTPRINT_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
{ {
PCB_BASE_FRAME::SetActiveLayer( aLayer ); PCB_BASE_FRAME::SetActiveLayer( aLayer );
m_Layers->SelectLayer( aLayer ); m_appearancePanel->OnLayerChanged();
m_Layers->OnLayerSelected();
m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
GetCanvas()->SetFocus(); // allow capture of hotkeys GetCanvas()->SetFocus(); // allow capture of hotkeys

View File

@ -48,7 +48,6 @@ PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
const wxString& aFrameName ) : const wxString& aFrameName ) :
PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ), PCB_BASE_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
m_rotationAngle( 900 ), m_undoRedoBlocked( false ), m_rotationAngle( 900 ), m_undoRedoBlocked( false ),
m_Layers( nullptr ),
m_selectionFilterPanel( nullptr ), m_selectionFilterPanel( nullptr ),
m_appearancePanel( nullptr ) m_appearancePanel( nullptr )
{ {

View File

@ -228,9 +228,6 @@ protected:
void unitsChangeRefresh() override; void unitsChangeRefresh() override;
/// Layer manager. It is the responsibility of the child frames to instantiate this
PCB_LAYER_WIDGET* m_Layers;
/// AUI panel for changing the selection tool filter controls /// AUI panel for changing the selection tool filter controls
PANEL_SELECTION_FILTER* m_selectionFilterPanel; PANEL_SELECTION_FILTER* m_selectionFilterPanel;

View File

@ -185,7 +185,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_show_layer_manager_tools = true; m_show_layer_manager_tools = true;
m_hasAutoSave = true; m_hasAutoSave = true;
m_microWaveToolBar = NULL; m_microWaveToolBar = NULL;
m_Layers = nullptr;
// We don't know what state board was in when it was lasat saved, so we have to // We don't know what state board was in when it was lasat saved, so we have to
// assume dirty // assume dirty

View File

@ -23,6 +23,7 @@
#include <bitmaps.h> #include <bitmaps.h>
#include <class_board.h> #include <class_board.h>
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <footprint_edit_frame.h>
#include <menus_helpers.h> #include <menus_helpers.h>
#include <pcb_display_options.h> #include <pcb_display_options.h>
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
@ -35,11 +36,11 @@
#include <widgets/bitmap_toggle.h> #include <widgets/bitmap_toggle.h>
#include <widgets/collapsible_pane.h> #include <widgets/collapsible_pane.h>
#include <widgets/color_swatch.h> #include <widgets/color_swatch.h>
#include <widgets/wx_grid.h>
#include <widgets/grid_bitmap_toggle.h> #include <widgets/grid_bitmap_toggle.h>
#include <widgets/grid_color_swatch_helpers.h> #include <widgets/grid_color_swatch_helpers.h>
#include <widgets/grid_text_helpers.h> #include <widgets/grid_text_helpers.h>
#include <widgets/indicator_icon.h> #include <widgets/indicator_icon.h>
#include <widgets/wx_grid.h>
#include <wx/statline.h> #include <wx/statline.h>
@ -351,6 +352,20 @@ const APPEARANCE_CONTROLS::APPEARANCE_SETTING APPEARANCE_CONTROLS::s_objectSetti
RR( _( "Grid" ), LAYER_GRID, _( "Show the (x,y) grid dots" ) ) RR( _( "Grid" ), LAYER_GRID, _( "Show the (x,y) grid dots" ) )
}; };
/// These GAL layers are shown in the Objects tab in the footprint editor
static std::set<int> s_allowedInFpEditor =
{
LAYER_TRACKS,
LAYER_VIAS,
LAYER_PADS,
LAYER_ZONES,
LAYER_PADS_TH,
LAYER_MOD_VALUES,
LAYER_MOD_REFERENCES,
LAYER_MOD_TEXT_INVISIBLE,
LAYER_GRID
};
// These are the built-in layer presets that cannot be deleted // These are the built-in layer presets that cannot be deleted
LAYER_PRESET APPEARANCE_CONTROLS::presetNoLayers( _( "No Layers" ), LSET() ); LAYER_PRESET APPEARANCE_CONTROLS::presetNoLayers( _( "No Layers" ), LSET() );
@ -382,6 +397,7 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
m_frame( aParent ), m_frame( aParent ),
m_focusOwner( aFocusOwner ), m_focusOwner( aFocusOwner ),
m_board( nullptr ), m_board( nullptr ),
m_isFpEditor( aFpEditorMode ),
m_currentPreset( nullptr ), m_currentPreset( nullptr ),
m_lastSelectedUserPreset( nullptr ), m_lastSelectedUserPreset( nullptr ),
m_layerContextMenu( nullptr ) m_layerContextMenu( nullptr )
@ -524,6 +540,9 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
m_netsGrid->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT ); m_netsGrid->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT );
m_netclassScrolledWindow->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT ); m_netclassScrolledWindow->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT );
if( m_isFpEditor )
m_notebook->RemovePage( 2 );
loadDefaultLayerPresets(); loadDefaultLayerPresets();
rebuildObjects(); rebuildObjects();
OnBoardChanged(); OnBoardChanged();
@ -1005,15 +1024,14 @@ void APPEARANCE_CONTROLS::OnLayerChanged()
void APPEARANCE_CONTROLS::SetLayerVisible( LAYER_NUM aLayer, bool isVisible ) void APPEARANCE_CONTROLS::SetLayerVisible( LAYER_NUM aLayer, bool isVisible )
{ {
BOARD* board = m_frame->GetBoard(); LSET visible = getVisibleLayers();
LSET visible = board->GetVisibleLayers();
PCB_LAYER_ID layer = ToLAYER_ID( aLayer ); PCB_LAYER_ID layer = ToLAYER_ID( aLayer );
if( visible.test( layer ) == isVisible ) if( visible.test( layer ) == isVisible )
return; return;
visible.set( layer, isVisible ); visible.set( layer, isVisible );
board->SetVisibleLayers( visible ); setVisibleLayers( visible );
m_frame->GetCanvas()->GetView()->SetLayerVisible( layer, isVisible ); m_frame->GetCanvas()->GetView()->SetLayerVisible( layer, isVisible );
@ -1032,6 +1050,77 @@ void APPEARANCE_CONTROLS::SetObjectVisible( GAL_LAYER_ID aLayer, bool isVisible
} }
void APPEARANCE_CONTROLS::setVisibleLayers( LSET aLayers )
{
if( m_isFpEditor )
{
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
for( PCB_LAYER_ID layer : LSET::AllLayersMask().Seq() )
view->SetLayerVisible( layer, aLayers.Contains( layer ) );
}
else
{
m_frame->GetBoard()->SetVisibleLayers( aLayers );
}
}
void APPEARANCE_CONTROLS::setVisibleObjects( GAL_SET aLayers )
{
if( m_isFpEditor )
{
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
for( size_t i = 0; i < aLayers.size(); i++ )
view->SetLayerVisible( GAL_LAYER_ID_START + GAL_LAYER_ID( i ), aLayers.test( i ) );
}
else
{
m_frame->GetBoard()->SetVisibleElements( aLayers );
}
}
LSET APPEARANCE_CONTROLS::getVisibleLayers()
{
if( m_isFpEditor )
{
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
LSET set;
for( PCB_LAYER_ID layer : LSET::AllLayersMask().Seq() )
set.set( layer, view->IsLayerVisible( layer ) );
return set;
}
else
{
return m_frame->GetBoard()->GetVisibleLayers();
}
}
GAL_SET APPEARANCE_CONTROLS::getVisibleObjects()
{
if( m_isFpEditor )
{
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
GAL_SET set;
set.reset();
for( size_t i = 0; i < set.size(); i++ )
set.set( i, view->IsLayerVisible( GAL_LAYER_ID_START + GAL_LAYER_ID( i ) ) );
return set;
}
else
{
return m_frame->GetBoard()->GetVisibleElements();
}
}
void APPEARANCE_CONTROLS::OnLayerAlphaChanged() void APPEARANCE_CONTROLS::OnLayerAlphaChanged()
{ {
// TODO(JE) Is this even needed if the layer alphas are getting directly updated? // TODO(JE) Is this even needed if the layer alphas are getting directly updated?
@ -1090,6 +1179,10 @@ void APPEARANCE_CONTROLS::UpdateDisplayOptions()
case NET_COLOR_MODE::OFF: m_rbNetColorOff->SetValue( true ); break; case NET_COLOR_MODE::OFF: m_rbNetColorOff->SetValue( true ); break;
} }
m_cbFlipBoard->SetValue( m_frame->GetCanvas()->GetView()->IsMirroredX() );
if( !m_isFpEditor )
{
if( options.m_RatsnestMode == RATSNEST_MODE::ALL ) if( options.m_RatsnestMode == RATSNEST_MODE::ALL )
m_rbRatsnestAllLayers->SetValue( true ); m_rbRatsnestAllLayers->SetValue( true );
else else
@ -1098,8 +1191,7 @@ void APPEARANCE_CONTROLS::UpdateDisplayOptions()
wxASSERT( m_objectSettingsMap.count( LAYER_RATSNEST ) ); wxASSERT( m_objectSettingsMap.count( LAYER_RATSNEST ) );
APPEARANCE_SETTING* ratsnest = m_objectSettingsMap.at( LAYER_RATSNEST ); APPEARANCE_SETTING* ratsnest = m_objectSettingsMap.at( LAYER_RATSNEST );
ratsnest->ctl_visibility->SetValue( options.m_ShowGlobalRatsnest ); ratsnest->ctl_visibility->SetValue( options.m_ShowGlobalRatsnest );
}
m_cbFlipBoard->SetValue( m_frame->GetCanvas()->GetView()->IsMirroredX() );
} }
@ -1180,7 +1272,7 @@ void APPEARANCE_CONTROLS::rebuildLayers()
{ {
BOARD* board = m_frame->GetBoard(); BOARD* board = m_frame->GetBoard();
LSET enabled = board->GetEnabledLayers(); LSET enabled = board->GetEnabledLayers();
LSET visible = board->GetVisibleLayers(); LSET visible = getVisibleLayers();
COLOR_SETTINGS* theme = m_frame->GetColorSettings(); COLOR_SETTINGS* theme = m_frame->GetColorSettings();
COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND ); COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND );
@ -1256,11 +1348,18 @@ void APPEARANCE_CONTROLS::rebuildLayers()
btn_visible->Bind( TOGGLE_CHANGED, btn_visible->Bind( TOGGLE_CHANGED,
[&]( wxCommandEvent& aEvent ) [&]( wxCommandEvent& aEvent )
{ {
int layId = static_cast<wxWindow*>( aEvent.GetEventObject() )->GetId(); wxObject* btn = aEvent.GetEventObject();
int layId = static_cast<wxWindow*>( btn )->GetId();
bool isVisible = aEvent.GetInt(); bool isVisible = aEvent.GetInt();
wxASSERT( layId >= 0 && layId < PCB_LAYER_ID_COUNT ); wxASSERT( layId >= 0 && layId < PCB_LAYER_ID_COUNT );
if( LSET::ForbiddenFootprintLayers().test( layId ) )
{
static_cast<BITMAP_TOGGLE*>( btn )->SetValue( !isVisible );
return;
}
onLayerVisibilityChanged( static_cast<PCB_LAYER_ID>( layId ), onLayerVisibilityChanged( static_cast<PCB_LAYER_ID>( layId ),
isVisible, true ); isVisible, true );
} ); } );
@ -1306,14 +1405,11 @@ void APPEARANCE_CONTROLS::rebuildLayers()
appendLayer( setting ); appendLayer( setting );
// TODO(JE) if( m_isFpEditor && LSET::ForbiddenFootprintLayers().test( layer ) )
#ifdef NOTYET
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
{ {
getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false ); setting->ctl_text->Disable();
getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString ); setting->ctl_color->SetToolTip( wxEmptyString );
} }
#endif
} }
// technical layers are shown in this order: // technical layers are shown in this order:
@ -1368,14 +1464,11 @@ void APPEARANCE_CONTROLS::rebuildLayers()
appendLayer( setting ); appendLayer( setting );
// TODO(JE) if( m_isFpEditor && LSET::ForbiddenFootprintLayers().test( layer ) )
#ifdef NOTYET
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
{ {
getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false ); setting->ctl_text->Disable();
getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString ); setting->ctl_color->SetToolTip( wxEmptyString );
} }
#endif
} }
m_layersOuterSizer->AddSpacer( 10 ); m_layersOuterSizer->AddSpacer( 10 );
@ -1444,7 +1537,7 @@ void APPEARANCE_CONTROLS::rebuildLayerContextMenu()
void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent ) void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
{ {
BOARD* board = m_frame->GetBoard(); BOARD* board = m_frame->GetBoard();
LSET visible = board->GetVisibleLayers(); LSET visible = getVisibleLayers();
PCB_LAYER_ID current = m_frame->GetActiveLayer(); PCB_LAYER_ID current = m_frame->GetActiveLayer();
@ -1461,7 +1554,7 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
case ID_SHOW_ALL_COPPER_LAYERS: case ID_SHOW_ALL_COPPER_LAYERS:
{ {
visible |= presetAllCopper.layers; visible |= presetAllCopper.layers;
board->SetVisibleLayers( visible ); setVisibleLayers( visible );
break; break;
} }
@ -1477,7 +1570,7 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
if( !visible.test( current ) ) if( !visible.test( current ) )
m_frame->SetActiveLayer( *visible.Seq().begin() ); m_frame->SetActiveLayer( *visible.Seq().begin() );
board->SetVisibleLayers( visible ); setVisibleLayers( visible );
break; break;
} }
@ -1488,7 +1581,7 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
if( !visible.test( current ) ) if( !visible.test( current ) )
m_frame->SetActiveLayer( *visible.Seq().begin() ); m_frame->SetActiveLayer( *visible.Seq().begin() );
board->SetVisibleLayers( visible ); setVisibleLayers( visible );
break; break;
} }
@ -1496,7 +1589,7 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
{ {
visible |= ~presetAllCopper.layers; visible |= ~presetAllCopper.layers;
board->SetVisibleLayers( visible ); setVisibleLayers( visible );
break; break;
} }
@ -1523,7 +1616,10 @@ void APPEARANCE_CONTROLS::OnLayerContextMenu( wxCommandEvent& aEvent )
syncLayerPresetSelection(); syncLayerPresetSelection();
syncColorsAndVisibility(); syncColorsAndVisibility();
if( !m_isFpEditor )
m_frame->GetCanvas()->SyncLayersVisibility( board ); m_frame->GetCanvas()->SyncLayersVisibility( board );
m_frame->GetCanvas()->Refresh(); m_frame->GetCanvas()->Refresh();
} }
@ -1545,9 +1641,8 @@ void APPEARANCE_CONTROLS::SetTabIndex( int aTab )
void APPEARANCE_CONTROLS::syncColorsAndVisibility() void APPEARANCE_CONTROLS::syncColorsAndVisibility()
{ {
BOARD* board = m_frame->GetBoard(); LSET visible = getVisibleLayers();
LSET visible = board->GetVisibleLayers(); GAL_SET objects = getVisibleObjects();
GAL_SET objects = board->GetVisibleElements();
Freeze(); Freeze();
@ -1594,11 +1689,8 @@ void APPEARANCE_CONTROLS::onLayerClick( wxMouseEvent& aEvent )
PCB_LAYER_ID layer = ToLAYER_ID( eventSource->GetId() ); PCB_LAYER_ID layer = ToLAYER_ID( eventSource->GetId() );
// TODO(JE) if( m_isFpEditor && LSET::ForbiddenFootprintLayers().test( layer ) )
#ifdef NOTYET return;
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
return false;
#endif
m_frame->SetActiveLayer( layer ); m_frame->SetActiveLayer( layer );
passOnFocus(); passOnFocus();
@ -1608,15 +1700,13 @@ void APPEARANCE_CONTROLS::onLayerClick( wxMouseEvent& aEvent )
void APPEARANCE_CONTROLS::onLayerVisibilityChanged( PCB_LAYER_ID aLayer, bool isVisible, void APPEARANCE_CONTROLS::onLayerVisibilityChanged( PCB_LAYER_ID aLayer, bool isVisible,
bool isFinal ) bool isFinal )
{ {
BOARD* board = m_frame->GetBoard(); LSET visibleLayers = getVisibleLayers();
LSET visibleLayers = board->GetVisibleLayers();
if( visibleLayers.test( aLayer ) != isVisible ) if( visibleLayers.test( aLayer ) != isVisible )
{ {
visibleLayers.set( aLayer, isVisible ); visibleLayers.set( aLayer, isVisible );
board->SetVisibleLayers( visibleLayers ); setVisibleLayers( visibleLayers );
m_frame->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible ); m_frame->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible );
} }
@ -1631,8 +1721,7 @@ void APPEARANCE_CONTROLS::onLayerVisibilityChanged( PCB_LAYER_ID aLayer, bool is
void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible, void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible,
bool isFinal ) bool isFinal )
{ {
BOARD* board = m_frame->GetBoard(); GAL_SET visible = getVisibleObjects();
GAL_SET visible = board->GetVisibleElements();
// Special-case controls // Special-case controls
switch( aLayer ) switch( aLayer )
@ -1667,7 +1756,7 @@ void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool i
if( visible.Contains( aLayer ) != isVisible ) if( visible.Contains( aLayer ) != isVisible )
{ {
visible.set( aLayer, isVisible ); visible.set( aLayer, isVisible );
board->SetVisibleElements( visible ); setVisibleObjects( visible );
m_frame->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible ); m_frame->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible );
syncLayerPresetSelection(); syncLayerPresetSelection();
} }
@ -1682,10 +1771,9 @@ void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool i
void APPEARANCE_CONTROLS::rebuildObjects() void APPEARANCE_CONTROLS::rebuildObjects()
{ {
BOARD* board = m_frame->GetBoard();
COLOR_SETTINGS* theme = m_frame->GetColorSettings(); COLOR_SETTINGS* theme = m_frame->GetColorSettings();
COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND ); COLOR4D bgColor = theme->GetColor( LAYER_PCB_BACKGROUND );
GAL_SET visible = board->GetVisibleElements(); GAL_SET visible = getVisibleObjects();
int swatchWidth = m_windowObjects->ConvertDialogToPixels( wxSize( 8, 0 ) ).x; int swatchWidth = m_windowObjects->ConvertDialogToPixels( wxSize( 8, 0 ) ).x;
int labelWidth = 0; int labelWidth = 0;
@ -1800,11 +1888,8 @@ void APPEARANCE_CONTROLS::rebuildObjects()
for( const APPEARANCE_SETTING& s_setting : s_objectSettings ) for( const APPEARANCE_SETTING& s_setting : s_objectSettings )
{ {
// TODO(JE) if( m_isFpEditor && !s_allowedInFpEditor.count( s_setting.id ) )
#ifdef NOTYET
if( m_fp_editor_mode && !isAllowedInFpMode( setting.id ) )
continue; continue;
#endif
if( !s_setting.spacer ) if( !s_setting.spacer )
{ {
@ -1842,8 +1927,7 @@ void APPEARANCE_CONTROLS::rebuildObjects()
void APPEARANCE_CONTROLS::syncObjectSettings() void APPEARANCE_CONTROLS::syncObjectSettings()
{ {
BOARD* board = m_frame->GetBoard(); GAL_SET visible = getVisibleObjects();
GAL_SET visible = board->GetVisibleElements();
const PCB_DISPLAY_OPTIONS& opts = m_frame->GetDisplayOptions(); const PCB_DISPLAY_OPTIONS& opts = m_frame->GetDisplayOptions();
@ -2047,9 +2131,8 @@ void APPEARANCE_CONTROLS::rebuildLayerPresetsWidget()
void APPEARANCE_CONTROLS::syncLayerPresetSelection() void APPEARANCE_CONTROLS::syncLayerPresetSelection()
{ {
BOARD* board = m_frame->GetBoard(); LSET visibleLayers = getVisibleLayers();
LSET visibleLayers = board->GetVisibleLayers(); GAL_SET visibleObjects = getVisibleObjects();
GAL_SET visibleObjects = board->GetVisibleElements();
auto it = std::find_if( m_layerPresets.begin(), m_layerPresets.end(), auto it = std::find_if( m_layerPresets.begin(), m_layerPresets.end(),
[&]( const std::pair<const wxString, LAYER_PRESET>& aPair ) [&]( const std::pair<const wxString, LAYER_PRESET>& aPair )
@ -2086,8 +2169,6 @@ void APPEARANCE_CONTROLS::updateLayerPresetSelection( const wxString& aName )
void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent ) void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent )
{ {
BOARD* board = m_frame->GetBoard();
int count = m_cbLayerPresets->GetCount(); int count = m_cbLayerPresets->GetCount();
int index = m_cbLayerPresets->GetSelection(); int index = m_cbLayerPresets->GetSelection();
@ -2126,8 +2207,8 @@ void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent )
bool exists = m_layerPresets.count( name ); bool exists = m_layerPresets.count( name );
if( !exists ) if( !exists )
m_layerPresets[name] = LAYER_PRESET( name, board->GetVisibleLayers(), m_layerPresets[name] = LAYER_PRESET( name, getVisibleLayers(),
board->GetVisibleElements(), UNSELECTED_LAYER ); getVisibleObjects(), UNSELECTED_LAYER );
LAYER_PRESET* preset = &m_layerPresets[name]; LAYER_PRESET* preset = &m_layerPresets[name];
m_currentPreset = preset; m_currentPreset = preset;
@ -2203,8 +2284,8 @@ void APPEARANCE_CONTROLS::doApplyLayerPreset( const LAYER_PRESET& aPreset )
{ {
BOARD* board = m_frame->GetBoard(); BOARD* board = m_frame->GetBoard();
board->SetVisibleLayers( aPreset.layers ); setVisibleLayers( aPreset.layers );
board->SetVisibleElements( aPreset.renderLayers ); setVisibleObjects( aPreset.renderLayers );
// If the preset doesn't have an explicit active layer to restore, we can at least // If the preset doesn't have an explicit active layer to restore, we can at least
// force the active layer to be something in the preset's layer set // force the active layer to be something in the preset's layer set
@ -2220,7 +2301,9 @@ void APPEARANCE_CONTROLS::doApplyLayerPreset( const LAYER_PRESET& aPreset )
if( activeLayer != UNSELECTED_LAYER && boardLayers.Contains( activeLayer ) ) if( activeLayer != UNSELECTED_LAYER && boardLayers.Contains( activeLayer ) )
m_frame->SetActiveLayer( activeLayer ); m_frame->SetActiveLayer( activeLayer );
if( !m_isFpEditor )
m_frame->GetCanvas()->SyncLayersVisibility( board ); m_frame->GetCanvas()->SyncLayersVisibility( board );
m_frame->GetCanvas()->Refresh(); m_frame->GetCanvas()->Refresh();
syncColorsAndVisibility(); syncColorsAndVisibility();

View File

@ -286,6 +286,8 @@ private:
BOARD* m_board; BOARD* m_board;
bool m_isFpEditor;
// Nets grid view // Nets grid view
NET_GRID_TABLE* m_netsTable; NET_GRID_TABLE* m_netsTable;
@ -416,6 +418,14 @@ private:
void onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible, bool isFinal ); void onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible, bool isFinal );
void setVisibleLayers( LSET aLayers );
void setVisibleObjects( GAL_SET aObjects );
LSET getVisibleLayers();
GAL_SET getVisibleObjects();
void onObjectOpacitySlider( int aLayer, float aOpacity ); void onObjectOpacitySlider( int aLayer, float aOpacity );
void updateLayerPresetSelection( const wxString& aName ); void updateLayerPresetSelection( const wxString& aName );