Enable properties panel in footprint editor

This commit is contained in:
Jon Evans 2023-02-15 22:16:49 -05:00
parent f12f2b8420
commit f7d59f2e89
24 changed files with 170 additions and 68 deletions

View File

@ -35,6 +35,8 @@ PG_UNIT_EDITOR::PG_UNIT_EDITOR( EDA_DRAW_FRAME* aFrame ) :
{
m_unitBinder = std::make_unique<PROPERTY_EDITOR_UNIT_BINDER>( m_frame );
m_unitBinder->SetUnits( m_frame->GetUserUnits() );
m_editorName = BuildEditorName( m_frame );
}
@ -43,6 +45,12 @@ PG_UNIT_EDITOR::~PG_UNIT_EDITOR()
}
wxString PG_UNIT_EDITOR::BuildEditorName( EDA_DRAW_FRAME* aFrame )
{
return EDITOR_NAME + aFrame->GetName();
}
void PG_UNIT_EDITOR::UpdateFrame( EDA_DRAW_FRAME* aFrame )
{
m_frame = aFrame;

View File

@ -24,6 +24,7 @@
#include <macros.h>
#include <validators.h>
#include <eda_draw_frame.h>
#include <eda_units.h>
#include <properties/eda_angle_variant.h>
#include <properties/pg_properties.h>
@ -76,7 +77,7 @@ wxAnyValueTypeScopedPtr wxAnyToEDA_ANGLE_VARIANTRegistrationImpl::s_instance( ne
static wxAnyToEDA_ANGLE_VARIANTRegistrationImpl s_wxAnyToEDA_ANGLE_VARIANTRegistration( &EDA_ANGLE_VARIANT_DATA::VariantDataFactory );
wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty )
wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty, EDA_DRAW_FRAME* aFrame )
{
wxPGProperty* ret = nullptr;
PROPERTY_DISPLAY display = aProperty->Display();
@ -85,13 +86,13 @@ wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty )
{
case PROPERTY_DISPLAY::PT_SIZE:
ret = new PGPROPERTY_SIZE();
ret->SetEditor( PG_UNIT_EDITOR::EDITOR_NAME );
ret->SetEditor( PG_UNIT_EDITOR::BuildEditorName( aFrame ) );
break;
case PROPERTY_DISPLAY::PT_COORD:
ret = new PGPROPERTY_COORD();
static_cast<PGPROPERTY_COORD*>( ret )->SetCoordType( aProperty->CoordType() );
ret->SetEditor( PG_UNIT_EDITOR::EDITOR_NAME );
ret->SetEditor( PG_UNIT_EDITOR::BuildEditorName( aFrame ) );
break;
case PROPERTY_DISPLAY::PT_DECIDEGREE:
@ -103,7 +104,7 @@ wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty )
prop->SetScale( 10.0 );
ret = prop;
ret->SetEditor( PG_UNIT_EDITOR::EDITOR_NAME );
ret->SetEditor( PG_UNIT_EDITOR::BuildEditorName( aFrame ) );
break;
}

View File

@ -348,8 +348,9 @@ void PROPERTY_MANAGER::CLASS_DESC::collectPropsRecur( PROPERTY_LIST& aResult,
aResult.push_back( property );
}
for( const std::reference_wrapper<CLASS_DESC>& base : m_bases )
base.get().collectPropsRecur( aResult, aReplaced, aDisplayOrder, aMasked );
// Iterate backwards so that replaced properties appear before base properties
for( auto it = m_bases.rbegin(); it != m_bases.rend(); ++it )
it->get().collectPropsRecur( aResult, aReplaced, aDisplayOrder, aMasked );
}

View File

@ -62,8 +62,11 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
wxPGEditor_DatePickerCtrl = nullptr;
}
delete wxPGGlobalVars->m_defaultRenderer;
wxPGGlobalVars->m_defaultRenderer = new PG_CELL_RENDERER();
if( !dynamic_cast<PG_CELL_RENDERER*>( wxPGGlobalVars->m_defaultRenderer ) )
{
delete wxPGGlobalVars->m_defaultRenderer;
wxPGGlobalVars->m_defaultRenderer = new PG_CELL_RENDERER();
}
m_caption = new wxStaticText( this, wxID_ANY, _( "No objects selected" ) );
mainSizer->Add( m_caption, 0, wxALL | wxEXPAND, 5 );
@ -201,6 +204,7 @@ void PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
}
EDA_ITEM* firstItem = aSelection.Front();
bool isFootprintEditor = m_frame->IsType( FRAME_FOOTPRINT_EDITOR );
// Find a set of properties that is common to all selected items
for( PROPERTY_BASE* property : commonProps )
@ -208,6 +212,9 @@ void PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
if( property->IsInternal() )
continue;
if( isFootprintEditor && property->IsHiddenFromLibraryEditors() )
continue;
if( propMgr.IsAvailableFor( TYPE_HASH( *firstItem ), property, firstItem ) )
availableProps.insert( property );
}

View File

@ -35,6 +35,9 @@ public:
int appearance_panel_tab;
int right_panel_width;
bool show_layer_manager;
bool show_properties;
int properties_panel_width;
float properties_splitter_proportion;
};
struct USER_GRID

View File

@ -37,7 +37,7 @@ public:
virtual ~PG_UNIT_EDITOR();
wxString GetName() const override { return EDITOR_NAME; }
wxString GetName() const override { return m_editorName; }
wxPGWindowList CreateControls( wxPropertyGrid* aPropGrid, wxPGProperty* aProperty,
const wxPoint& aPos, const wxSize& aSize ) const override;
@ -58,10 +58,14 @@ public:
*/
void UpdateFrame( EDA_DRAW_FRAME* aFrame );
static wxString BuildEditorName( EDA_DRAW_FRAME* aFrame );
protected:
EDA_DRAW_FRAME* m_frame;
std::unique_ptr<PROPERTY_EDITOR_UNIT_BINDER> m_unitBinder;
wxString m_editorName;
};

View File

@ -29,8 +29,9 @@
class PROPERTY_BASE;
class REGEX_VALIDATOR;
class EDA_DRAW_FRAME;
wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty );
wxPGProperty* PGPropertyFactory( const PROPERTY_BASE* aProperty, EDA_DRAW_FRAME* aFrame );
///> Customized abstract wxPGProperty class to handle coordinate/size units
class PGPROPERTY_DISTANCE

View File

@ -187,6 +187,7 @@ PROPERTY_BASE( const wxString& aName, PROPERTY_DISPLAY aDisplay = PT_DEFAULT,
m_coordType( aCoordType ),
m_isInternal( false ),
m_isDeprecated( false ),
m_hideFromLibraryEditors( false ),
m_availFunc( [](INSPECTABLE*)->bool { return true; } ),
m_writeableFunc( [](INSPECTABLE*)->bool { return true; } ),
m_validator( NullValidator )
@ -293,6 +294,13 @@ PROPERTY_BASE( const wxString& aName, PROPERTY_DISPLAY aDisplay = PT_DEFAULT,
return *this;
}
bool IsHiddenFromLibraryEditors() const { return m_hideFromLibraryEditors; }
PROPERTY_BASE& SetIsHiddenFromLibraryEditors( bool aIsHidden = true )
{
m_hideFromLibraryEditors = aIsHidden;
return *this;
}
wxString Group() const { return m_group; }
PROPERTY_BASE& SetGroup( const wxString& aGroup ) { m_group = aGroup; return *this; }
@ -375,6 +383,9 @@ private:
/// Deprecated properties are hidden from the GUI and rules editor autocomplete
bool m_isDeprecated;
/// This property should only be shown in the design editor, not the library editor
bool m_hideFromLibraryEditors;
/// Optional group identifier
wxString m_group;

View File

@ -263,6 +263,17 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
if( boardItem->IsSelected() )
selectedModified = true;
// If we're the footprint editor, the boardItem will always be the containing footprint
if( m_isFootprintEditor && boardItem->Type() == PCB_FOOTPRINT_T )
{
static_cast<FOOTPRINT*>( boardItem )->RunOnChildren(
[&selectedModified]( BOARD_ITEM* aItem )
{
if( aItem->HasFlag( IS_MODIFIED_CHILD ) )
selectedModified = true;
} );
}
switch( changeType )
{
case CHT_ADD:

View File

@ -169,28 +169,32 @@ static struct BOARD_CONNECTED_ITEM_DESC
layer->SetChoices( layerEnum.Choices() );
propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ), layer );
auto netCode = new PROPERTY_ENUM<BOARD_CONNECTED_ITEM, int>( _HKI( "Net" ),
&BOARD_CONNECTED_ITEM::SetNetCode, &BOARD_CONNECTED_ITEM::GetNetCode );
netCode->SetIsDeprecated(); // Not really, but hide from rule editor suggestions
propMgr.AddProperty( netCode );
// Not really deprecated, but hidden from rule editor suggestions
propMgr.AddProperty( new PROPERTY_ENUM<BOARD_CONNECTED_ITEM, int>( _HKI( "Net" ),
&BOARD_CONNECTED_ITEM::SetNetCode,
&BOARD_CONNECTED_ITEM::GetNetCode ) )
.SetIsDeprecated()
.SetIsHiddenFromLibraryEditors();
auto netClass = new PROPERTY<BOARD_CONNECTED_ITEM, wxString>( _HKI( "Net Class" ),
NO_SETTER( BOARD_CONNECTED_ITEM, wxString ),
&BOARD_CONNECTED_ITEM::GetNetClassName );
netClass->SetIsDeprecated(); // Not really, but hide from rule editor suggestions
propMgr.AddProperty( netClass );
// Not really deprecated, but hidden from rule editor suggestions
propMgr.AddProperty( new PROPERTY<BOARD_CONNECTED_ITEM, wxString>( _HKI( "Net Class" ),
NO_SETTER( BOARD_CONNECTED_ITEM, wxString ),
&BOARD_CONNECTED_ITEM::GetNetClassName ) )
.SetIsDeprecated()
.SetIsHiddenFromLibraryEditors();
// Compatibility alias for DRC engine
auto oldNetClass = new PROPERTY<BOARD_CONNECTED_ITEM, wxString>( _HKI( "NetClass" ),
NO_SETTER( BOARD_CONNECTED_ITEM, wxString ),
&BOARD_CONNECTED_ITEM::GetNetClassName );
oldNetClass->SetIsInternal();
propMgr.AddProperty( oldNetClass );
propMgr.AddProperty( new PROPERTY<BOARD_CONNECTED_ITEM, wxString>( _HKI( "NetClass" ),
NO_SETTER( BOARD_CONNECTED_ITEM, wxString ),
&BOARD_CONNECTED_ITEM::GetNetClassName ) )
.SetIsInternal()
.SetIsHiddenFromLibraryEditors();
// Used only in DRC engine
auto oldNetName = new PROPERTY<BOARD_CONNECTED_ITEM, wxString>( _HKI( "NetName" ),
NO_SETTER( BOARD_CONNECTED_ITEM, wxString ), &BOARD_CONNECTED_ITEM::GetNetname );
oldNetName->SetIsInternal();
propMgr.AddProperty( oldNetName );
propMgr.AddProperty( new PROPERTY<BOARD_CONNECTED_ITEM, wxString>( _HKI( "NetName" ),
NO_SETTER( BOARD_CONNECTED_ITEM, wxString ),
&BOARD_CONNECTED_ITEM::GetNetname ) )
.SetIsInternal()
.SetIsHiddenFromLibraryEditors();
}
} _BOARD_CONNECTED_ITEM_DESC;

View File

@ -31,6 +31,7 @@
#include "tools/placement_tool.h"
#include "tools/pcb_point_editor.h"
#include "tools/pcb_selection_tool.h"
#include "tools/properties_tool.h"
#include <python/scripting/pcb_scripting_tool.h>
#include <3d_viewer/eda_3d_viewer_frame.h>
#include <bitmaps.h>
@ -68,6 +69,7 @@
#include <widgets/appearance_controls.h>
#include <widgets/lib_tree.h>
#include <widgets/panel_selection_filter.h>
#include <widgets/pcb_properties_panel.h>
#include <widgets/wx_progress_reporters.h>
#include <wildcards_and_files_ext.h>
#include <wx/filedlg.h>
@ -176,12 +178,16 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas(), true );
m_propertiesPanel = new PCB_PROPERTIES_PANEL( this, this );
// LoadSettings() *after* creating m_LayersManager, because LoadSettings() initialize
// parameters in m_LayersManager
// NOTE: KifaceSettings() will return PCBNEW_SETTINGS if we started from pcbnew
LoadSettings( GetSettings() );
float proportion = GetFootprintEditorSettings()->m_AuiPanels.properties_splitter_proportion;
m_propertiesPanel->SetSplitterProportion( proportion );
// Must be set after calling LoadSettings() to be sure these parameters are not dependent
// on what is read in stored settings. Enable one internal layer, because footprints
// support keepout areas that can be on internal layers only (therefore on the first internal
@ -214,9 +220,12 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Columns; layers 1 - 3
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" )
.Left().Layer( 3 )
.Left().Layer( 4 )
.Caption( _( "Libraries" ) )
.MinSize( 250, -1 ).BestSize( 250, -1 ) );
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( wxS( "PropertiesManager" ) )
.Left().Layer( 3 ).Caption( _( "Properties" ) )
.PaneBorder( false ).MinSize( 240, -1 ).BestSize( 300, -1 ) );
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
.Left().Layer( 2 ) );
@ -237,6 +246,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
m_auimgr.GetPane( "PropertiesManager" ).Show( m_show_properties );
// The selection filter doesn't need to grow in the vertical direction when docked
m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
@ -605,6 +615,7 @@ void FOOTPRINT_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
m_displayOptions = cfg->m_Display;
m_show_layer_manager_tools = cfg->m_AuiPanels.show_layer_manager;
m_show_properties = cfg->m_AuiPanels.show_properties;
GetToolManager()->GetTool<PCB_SELECTION_TOOL>()->GetFilter() = cfg->m_SelectionFilter;
m_selectionFilterPanel->SetCheckboxesFromFilter( cfg->m_SelectionFilter );
@ -630,6 +641,12 @@ void FOOTPRINT_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
cfg->m_AuiPanels.show_layer_manager = m_show_layer_manager_tools;
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
cfg->m_AuiPanels.appearance_panel_tab = m_appearancePanel->GetTabIndex();
cfg->m_AuiPanels.show_properties = m_show_properties;
cfg->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
cfg->m_AuiPanels.properties_splitter_proportion =
m_propertiesPanel->SplitterProportion();
}
@ -1071,6 +1088,7 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
m_toolManager->RegisterTool( new GROUP_TOOL );
m_toolManager->RegisterTool( new CONVERT_TOOL );
m_toolManager->RegisterTool( new SCRIPTING_TOOL );
m_toolManager->RegisterTool( new PROPERTIES_TOOL );
for( TOOL_BASE* tool : m_toolManager->Tools() )
{
@ -1177,6 +1195,12 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions()
return m_auimgr.GetPane( "LayersManager" ).IsShown();
};
auto propertiesCond =
[this] ( const SELECTION& )
{
return m_auimgr.GetPane( "PropertiesManager" ).IsShown();
};
mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( constrainedDrawingModeCond ) );
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
@ -1184,6 +1208,7 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( PCB_ACTIONS::showFootprintTree, CHECK( footprintTreeCond ) );
mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) );
mgr->SetConditions( PCB_ACTIONS::showProperties, CHECK( propertiesCond ) );
mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );

View File

@ -71,6 +71,15 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
m_params.emplace_back( new PARAM<int>( "aui.appearance_panel_tab",
&m_AuiPanels.appearance_panel_tab, 0, 0, 2 ) );
m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
&m_AuiPanels.properties_panel_width, -1 ) );
m_params.emplace_back( new PARAM<float>( "aui.properties_splitter_proportion",
&m_AuiPanels.properties_splitter_proportion, 0.5f ) );
m_params.emplace_back( new PARAM<bool>( "aui.show_properties",
&m_AuiPanels.show_properties, false ) );
m_params.emplace_back( new PARAM<wxString>( "system.last_import_export_path",
&m_LastImportExportPath, "" ) );

View File

@ -428,6 +428,7 @@ static struct FP_SHAPE_DESC
propMgr.InheritsAfter( TYPE_HASH( FP_SHAPE ), TYPE_HASH( PCB_SHAPE ) );
propMgr.AddProperty( new PROPERTY<FP_SHAPE, wxString>( _HKI( "Parent" ),
NO_SETTER( FP_SHAPE, wxString ), &FP_SHAPE::GetParentAsString ) );
NO_SETTER( FP_SHAPE, wxString ), &FP_SHAPE::GetParentAsString ) )
.SetIsHiddenFromLibraryEditors();
}
} _FP_SHAPE_DESC;

View File

@ -1790,9 +1790,11 @@ static struct PAD_DESC
propMgr.AddProperty( padNumber, groupPad );
propMgr.AddProperty( new PROPERTY<PAD, wxString>( _HKI( "Pin Name" ),
NO_SETTER( PAD, wxString ), &PAD::GetPinFunction ), groupPad );
NO_SETTER( PAD, wxString ), &PAD::GetPinFunction ), groupPad )
.SetIsHiddenFromLibraryEditors();
propMgr.AddProperty( new PROPERTY<PAD, wxString>( _HKI( "Pin Type" ),
NO_SETTER( PAD, wxString ), &PAD::GetPinType ), groupPad );
NO_SETTER( PAD, wxString ), &PAD::GetPinType ), groupPad )
.SetIsHiddenFromLibraryEditors();
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Size X" ),
&PAD::SetSizeX, &PAD::GetSizeX,

View File

@ -42,6 +42,7 @@
#include <dialogs/eda_view_switcher.h>
#include <wildcards_and_files_ext.h>
#include <collectors.h>
#include <widgets/wx_aui_utils.h>
PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
@ -53,7 +54,8 @@ PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_selectionFilterPanel( nullptr ),
m_appearancePanel( nullptr ),
m_propertiesPanel( nullptr ),
m_tabbedPanel( nullptr )
m_tabbedPanel( nullptr ),
m_show_properties( false )
{
m_darkMode = KIPLATFORM::UI::IsDarkTheme();
@ -300,3 +302,27 @@ void PCB_BASE_EDIT_FRAME::UpdateProperties()
m_propertiesPanel->UpdateData();
}
void PCB_BASE_EDIT_FRAME::ToggleProperties()
{
if( !m_propertiesPanel )
return;
PCBNEW_SETTINGS* settings = GetPcbNewSettings();
m_show_properties = !m_show_properties;
wxAuiPaneInfo& propertiesPaneInfo = m_auimgr.GetPane( "PropertiesManager" );
propertiesPaneInfo.Show( m_show_properties );
if( m_show_properties )
{
SetAuiPaneSize( m_auimgr, propertiesPaneInfo,
settings->m_AuiPanels.properties_panel_width, -1 );
}
else
{
settings->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
m_auimgr.Update();
}
}

View File

@ -221,6 +221,8 @@ public:
void UpdateProperties();
void ToggleProperties();
protected:
/**
* Prompts a user to select global or project library tables
@ -255,6 +257,7 @@ protected:
wxAuiNotebook* m_tabbedPanel; /// Panel with Layers and Object Inspector tabs
bool m_darkMode;
bool m_show_properties;
};
#endif

View File

@ -304,7 +304,6 @@ public:
void PrepareLayerIndicator( bool aForceRebuild = false );
void ToggleLayersManager();
void ToggleProperties();
void ToggleSearch();
/**
@ -814,7 +813,6 @@ public:
wxChoice* m_SelViaSizeBox; // a choice box to display and select current via diameter
bool m_show_layer_manager_tools;
bool m_show_properties;
bool m_show_search;
bool m_ZoneFillsDirty; // Board has been modified since last zone fill.

View File

@ -249,6 +249,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddScaledSeparator( this );
m_optionsToolBar->Add( PCB_ACTIONS::showFootprintTree, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::showLayersManager, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::showProperties, ACTION_TOOLBAR::TOGGLE );
PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
std::unique_ptr<ACTION_MENU> gridMenu = std::make_unique<ACTION_MENU>( false, selTool );

View File

@ -797,31 +797,6 @@ void PCB_EDIT_FRAME::ToggleLayersManager()
}
void PCB_EDIT_FRAME::ToggleProperties()
{
if( !m_propertiesPanel )
return;
PCBNEW_SETTINGS* settings = GetPcbNewSettings();
m_show_properties = !m_show_properties;
wxAuiPaneInfo& propertiesPaneInfo = m_auimgr.GetPane( "PropertiesManager" );
propertiesPaneInfo.Show( m_show_properties );
if( m_show_properties )
{
SetAuiPaneSize( m_auimgr, propertiesPaneInfo,
settings->m_AuiPanels.properties_panel_width, -1 );
}
else
{
settings->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
m_auimgr.Update();
}
}
void PCB_EDIT_FRAME::ToggleSearch()
{
PCBNEW_SETTINGS* settings = GetPcbNewSettings();

View File

@ -591,6 +591,13 @@ int FOOTPRINT_EDITOR_CONTROL::ToggleLayersManager( const TOOL_EVENT& aEvent )
}
int FOOTPRINT_EDITOR_CONTROL::ToggleProperties( const TOOL_EVENT& aEvent )
{
m_frame->ToggleProperties();
return 0;
}
int FOOTPRINT_EDITOR_CONTROL::Properties( const TOOL_EVENT& aEvent )
{
FOOTPRINT* footprint = m_frame->GetBoard()->GetFirstFootprint();
@ -768,4 +775,5 @@ void FOOTPRINT_EDITOR_CONTROL::setTransitions()
Go( &FOOTPRINT_EDITOR_CONTROL::Properties, PCB_ACTIONS::footprintProperties.MakeEvent() );
Go( &FOOTPRINT_EDITOR_CONTROL::DefaultPadProperties, PCB_ACTIONS::defaultPadProperties.MakeEvent() );
Go( &FOOTPRINT_EDITOR_CONTROL::ToggleLayersManager, PCB_ACTIONS::showLayersManager.MakeEvent() );
Go( &FOOTPRINT_EDITOR_CONTROL::ToggleProperties, PCB_ACTIONS::showProperties.MakeEvent() );
}

View File

@ -68,6 +68,7 @@ public:
int UnpinLibrary( const TOOL_EVENT& aEvent );
int ToggleFootprintTree( const TOOL_EVENT& aEvent );
int ToggleLayersManager( const TOOL_EVENT& aEvent );
int ToggleProperties( const TOOL_EVENT& aEvent );
int Properties( const TOOL_EVENT& aEvent );
int EditTextAndGraphics( const TOOL_EVENT& aEvent );

View File

@ -25,7 +25,7 @@
int PROPERTIES_TOOL::UpdateProperties( const TOOL_EVENT& aEvent )
{
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
if( editFrame )
editFrame->UpdateProperties();

View File

@ -21,7 +21,7 @@
#include "pcb_properties_panel.h"
#include <pcb_edit_frame.h>
#include <pcb_base_edit_frame.h>
#include <tool/tool_manager.h>
#include <tools/pcb_selection_tool.h>
#include <properties/property_mgr.h>
@ -36,7 +36,7 @@
#include <string_utils.h>
PCB_PROPERTIES_PANEL::PCB_PROPERTIES_PANEL( wxWindow* aParent, PCB_EDIT_FRAME* aFrame ) :
PCB_PROPERTIES_PANEL::PCB_PROPERTIES_PANEL( wxWindow* aParent, PCB_BASE_EDIT_FRAME* aFrame ) :
PROPERTIES_PANEL( aParent, aFrame ),
m_frame( aFrame ),
m_propMgr( PROPERTY_MANAGER::Instance() )
@ -46,7 +46,9 @@ PCB_PROPERTIES_PANEL::PCB_PROPERTIES_PANEL( wxWindow* aParent, PCB_EDIT_FRAME* a
wxASSERT( wxPGGlobalVars );
auto it = wxPGGlobalVars->m_mapEditorClasses.find( PG_UNIT_EDITOR::EDITOR_NAME );
wxString editorKey = PG_UNIT_EDITOR::BuildEditorName( m_frame );
auto it = wxPGGlobalVars->m_mapEditorClasses.find( editorKey );
if( it != wxPGGlobalVars->m_mapEditorClasses.end() )
{
@ -144,7 +146,7 @@ wxPGProperty* PCB_PROPERTIES_PANEL::createPGProperty( const PROPERTY_BASE* aProp
return ret;
}
return PGPropertyFactory( aProperty );
return PGPropertyFactory( aProperty, m_frame );
}

View File

@ -25,7 +25,7 @@
class SELECTION;
class BOARD;
class PCB_EDIT_FRAME;
class PCB_BASE_EDIT_FRAME;
class PROPERTY_MANAGER;
class PG_UNIT_EDITOR;
class PG_CHECKBOX_EDITOR;
@ -33,7 +33,7 @@ class PG_CHECKBOX_EDITOR;
class PCB_PROPERTIES_PANEL : public PROPERTIES_PANEL
{
public:
PCB_PROPERTIES_PANEL( wxWindow* aParent, PCB_EDIT_FRAME* aFrame );
PCB_PROPERTIES_PANEL( wxWindow* aParent, PCB_BASE_EDIT_FRAME* aFrame );
virtual ~PCB_PROPERTIES_PANEL();
@ -52,7 +52,7 @@ protected:
///> Regenerates caches storing layer and net names
void updateLists( const BOARD* aBoard );
PCB_EDIT_FRAME* m_frame;
PCB_BASE_EDIT_FRAME* m_frame;
PROPERTY_MANAGER& m_propMgr;
PG_UNIT_EDITOR* m_unitEditorInstance;
PG_CHECKBOX_EDITOR* m_checkboxEditorInstance;