34 std::vector<std::pair<PCB_LAYER_ID, PCB_LAYER_ID>>
m_layers;
48 case 0:
return _(
"Move items on:" );
49 case 1:
return _(
"To layer:" );
50 default:
return wxEmptyString;
54 wxString
GetValue(
int row,
int col )
override {
return "undefined"; }
55 void SetValue(
int row,
int col,
const wxString& value )
override { }
62 if( col < 0 || col >= 2 )
70 if( row < 0 || col < 0 || col >= 2 )
86 std::map<PCB_LAYER_ID, PCB_LAYER_ID>& aLayerMap ) :
89 m_layerMap( aLayerMap )
94 m_grid->SetDefaultRowSize(
m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
95 m_grid->SetCellHighlightROPenWidth( 0 );
96 m_grid->SetUseNativeColLabels();
115 LSEQ enabledCopperLayerUIList = enabledCopperLayers.
UIOrder();
119 auto attr =
new wxGridCellAttr;
121 attr->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
123 m_grid->SetAttr( row, 0, attr );
125 attr =
new wxGridCellAttr;
128 m_grid->SetAttr( row, 1, attr );
129 m_grid->GetTable()->SetValueAsLong( row, 0, (
long) layer );
130 m_grid->GetTable()->SetValueAsLong( row, 1, (
long) layer );
145 wxGridTableBase* table =
m_grid->GetTable();
148 LSEQ enabledCopperLayerUIList = enabledCopperLayers.
UIOrder();
152 int dest = table->GetValueAsLong( row++, 1 );
167 m_grid->SetColSize( 0, std::max( FromDIP( 40 ), width / 2 ) );
168 m_grid->SetColSize( 1, std::max( FromDIP( 40 ), width -
m_grid->GetColSize( 0 ) ) );
int GetCopperLayerCount() const
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...
Class DIALOG_SWAP_LAYERS_BASE.
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
std::map< PCB_LAYER_ID, PCB_LAYER_ID > & m_layerMap
PCB_BASE_EDIT_FRAME * m_parent
DIALOG_SWAP_LAYERS(PCB_BASE_EDIT_FRAME *aParent, std::map< PCB_LAYER_ID, PCB_LAYER_ID > &aArray)
void OnSize(wxSizeEvent &event) override
LAYER_GRID_TABLE * m_gridTable
~DIALOG_SWAP_LAYERS() override
void SetValue(int row, int col, const wxString &value) override
void SetValueAsLong(int row, int col, long value) override
int GetNumberRows() override
std::vector< std::pair< PCB_LAYER_ID, PCB_LAYER_ID > > m_layers
wxString GetValue(int row, int col) override
LAYER_GRID_TABLE(int layerCount)
wxString GetColLabelValue(int aCol) override
int GetNumberCols() override
long GetValueAsLong(int row, int col) override
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Returns the copper, technical and user layers in the order shown in layer widget.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Common, abstract interface for edit frames.
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)