52 const wxArrayString& aFootprintHistoryList,
54 std::function<
void()> aAcceptHandler,
55 std::function<
void()> aEscapeHandler ) :
56 wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ),
76 std::vector<LIB_TREE_ITEM*> historyInfos;
78 for(
const wxString& item : aFootprintHistoryList )
82 if( fpid.
Parse( item ) >= 0 )
89 historyInfos.push_back( fp );
94 adapter->
DoAddLibrary( wxT(
"-- " ) +
_(
"Recently Used" ) + wxT(
" --" ), wxEmptyString,
95 historyInfos,
false,
true )
98 if( historyInfos.size() )
108 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
110 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
111 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
114 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
121 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
125 detailsSizer->Add(
m_details, 1, wxEXPAND, 5 );
205 cfg->m_FootprintChooser.width = GetParent()->ToDIP( GetParent()->GetSize().x );
206 cfg->m_FootprintChooser.height = GetParent()->ToDIP( GetParent()->GetSize().y );
207 cfg->m_FootprintChooser.sash_h =
m_hsplitter->GetSashPosition();
210 cfg->m_FootprintChooser.sash_v =
m_vsplitter->GetSashPosition();
212 cfg->m_FootprintChooser.sort_mode =
m_tree->GetSortMode();
256 auto horizPixelsFromDU =
260 return GetParent()->ConvertDialogToPixels( sz ).x;
268 int w = cfg.
width > 40 ? GetParent()->FromDIP( cfg.
width ) : horizPixelsFromDU( 440 );
269 int h = cfg.
height > 40 ? GetParent()->FromDIP( cfg.
height ) : horizPixelsFromDU( 340 );
272 if(
int display = wxDisplay::GetFromWindow( GetParent() ); display != wxNOT_FOUND )
274 wxRect workArea = wxDisplay( display ).GetClientArea();
275 w = std::min( w, workArea.GetWidth() );
276 h = std::min( h, workArea.GetHeight() );
279 GetParent()->SetSize( wxSize( w, h ) );
280 GetParent()->Layout();
285 cfg.
sash_h = horizPixelsFromDU( 220 );
290 cfg.
sash_v = horizPixelsFromDU( 230 );
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.