22#include <wx/textdlg.h>
39 m_grid->SetColLabelValue( 0,
_(
"Name" ) );
40 m_grid->SetColLabelValue( 1,
_(
"Type" ) );
41 m_grid->SetColLabelValue( 2,
_(
"Layers" ) );
42 m_grid->SetColLabelValue( 3,
_(
"Diameter / Hole" ) );
43 m_grid->SetColLabelValue( 4,
_(
"Fill" ) );
44 m_grid->SetColLabelValue( 5,
_(
"Pitch" ) );
46 m_grid->EnableEditing(
true );
59 if(
m_grid->GetNumberRows() > 0 )
64 for(
int row = 0; row < (int)
m_presets.size(); ++row )
72 m_grid->SetCellValue( row, 2,
75 m_grid->SetCellValue( row, 3,
84 for(
int col = 1; col < 6; ++col )
85 m_grid->SetReadOnly( row, col );
117 wxTextEntryDialog nameDlg(
this,
_(
"Preset name:" ),
_(
"New Microvia Stack Preset" ),
name );
119 if( nameDlg.ShowModal() != wxID_OK )
122 name = nameDlg.GetValue();
123 name.Trim(
true ).Trim(
false );
149 for(
int row = 0; row < (int)
m_presets.size(); ++row )
151 if( row != aIgnoreRow &&
m_presets[row].m_Name.CmpNoCase( aName ) == 0 )
161 int row = aEvent.GetRow();
163 if( aEvent.GetCol() != 0 || row < 0 || row >= (
int)
m_presets.size() )
166 wxString
name =
m_grid->GetCellValue( row, 0 );
167 name.Trim(
true ).Trim(
false );
171 if( !
name.IsEmpty() )
188 if( !
m_grid->CommitPendingChanges() )
191 int row =
m_grid->GetGridCursorRow();
193 if( row < 0 || row >= (
int)
m_presets.size() )
203 if( !
m_grid->CommitPendingChanges() )
206 int row =
m_grid->GetGridCursorRow();
208 if( row < 0 || row >= (
int)
m_presets.size() )
222 if( active >= 0 && active < (
int)
m_presets.size() )
246 if( !
m_grid->CommitPendingChanges() )
256 for(
int row = 0; row < (int)
m_presets.size(); ++row )
Container for design settings for a BOARD object.
void SetViaStackIndex(int aIndex)
Set the current via stack preset index to aIndex.
int GetViaStackIndex() const
std::vector< VIA_STACK_PRESET > m_ViaStackPresets
Information pertinent to a Pcbnew printed circuit board.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
PANEL_SETUP_VIA_STACKS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxButton * m_removeButton
PANEL_SETUP_VIA_STACKS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
void onRemove(wxCommandEvent &aEvent)
bool editPreset(VIA_STACK_PRESET &aPreset)
bool nameIsFree(const wxString &aName, int aIgnoreRow) const
void loadFrom(BOARD_DESIGN_SETTINGS &aBds)
bool TransferDataToWindow() override
void ImportSettingsFrom(BOARD *aBoard)
void onEdit(wxCommandEvent &aEvent)
std::vector< VIA_STACK_PRESET > m_presets
bool TransferDataFromWindow() override
void onAdd(wxCommandEvent &aEvent)
void onCellChanged(wxGridEvent &aEvent)
The main frame for Pcbnew.
A microvia stack: several single hop microvias, plus connecting traces for staggered stacks,...
VIA_STACK_PRESET ToPreset() const
void ApplyPreset(const VIA_STACK_PRESET &aPreset)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
A named microvia stack definition, chosen while routing instead of entering the values each time.
PCB_LAYER_ID m_StartLayer