54 const wxArrayString& aFootprintHistoryList,
56 std::function<
void()> aAcceptHandler,
57 std::function<
void()> aEscapeHandler ) :
58 wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ),
72 GFootprintList.ReadFootprintFiles( fpTable,
nullptr, progressReporter );
79 delete progressReporter;
87 std::vector<LIB_TREE_ITEM*> historyInfos;
89 for(
const wxString& item : aFootprintHistoryList )
94 if( fp_info !=
nullptr )
95 historyInfos.push_back( fp_info );
98 adapter->
DoAddLibrary( wxT(
"-- " ) +
_(
"Recently Used" ) + wxT(
" --" ), wxEmptyString,
99 historyInfos,
false,
true )
102 if( historyInfos.size() )
112 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
114 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
115 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
118 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
125 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
129 detailsSizer->Add(
m_details, 1, wxEXPAND, 5 );
177 Bind( wxEVT_CHAR_HOOK,
178 [&]( wxKeyEvent& aEvent )
180 if( aEvent.GetKeyCode() == WXK_ESCAPE )
182 wxObject* eventSource = aEvent.GetEventObject();
184 if( wxTextCtrl* textCtrl =
dynamic_cast<wxTextCtrl*
>( eventSource ) )
187 if( textCtrl->GetValue() ==
m_tree->GetSearchString()
188 && !
m_tree->GetSearchString().IsEmpty() )
190 m_tree->SetSearchString( wxEmptyString );
202 aEvent.DoAllowNextEvent();
239 cfg->m_FootprintChooser.width = GetParent()->GetSize().x;
240 cfg->m_FootprintChooser.height = GetParent()->GetSize().y;
241 cfg->m_FootprintChooser.sash_h =
m_hsplitter->GetSashPosition();
244 cfg->m_FootprintChooser.sash_v =
m_vsplitter->GetSashPosition();
246 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.