31    return aLayerName + wxT( 
" *" );
 
 
   37    if( !aLayerName.EndsWith( wxT( 
" *" ) ) )
 
   40    return aLayerName.Left( aLayerName.Length() - 2 );
 
 
   50        if( layerDescription.Name == layerName )
 
   51            return &layerDescription;
 
 
   61    wxString selectedKiCadLayerName;
 
   65                                                        wxLIST_STATE_SELECTED ) ) != wxNOT_FOUND )
 
   76                                                      wxLIST_STATE_SELECTED ) ) == wxNOT_FOUND,
 
   77                  wxT( 
"There are more than one KiCad layer selected (unexpected)" ) );
 
 
   95        if( inputLayerDesc.Name == pureInputLayerName
 
   98            return inputLayerDesc.AutoMapLayer;
 
 
  115    wxArrayInt rowsToDelete;
 
  118                                                               wxLIST_STATE_SELECTED ) )
 
  122        wxString kiName            = 
LayerName( selectedKiCadLayerID );
 
  135            if( *iter == selectedLayerName )
 
  142        rowsToDelete.Add( itemIndex );
 
 
  154    wxArrayInt rowsToDelete;
 
  157    while( ( itemIndex = 
m_matched_layers_list->GetNextItem( itemIndex, wxLIST_NEXT_ALL, aStatus ) ) != wxNOT_FOUND )
 
  160        wxString pureSelectedLayerName = 
UnwrapRequired( selectedLayerName );
 
  166        rowsToDelete.Add( itemIndex );
 
 
  178    for( 
long n = (
long) aRowsToDelete.GetCount() - 1; 0 <= n; n-- )
 
  179        aListCtrl->DeleteItem( aRowsToDelete[n] );
 
 
  187    wxArrayInt rowsToDelete;
 
  190                                                               wxLIST_STATE_DONTCARE ) ) != wxNOT_FOUND )
 
  198        wxString kiName = 
LayerName( autoMatchLayer );
 
  209            if( *iter == layerName )
 
  216        rowsToDelete.Add( itemIndex );
 
 
  232        wxString layerName = inLayer.Required ? 
WrapRequired( inLayer.Name ) : inLayer.Name;
 
  234        kiCadLayers |= inLayer.PermittedLayers;
 
  237    int maxTextWidth = GetTextExtent( 
_( 
"Imported Layer" ) ).x;
 
  240        maxTextWidth = std::max( maxTextWidth, GetTextExtent( layer.Name ).x );
 
  243    wxListItem importedLayersHeader;
 
  244    importedLayersHeader.SetId( 0 );
 
  245    importedLayersHeader.SetText( 
_( 
"Imported Layer" ) );
 
  246    importedLayersHeader.SetWidth( maxTextWidth + 15 );
 
  249    int kicadMaxTextWidth = GetTextExtent( wxT( 
"User.Drawings" ) ).x;
 
  251    wxListItem kicadLayersHeader;
 
  252    kicadLayersHeader.SetId( 0 );
 
  253    kicadLayersHeader.SetText( 
_( 
"KiCad Layer" ) );
 
  254    kicadLayersHeader.SetWidth( kicadMaxTextWidth + 5 );
 
  257    kicadLayersHeader.SetId( 1 );
 
  258    importedLayersHeader.SetWidth( maxTextWidth + 15 );
 
  259    kicadLayersHeader.SetWidth( kicadMaxTextWidth + 5 );
 
  270        item.SetText( importedLayerName );
 
  288        item.SetText( kiName );
 
 
  305    std::vector<wxString> unmappedLayers;
 
  310        wxASSERT_MSG( layerDesc != 
nullptr, wxT( 
"Expected to find layer description" ) );
 
  313            unmappedLayers.push_back( layerDesc->
Name );
 
  316    return unmappedLayers;
 
 
  320std::map<wxString, PCB_LAYER_ID>
 
  332            wxMessageBox( 
_( 
"All required layers (marked with '*') must be matched. Please click " 
  333                             "'Auto-Match Layers' to automatically match the remaining layers" ),
 
  334                          _( 
"Unmatched Layers" ), wxICON_ERROR | wxOK );
 
 
wxListCtrl * m_matched_layers_list
 
DIALOG_IMPORTED_LAYERS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Edit Mapping of Imported Layers"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
wxListCtrl * m_unmatched_layers_list
 
wxListCtrl * m_kicad_layers_list
 
std::vector< wxString > GetUnmappedRequiredLayers() const
Return a list of layers names that are required, but they are not mapped.
 
const INPUT_LAYER_DESC * GetLayerDescription(const wxString &aLayerName) const
 
void RemoveMappings(int aStatus)
 
void OnAutoMatchLayersClicked(wxCommandEvent &event) override
 
std::vector< INPUT_LAYER_DESC > m_input_layers
 
std::vector< wxString > m_unmatched_layer_names
 
static wxString UnwrapRequired(const wxString &aLayerName)
 
std::map< wxString, PCB_LAYER_ID > m_matched_layers_map
 
PCB_LAYER_ID GetSelectedLayerID()
 
static std::map< wxString, PCB_LAYER_ID > RunModal(wxWindow *aParent, const std::vector< INPUT_LAYER_DESC > &aLayerDesc)
Create and show a dialog (modal) and returns the data from it after completion.
 
DIALOG_MAP_LAYERS(wxWindow *aParent, const std::vector< INPUT_LAYER_DESC > &aLayerDesc)
 
PCB_LAYER_ID GetAutoMatchLayerID(const wxString &aInputLayerName)
 
static wxString WrapRequired(const wxString &aLayerName)
 
void DeleteListItems(const wxArrayInt &aRowsToDelete, wxListCtrl *aListCtrl)
 
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...
 
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
 
LSET is a set of PCB_LAYER_IDs.
 
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
 
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
 
PCB_LAYER_ID
A quick note on layer IDs:
 
PCB_LAYER_ID ToLAYER_ID(int aLayer)