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 { }
70 std::map<PCB_LAYER_ID, PCB_LAYER_ID>& aLayerMap ) :
73 m_layerMap( aLayerMap )
78 m_grid->SetDefaultRowSize(
m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
79 m_grid->SetCellHighlightROPenWidth( 0 );
80 m_grid->SetUseNativeColLabels();
101 if( enabledCopperLayers.
test( layer ) )
103 auto attr =
new wxGridCellAttr;
105 attr->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
107 m_grid->SetAttr( row, 0, attr );
109 attr =
new wxGridCellAttr;
112 m_grid->SetAttr( row, 1, attr );
114 m_grid->GetTable()->SetValueAsLong( row, 0, (
long) layer );
115 m_grid->GetTable()->SetValueAsLong( row, 1, (
long) layer );
131 wxGridTableBase* table =
m_grid->GetTable();
136 if( enabledCopperLayers.
test( layer ) )
138 int dest = table->GetValueAsLong( row++, 1 );
154 m_grid->SetColSize( 0, std::max( FromDIP( 40 ), width / 2 ) );
155 m_grid->SetColSize( 1, std::max( FromDIP( 40 ), width -
m_grid->GetColSize( 0 ) ) );
bool test(size_t pos) const
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
int m_layers[MAX_CU_LAYERS][2]
void SetValueAsLong(int row, int col, long value) override
int GetNumberRows() override
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
LSET is a set of PCB_LAYER_IDs.
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 ToLAYER_ID(int aLayer)