52 const wxArrayString& aFootprintHistoryList,
54 std::function<
void()> aAcceptHandler,
55 std::function<
void()> aEscapeHandler ) :
56 wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ),
75 std::vector<LIB_TREE_ITEM*> historyInfos;
77 for(
const wxString& item : aFootprintHistoryList )
81 if( fpid.
Parse( item ) >= 0 )
88 historyInfos.push_back( fp );
93 adapter->
DoAddLibrary( wxT(
"-- " ) +
_(
"Recently Used" ) + wxT(
" --" ), wxEmptyString,
94 historyInfos,
false,
true )
97 if( historyInfos.size() )
107 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
109 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
110 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
113 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
120 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
124 detailsSizer->Add(
m_details, 1, wxEXPAND, 5 );
204 cfg->m_FootprintChooser.width = GetParent()->ToDIP( GetParent()->GetSize().x );
205 cfg->m_FootprintChooser.height = GetParent()->ToDIP( GetParent()->GetSize().y );
206 cfg->m_FootprintChooser.sash_h =
m_hsplitter->GetSashPosition();
209 cfg->m_FootprintChooser.sash_v =
m_vsplitter->GetSashPosition();
211 cfg->m_FootprintChooser.sort_mode =
m_tree->GetSortMode();
255 auto horizPixelsFromDU =
259 return GetParent()->ConvertDialogToPixels( sz ).x;
267 int w = cfg.
width > 40 ? GetParent()->FromDIP( cfg.
width ) : horizPixelsFromDU( 440 );
268 int h = cfg.
height > 40 ? GetParent()->FromDIP( cfg.
height ) : horizPixelsFromDU( 340 );
271 if(
int display = wxDisplay::GetFromWindow( GetParent() ); display != wxNOT_FOUND )
273 wxRect workArea = wxDisplay( display ).GetClientArea();
274 w = std::min( w, workArea.GetWidth() );
275 h = std::min( h, workArea.GetHeight() );
278 GetParent()->SetSize( wxSize( w, h ) );
279 GetParent()->Layout();
284 cfg.
sash_h = horizPixelsFromDU( 220 );
289 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.