23#include <wx/listctrl.h>
27 const std::vector<IMPORT_PROJECT_DESC>& aProjectDesc ) :
33 int comboNameColId =
m_listCtrl->AppendColumn(
_(
"Project Name" ) );
34 int pcbNameColId =
m_listCtrl->AppendColumn(
_(
"PCB" ) );
35 int schNameColId =
m_listCtrl->AppendColumn(
_(
"Schematic" ) );
40 auto convertName = [](
const wxString& aName,
const wxString& aId ) -> wxString
50 m_listCtrl->InsertItem( row, convertName( desc.ComboName, desc.ComboId ) );
51 m_listCtrl->SetItem( row, pcbNameColId, convertName( desc.PCBName, desc.PCBId ) );
52 m_listCtrl->SetItem( row, schNameColId, convertName( desc.SchematicName, desc.SchematicId ) );
58 m_listCtrl->SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
60 m_listCtrl->SetColumnWidth( comboNameColId, wxLIST_AUTOSIZE_USEHEADER );
61 m_listCtrl->SetColumnWidth( pcbNameColId, wxLIST_AUTOSIZE_USEHEADER );
62 m_listCtrl->SetColumnWidth( schNameColId, wxLIST_AUTOSIZE_USEHEADER );
79 EndModal( wxID_CANCEL );
85 std::vector<IMPORT_PROJECT_DESC> result;
91 selected =
m_listCtrl->GetNextItem( selected, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
96 }
while( selected != -1 );
102std::vector<IMPORT_PROJECT_DESC>
104 const std::vector<IMPORT_PROJECT_DESC>& aProjectDesc )
Class DIALOG_IMPORT_CHOOSE_PROJECT_BASE.
void onItemActivated(wxListEvent &event) override
static std::vector< IMPORT_PROJECT_DESC > RunModal(wxWindow *aParent, const std::vector< IMPORT_PROJECT_DESC > &aProjectDesc)
Create and show a dialog (modal) and returns the data from it after completion.
void onClose(wxCloseEvent &event) override
DIALOG_IMPORT_CHOOSE_PROJECT(wxWindow *aParent, const std::vector< IMPORT_PROJECT_DESC > &aProjectDesc)
std::vector< IMPORT_PROJECT_DESC > GetProjects()
std::vector< IMPORT_PROJECT_DESC > m_project_desc
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Describes how non-KiCad boards and schematics should be imported as KiCad projects.