2018-07-29 15:33:58 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2017 CERN
|
2023-09-18 11:41:02 +00:00
|
|
|
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2018-07-29 15:33:58 +00:00
|
|
|
* @author Maciej Suminski <maciej.suminski@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 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, you may find one here:
|
|
|
|
* https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 3 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2022-07-22 08:26:49 +00:00
|
|
|
#include <pgm_base.h>
|
|
|
|
#include <project/project_file.h>
|
2018-07-29 15:33:58 +00:00
|
|
|
#include <fp_tree_synchronizing_adapter.h>
|
|
|
|
#include <footprint_edit_frame.h>
|
2023-09-02 21:13:48 +00:00
|
|
|
#include <footprint_preview_panel.h>
|
2018-07-29 15:33:58 +00:00
|
|
|
#include <fp_lib_table.h>
|
|
|
|
#include <footprint_info_impl.h>
|
2023-09-18 23:52:27 +00:00
|
|
|
#include <gal/graphics_abstraction_layer.h>
|
2021-07-29 09:56:22 +00:00
|
|
|
#include <string_utils.h>
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <board.h>
|
|
|
|
#include <footprint.h>
|
2019-06-05 19:15:57 +00:00
|
|
|
#include <tool/tool_manager.h>
|
2020-12-25 16:26:32 +00:00
|
|
|
#include <tools/footprint_editor_control.h>
|
2021-05-01 18:04:11 +00:00
|
|
|
#include <wx/settings.h>
|
2018-09-13 23:39:40 +00:00
|
|
|
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2020-11-07 14:31:50 +00:00
|
|
|
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>
|
|
|
|
FP_TREE_SYNCHRONIZING_ADAPTER::Create( FOOTPRINT_EDIT_FRAME* aFrame, FP_LIB_TABLE* aLibs )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
2020-11-07 14:31:50 +00:00
|
|
|
auto* adapter = new FP_TREE_SYNCHRONIZING_ADAPTER( aFrame, aLibs );
|
|
|
|
return wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>( adapter );
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FP_TREE_SYNCHRONIZING_ADAPTER::FP_TREE_SYNCHRONIZING_ADAPTER( FOOTPRINT_EDIT_FRAME* aFrame,
|
|
|
|
FP_LIB_TABLE* aLibs ) :
|
2020-02-14 14:22:21 +00:00
|
|
|
FP_TREE_MODEL_ADAPTER( aFrame, aLibs ),
|
2018-07-29 15:33:58 +00:00
|
|
|
m_frame( aFrame )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-06-05 19:15:57 +00:00
|
|
|
TOOL_INTERACTIVE* FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool()
|
|
|
|
{
|
2020-12-25 16:26:32 +00:00
|
|
|
return m_frame->GetToolManager()->GetTool<FOOTPRINT_EDITOR_CONTROL>();
|
2019-06-05 19:15:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-29 15:33:58 +00:00
|
|
|
bool FP_TREE_SYNCHRONIZING_ADAPTER::IsContainer( const wxDataViewItem& aItem ) const
|
|
|
|
{
|
|
|
|
const LIB_TREE_NODE* node = ToNode( aItem );
|
2020-02-07 17:06:24 +00:00
|
|
|
return node ? node->m_Type == LIB_TREE_NODE::LIB : true;
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-27 11:54:12 +00:00
|
|
|
#define PROGRESS_INTERVAL_MILLIS 33 // 30 FPS refresh rate
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2023-01-19 00:14:31 +00:00
|
|
|
void FP_TREE_SYNCHRONIZING_ADAPTER::Sync( FP_LIB_TABLE* aLibs )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
2023-01-19 00:14:31 +00:00
|
|
|
m_libs = aLibs;
|
|
|
|
|
2018-07-29 15:33:58 +00:00
|
|
|
// Process already stored libraries
|
2021-01-10 22:55:30 +00:00
|
|
|
for( auto it = m_tree.m_Children.begin(); it != m_tree.m_Children.end(); )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
2020-02-07 17:06:24 +00:00
|
|
|
const wxString& name = it->get()->m_Name;
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2021-01-10 22:55:30 +00:00
|
|
|
// Remove the library if it no longer exists or it exists in both the global and the
|
|
|
|
// project library but the project library entry is disabled.
|
|
|
|
if( !m_libs->HasLibrary( name, true )
|
2022-01-22 11:56:52 +00:00
|
|
|
|| m_libs->FindRow( name, true ) != m_libs->FindRow( name, false ) )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
|
|
|
it = deleteLibrary( it );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
updateLibrary( *(LIB_TREE_NODE_LIB*) it->get() );
|
|
|
|
++it;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Look for new libraries
|
2022-07-22 08:26:49 +00:00
|
|
|
COMMON_SETTINGS* cfg = Pgm().GetCommonSettings();
|
|
|
|
PROJECT_FILE& project = m_frame->Prj().GetProjectFile();
|
|
|
|
size_t count = m_libMap.size();
|
2018-08-05 11:56:02 +00:00
|
|
|
|
2022-01-22 11:56:52 +00:00
|
|
|
for( const wxString& libName : m_libs->GetLogicalLibs() )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
|
|
|
if( m_libMap.count( libName ) == 0 )
|
|
|
|
{
|
2023-09-18 11:41:02 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
const FP_LIB_TABLE_ROW* library = m_libs->FindRow( libName, true );
|
|
|
|
bool pinned = alg::contains( cfg->m_Session.pinned_fp_libs, libName )
|
|
|
|
|| alg::contains( project.m_PinnedFootprintLibs, libName );
|
|
|
|
|
|
|
|
DoAddLibrary( libName, library->GetDescr(), getFootprints( libName ), pinned, true );
|
|
|
|
m_libMap.insert( libName );
|
|
|
|
}
|
|
|
|
catch( ... )
|
|
|
|
{
|
|
|
|
// do nothing if libname is not found. Just skip it
|
|
|
|
}
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-05 11:56:02 +00:00
|
|
|
|
|
|
|
if( m_libMap.size() > count )
|
|
|
|
m_tree.AssignIntrinsicRanks();
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int FP_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount() const
|
|
|
|
{
|
|
|
|
return GFootprintTable.GetCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary( LIB_TREE_NODE_LIB& aLibNode )
|
|
|
|
{
|
2020-02-07 17:06:24 +00:00
|
|
|
std::vector<LIB_TREE_ITEM*> footprints = getFootprints( aLibNode.m_Name );
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2018-08-05 11:56:02 +00:00
|
|
|
// remove the common part from the footprints list
|
2020-02-07 17:06:24 +00:00
|
|
|
for( auto nodeIt = aLibNode.m_Children.begin(); nodeIt != aLibNode.m_Children.end(); )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
2018-07-30 13:18:37 +00:00
|
|
|
// Since the list is sorted we can use a binary search to speed up searches within
|
|
|
|
// libraries with lots of footprints.
|
2020-02-07 17:06:24 +00:00
|
|
|
FOOTPRINT_INFO_IMPL dummy( wxEmptyString, (*nodeIt)->m_Name );
|
2018-07-30 13:18:37 +00:00
|
|
|
auto footprintIt = std::lower_bound( footprints.begin(), footprints.end(), &dummy,
|
2022-01-22 11:56:52 +00:00
|
|
|
[]( LIB_TREE_ITEM* a, LIB_TREE_ITEM* b )
|
|
|
|
{
|
|
|
|
return StrNumCmp( a->GetName(), b->GetName(), false ) < 0;
|
|
|
|
} );
|
2018-07-30 13:18:37 +00:00
|
|
|
|
|
|
|
if( footprintIt != footprints.end() && dummy.GetName() == (*footprintIt)->GetName() )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
2018-07-30 13:18:37 +00:00
|
|
|
// footprint exists both in the lib tree and the footprint info list; just
|
|
|
|
// update the node data
|
2018-07-29 15:33:58 +00:00
|
|
|
static_cast<LIB_TREE_NODE_LIB_ID*>( nodeIt->get() )->Update( *footprintIt );
|
|
|
|
footprints.erase( footprintIt );
|
|
|
|
++nodeIt;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// node does not exist in the library manager, remove the corresponding node
|
2020-02-07 17:06:24 +00:00
|
|
|
nodeIt = aLibNode.m_Children.erase( nodeIt );
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-05 11:56:02 +00:00
|
|
|
// now the footprint list contains only new aliases that need to be added to the tree
|
2022-01-22 11:56:52 +00:00
|
|
|
for( LIB_TREE_ITEM* footprint : footprints )
|
2018-07-30 13:18:37 +00:00
|
|
|
aLibNode.AddItem( footprint );
|
2018-07-29 15:33:58 +00:00
|
|
|
|
|
|
|
aLibNode.AssignIntrinsicRanks();
|
2020-02-07 17:06:24 +00:00
|
|
|
m_libMap.insert( aLibNode.m_Name );
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-01-22 11:56:52 +00:00
|
|
|
LIB_TREE_NODE::PTR_VECTOR::iterator
|
|
|
|
FP_TREE_SYNCHRONIZING_ADAPTER::deleteLibrary( LIB_TREE_NODE::PTR_VECTOR::iterator& aLibNodeIt )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
|
|
|
LIB_TREE_NODE* node = aLibNodeIt->get();
|
2020-02-07 17:06:24 +00:00
|
|
|
m_libMap.erase( node->m_Name );
|
|
|
|
auto it = m_tree.m_Children.erase( aLibNodeIt );
|
2018-07-29 15:33:58 +00:00
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-06-04 19:51:28 +00:00
|
|
|
wxDataViewItem FP_TREE_SYNCHRONIZING_ADAPTER::GetCurrentDataViewItem()
|
|
|
|
{
|
|
|
|
return FindItem( m_frame->GetLoadedFPID() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-29 15:33:58 +00:00
|
|
|
void FP_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
|
|
|
|
unsigned int aCol ) const
|
|
|
|
{
|
|
|
|
if( IsFrozen() )
|
|
|
|
{
|
|
|
|
aVariant = wxEmptyString;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-01-22 11:56:52 +00:00
|
|
|
LIB_TREE_NODE* node = ToNode( aItem );
|
2018-07-29 15:33:58 +00:00
|
|
|
|
|
|
|
switch( aCol )
|
|
|
|
{
|
2022-07-28 13:51:13 +00:00
|
|
|
case NAME_COL:
|
2023-10-14 22:00:02 +00:00
|
|
|
{
|
2020-02-07 17:06:24 +00:00
|
|
|
if( node->m_LibId == m_frame->GetLoadedFPID() && !m_frame->IsCurrentFPFromBoard() )
|
2018-09-13 23:39:40 +00:00
|
|
|
{
|
2022-04-21 10:57:15 +00:00
|
|
|
// Do not use GetLoadedFPID(); it returns m_footprintNameWhenLoaded.
|
2023-09-14 15:35:19 +00:00
|
|
|
node->m_Name =
|
|
|
|
m_frame->GetBoard()->GetFirstFootprint()->GetFPID().GetUniStringLibItemName();
|
2018-09-13 23:39:40 +00:00
|
|
|
|
2019-06-24 12:00:21 +00:00
|
|
|
// mark modified part with an asterisk
|
2021-05-28 19:07:04 +00:00
|
|
|
if( m_frame->GetScreen()->IsContentModified() )
|
2022-02-04 22:44:59 +00:00
|
|
|
aVariant = node->m_Name + wxT( " *" );
|
2018-09-13 23:39:40 +00:00
|
|
|
else
|
2020-03-31 01:09:01 +00:00
|
|
|
aVariant = node->m_Name;
|
2018-09-13 23:39:40 +00:00
|
|
|
}
|
2020-02-07 17:06:24 +00:00
|
|
|
else if( node->m_Pinned )
|
2022-01-22 11:56:52 +00:00
|
|
|
{
|
2020-02-16 09:21:36 +00:00
|
|
|
aVariant = GetPinningSymbol() + node->m_Name;
|
2022-01-22 11:56:52 +00:00
|
|
|
}
|
2018-07-29 15:33:58 +00:00
|
|
|
else
|
2022-01-22 11:56:52 +00:00
|
|
|
{
|
2020-02-07 17:06:24 +00:00
|
|
|
aVariant = node->m_Name;
|
2022-01-22 11:56:52 +00:00
|
|
|
}
|
|
|
|
|
2018-07-29 15:33:58 +00:00
|
|
|
break;
|
2023-10-14 22:00:02 +00:00
|
|
|
}
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2022-07-28 13:51:13 +00:00
|
|
|
case DESC_COL:
|
2023-10-14 22:00:02 +00:00
|
|
|
{
|
2020-03-31 01:09:01 +00:00
|
|
|
if( node->m_LibId == m_frame->GetLoadedFPID() && !m_frame->IsCurrentFPFromBoard() )
|
2021-03-17 14:53:27 +00:00
|
|
|
{
|
2023-06-19 17:08:18 +00:00
|
|
|
node->m_Desc = m_frame->GetBoard()->GetFirstFootprint()->GetLibDescription();
|
2021-03-17 14:53:27 +00:00
|
|
|
}
|
|
|
|
else if( node->m_Type == LIB_TREE_NODE::LIB )
|
|
|
|
{
|
2021-03-21 15:43:24 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
const FP_LIB_TABLE_ROW* lib =
|
|
|
|
GFootprintTable.FindRow( node->m_LibId.GetLibNickname() );
|
2021-03-17 14:53:27 +00:00
|
|
|
|
2021-03-21 15:43:24 +00:00
|
|
|
if( lib )
|
|
|
|
node->m_Desc = lib->GetDescr();
|
|
|
|
}
|
|
|
|
catch( IO_ERROR& )
|
|
|
|
{
|
|
|
|
}
|
2021-03-17 14:53:27 +00:00
|
|
|
}
|
2020-03-31 01:09:01 +00:00
|
|
|
|
2023-10-14 22:00:02 +00:00
|
|
|
wxString descStr = UnescapeString( node->m_Desc );
|
|
|
|
descStr.Replace( wxS( "\n" ), wxS( " " ) ); // Clear line breaks
|
|
|
|
|
|
|
|
aVariant = descStr;
|
2018-07-29 15:33:58 +00:00
|
|
|
break;
|
2023-10-14 22:00:02 +00:00
|
|
|
}
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2023-10-14 22:00:02 +00:00
|
|
|
default: // column == -1 is used for default Compare function
|
2020-02-07 17:06:24 +00:00
|
|
|
aVariant = node->m_Name;
|
2018-07-29 15:33:58 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, unsigned int aCol,
|
|
|
|
wxDataViewItemAttr& aAttr ) const
|
|
|
|
{
|
|
|
|
if( IsFrozen() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// change attributes only for the name field
|
|
|
|
if( aCol != 0 )
|
|
|
|
return false;
|
|
|
|
|
2018-09-13 15:39:14 +00:00
|
|
|
// don't link to a board footprint, even if the FPIDs match
|
|
|
|
if( m_frame->IsCurrentFPFromBoard() )
|
|
|
|
return false;
|
|
|
|
|
2022-01-22 11:56:52 +00:00
|
|
|
LIB_TREE_NODE* node = ToNode( aItem );
|
2018-07-29 15:33:58 +00:00
|
|
|
wxCHECK( node, false );
|
|
|
|
|
2020-02-07 17:06:24 +00:00
|
|
|
switch( node->m_Type )
|
2018-07-29 15:33:58 +00:00
|
|
|
{
|
2019-06-24 12:00:21 +00:00
|
|
|
case LIB_TREE_NODE::LIB:
|
2020-02-07 17:06:24 +00:00
|
|
|
if( node->m_Name == m_frame->GetLoadedFPID().GetLibNickname() )
|
2019-06-24 12:00:21 +00:00
|
|
|
{
|
2018-08-25 15:12:08 +00:00
|
|
|
#ifdef __WXGTK__
|
2019-06-24 12:00:21 +00:00
|
|
|
// The native wxGTK+ impl ignores background colour, so set the text colour
|
|
|
|
// instead. Works reasonably well in dark themes, less well in light ones....
|
|
|
|
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
2018-07-29 15:33:58 +00:00
|
|
|
#else
|
2019-06-24 12:00:21 +00:00
|
|
|
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
2019-07-18 12:54:52 +00:00
|
|
|
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
2018-08-25 15:12:08 +00:00
|
|
|
#endif
|
|
|
|
|
2019-06-24 12:00:21 +00:00
|
|
|
// mark modified libs with bold font
|
2021-05-28 19:07:04 +00:00
|
|
|
if( m_frame->GetScreen()->IsContentModified() && !m_frame->IsCurrentFPFromBoard() )
|
2019-06-24 12:00:21 +00:00
|
|
|
aAttr.SetBold( true );
|
|
|
|
}
|
|
|
|
break;
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2019-06-24 12:00:21 +00:00
|
|
|
case LIB_TREE_NODE::LIBID:
|
2020-02-07 17:06:24 +00:00
|
|
|
if( node->m_LibId == m_frame->GetLoadedFPID() )
|
2019-06-24 12:00:21 +00:00
|
|
|
{
|
2018-08-25 15:12:08 +00:00
|
|
|
#ifdef __WXGTK__
|
2019-06-24 12:00:21 +00:00
|
|
|
// The native wxGTK+ impl ignores background colour, so set the text colour
|
|
|
|
// instead. Works reasonably well in dark themes, less well in light ones....
|
|
|
|
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
2018-07-29 15:33:58 +00:00
|
|
|
#else
|
2019-06-24 12:00:21 +00:00
|
|
|
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
2019-07-18 12:54:52 +00:00
|
|
|
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
2018-08-25 15:12:08 +00:00
|
|
|
#endif
|
|
|
|
|
2019-06-24 12:00:21 +00:00
|
|
|
// mark modified part with bold font
|
2021-05-28 19:07:04 +00:00
|
|
|
if( m_frame->GetScreen()->IsContentModified() && !m_frame->IsCurrentFPFromBoard() )
|
2019-06-24 12:00:21 +00:00
|
|
|
aAttr.SetBold( true );
|
|
|
|
}
|
|
|
|
break;
|
2018-07-29 15:33:58 +00:00
|
|
|
|
2019-06-24 12:00:21 +00:00
|
|
|
default:
|
|
|
|
return false;
|
2018-07-29 15:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-09-02 21:13:48 +00:00
|
|
|
bool FP_TREE_SYNCHRONIZING_ADAPTER::HasPreview( const wxDataViewItem& aItem )
|
|
|
|
{
|
|
|
|
LIB_TREE_NODE* node = ToNode( aItem );
|
|
|
|
wxCHECK( node, false );
|
|
|
|
|
2023-09-03 11:07:09 +00:00
|
|
|
return node->m_Type == LIB_TREE_NODE::LIBID && node->m_LibId != m_frame->GetLoadedFPID();
|
2023-09-02 21:13:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FP_TREE_SYNCHRONIZING_ADAPTER::ShowPreview( wxWindow* aParent, const wxDataViewItem& aItem )
|
|
|
|
{
|
|
|
|
LIB_TREE_NODE* node = ToNode( aItem );
|
|
|
|
wxCHECK( node, /* void */ );
|
|
|
|
|
|
|
|
wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
aParent->SetSizer( mainSizer );
|
|
|
|
|
|
|
|
FOOTPRINT_PREVIEW_PANEL* preview = FOOTPRINT_PREVIEW_PANEL::New( &m_frame->Kiway(), aParent,
|
|
|
|
m_frame );
|
|
|
|
preview->GetGAL()->SetAxesEnabled( false );
|
|
|
|
|
|
|
|
mainSizer->Add( preview, 1, wxEXPAND|wxALL, 1 );
|
|
|
|
aParent->Layout();
|
|
|
|
|
|
|
|
preview->DisplayFootprint( node->m_LibId );
|
|
|
|
}
|