55 const wxArrayString& aFootprintHistoryList,
57 std::function<
void()> aAcceptHandler,
58 std::function<
void()> aEscapeHandler ) :
59 wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ),
73 GFootprintList.ReadFootprintFiles( footprints,
nullptr, progressReporter );
80 delete progressReporter;
86 statusBar->SetLoadWarningMessages(
GFootprintList.GetErrorMessages() );
92 std::vector<LIB_TREE_ITEM*> historyInfos;
94 for(
const wxString& item : aFootprintHistoryList )
99 if( fp_info !=
nullptr )
100 historyInfos.push_back( fp_info );
103 adapter->
DoAddLibrary( wxT(
"-- " ) +
_(
"Recently Used" ) + wxT(
" --" ), wxEmptyString,
104 historyInfos,
false,
true )
107 if( historyInfos.size() )
117 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
119 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
120 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
123 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
130 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
134 detailsSizer->Add(
m_details, 1, wxEXPAND, 5 );
183 Bind( wxEVT_CHAR_HOOK,
184 [&]( wxKeyEvent& aEvent )
186 if( aEvent.GetKeyCode() == WXK_ESCAPE )
188 wxObject* eventSource = aEvent.GetEventObject();
190 if( wxTextCtrl* textCtrl =
dynamic_cast<wxTextCtrl*
>( eventSource ) )
193 if( textCtrl->GetValue() ==
m_tree->GetSearchString()
194 && !
m_tree->GetSearchString().IsEmpty() )
196 m_tree->SetSearchString( wxEmptyString );
208 aEvent.DoAllowNextEvent();
245 cfg->m_FootprintChooser.width = GetParent()->GetSize().x;
246 cfg->m_FootprintChooser.height = GetParent()->GetSize().y;
247 cfg->m_FootprintChooser.sash_h =
m_hsplitter->GetSashPosition();
250 cfg->m_FootprintChooser.sash_v =
m_vsplitter->GetSashPosition();
252 cfg->m_FootprintChooser.sort_mode =
m_tree->GetSortMode();
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
LIB_TREE_NODE_LIBRARY & 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.