30#include <wx/splitter.h>
46 const wxArrayString& aFootprintHistoryList,
48 std::function<
void()> aCloseHandler ) :
49 wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ),
50 m_hsplitter( nullptr ),
51 m_vsplitter( nullptr ),
53 m_filter(
std::
move( aFilter ) ),
54 m_closeHandler(
std::
move( aCloseHandler ) )
60 _(
"Loading Footprint Libraries" ), 3 );
68 delete progressReporter;
76 std::vector<LIB_TREE_ITEM*> historyInfos;
78 for(
const wxString& item : aFootprintHistoryList )
83 if( fp_info !=
nullptr )
84 historyInfos.push_back( fp_info );
87 adapter->
DoAddLibrary( wxT(
"-- " ) +
_(
"Recently Used" ) + wxT(
" --" ), wxEmptyString,
88 historyInfos,
false, true );
90 if( historyInfos.size() )
100 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
103 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
104 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
107 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
114 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
115 detailsPanel->SetSizer( detailsSizer );
117 details =
new HTML_WINDOW( detailsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize );
118 detailsSizer->Add( details, 1, wxEXPAND, 5 );
119 detailsPanel->Layout();
120 detailsSizer->Fit( detailsPanel );
135 wxBoxSizer* rightPanelSizer =
new wxBoxSizer( wxVERTICAL );
141 rightPanel->SetSizer( rightPanelSizer );
142 rightPanel->Layout();
143 rightPanelSizer->Fit( rightPanel );
176 catch(
const std::runtime_error& e )
178 wxFAIL_MSG( e.what() );
202 auto horizPixelsFromDU =
206 return GetParent()->ConvertDialogToPixels( sz ).x;
211 int w = cfg.
width < 40 ? horizPixelsFromDU( 440 ) : cfg.
width;
212 int h = cfg.
height < 40 ? horizPixelsFromDU( 340 ) : cfg.
height;
214 GetParent()->SetSize( wxSize( w, h ) );
215 GetParent()->Layout();
220 cfg.
sash_h = horizPixelsFromDU( 220 );
225 cfg.
sash_v = horizPixelsFromDU( 230 );
237 m_adapter->SetPreselectNode( aPreselect, 0 );
252 auto state = wxGetMouseState();
254 if( state.LeftIsDown() )
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(EDA_BASE_FRAME *aParent, LIB_TABLE *aLibs)
Factory function: create a model adapter in a reference-counting container.
void AddLibraries(EDA_BASE_FRAME *aParent)
Add dark theme support to wxHtmlWindow.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
void SetPreselectNode(const LIB_ID &aLibId, int aUnit)
Set the symbol name to be selected if there are no search results.
void DoAddLibrary(const wxString &aNodeName, const wxString &aDesc, const std::vector< LIB_TREE_ITEM * > &aItemList, bool pinned, bool presorted)
Add the given list of symbols by alias.
void SetFilter(std::function< bool(LIB_TREE_NODE &aNode)> *aFilter)
Set the symbol filter type.
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
Widget displaying a tree of symbols with optional search text control and description panel....
LIB_TREE_MODEL_ADAPTER::SORT_MODE GetSortMode() const
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit symbols, if the user selects the symbol itself rather than picking an individual unit,...
FOOTPRINT_CHOOSER m_FootprintChooser
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
EDA_UNITS GetUserUnits() const
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
SETTINGS_MANAGER * GetSettingsManager()
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.