59 case 0:
return _(
"Layer" );
60 case 1:
return _(
"Name" );
61 default:
return wxEmptyString;
65 bool CanGetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
69 case 0:
return aTypeName == wxGRID_VALUE_NUMBER;
70 case 1:
return aTypeName == wxGRID_VALUE_STRING;
71 default: wxFAIL;
return false;
75 bool CanSetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
81 void SetValue(
int row,
int col,
const wxString& value )
override
100 layers.insert( item.m_Layer );
103 for(
size_t i = 0; i < aNumRows; ++i )
105 while( layers.contains( layer ) )
110 layers.insert( layer );
121 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
122 GetView()->ProcessTableMessage( msg );
138 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
139 GetView()->ProcessTableMessage( msg );
162 wxGridCellAttr* attr =
new wxGridCellAttr;
194 wxString orig_name = canonicalName;
201 table->AppendRows( 1 );
202 table->SetValueAsLong( row, 0, layer );
203 table->SetValue( row, 1, userName );
231 bool retVal = wxPanel::Show( aShow );
262 std::set<int> usedLayers;
269 if( !usedLayers.contains( ii ) )
281 if( event.GetCol() == 0 )
283 int layer =
static_cast<int>(
table->GetValueAsLong( event.GetRow(), 0 ) );
287 if( i != event.GetRow() &&
table->GetValueAsLong( i, 0 ) == layer )
297 wxString layerName =
table->GetValue( ii, 1 );
299 if( ii != event.GetRow() && layerName ==
table->GetValue( event.GetRow(), 1 ) )
301 wxString msg = wxString::Format(
_(
"Layer name %s already in use." ), layerName );
312 [&]() -> std::pair<int, int>
364 cfg->m_DesignSettings.m_UserLayerNames.clear();
374 cfg->m_DesignSettings.m_UserLayerNames.emplace( orig_name.ToStdString(),
name );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
CROSS_PROBING_SETTINGS m_CrossProbing
BASE_SET & set(size_t pos)
std::map< std::string, wxString > m_UserLayerNames
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
int GetNumberCols() override
bool DeleteRows(size_t aPos, size_t aNumRows) override
void SetValue(int row, int col, const wxString &value) override
std::vector< TEXT_ITEM_INFO > m_items
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
wxString GetColLabelValue(int aCol) override
bool AppendRows(size_t aNumRows=1) override
wxString GetValue(int row, int col) override
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
void SetValueAsLong(int row, int col, long value) override
long GetValueAsLong(int row, int col) override
int GetNumberRows() override
LSET is a set of PCB_LAYER_IDs.
static int NameToLayer(wxString &aName)
Return the layer number from a layer name.
static const LSET & AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
wxCheckBox * m_checkCrossProbeOnSelection
wxCheckBox * m_live3Drefresh
wxCheckBox * m_checkCrossProbeCenter
wxCheckBox * m_OptUseViaColorForNormalTHPadstacks
wxCheckBox * m_checkCrossProbeFlash
wxCheckBox * m_checkCrossProbeZoom
wxBoxSizer * m_galOptionsSizer
wxCheckBox * m_checkCrossProbeAutoHighlight
wxChoice * m_OptDisplayTracksClearance
wxCheckBox * m_OptDisplayPadClearence
STD_BITMAP_BUTTON * m_bpAddLayer
wxSimplebook * m_optionsBook
WX_GRID * m_layerNameitemsGrid
PANEL_DISPLAY_OPTIONS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxChoice * m_ShowNetNamesOption
wxCheckBox * m_OptDisplayPadNumber
STD_BITMAP_BUTTON * m_bpDeleteLayer
wxCheckBox * m_checkForceShowFieldsWhenFPSelected
void OnDeleteLayerItem(wxCommandEvent &event) override
void loadPCBSettings(PCBNEW_SETTINGS *aCfg)
PANEL_DISPLAY_OPTIONS(wxWindow *aParent, APP_SETTINGS_BASE *aAppSettings)
PANEL_GAL_OPTIONS * m_galOptsPanel
int getNextAvailableLayer() const
void OnAddLayerItem(wxCommandEvent &event) override
void loadFPSettings(const FOOTPRINT_EDITOR_SETTINGS *aCfg)
bool Show(bool aShow) override
void ResetPanel() override
Reset the contents of this panel.
void onLayerChange(wxGridEvent &event) override
~PANEL_DISPLAY_OPTIONS() override
bool TransferDataFromWindow() override
bool TransferDataToWindow() override
DISPLAY_OPTIONS m_Display
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
PCB_LAYER_ID
A quick note on layer IDs:
std::vector< std::pair< T, long > > CFG_MAP
A config value table is a list of native values (usually enums) to a different set of values,...
static long GetConfigForVal(const MAP &aMap, CFG_NATIVE_VAL< MAP > aVal)
Get the mapped config value (the one to write to file, or use in an index) from the given native (pro...
static CFG_NATIVE_VAL< MAP > GetValFromConfig(const MAP &aMap, long aConf)
Get the native value corresponding to the config value (read from file or UI, probably) and find it i...
static const UTIL::CFG_MAP< TRACK_CLEARANCE_MODE > clearanceModeMap
@ SHOW_WITH_VIA_WHILE_ROUTING_OR_DRAGGING
@ SHOW_WITH_VIA_WHILE_ROUTING
T * GetAppSettings(const char *aFilename)
bool flash_selection
Flash newly cross-probed selection (visual attention aid).
bool on_selection
Synchronize the selection for multiple items too.
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off).
bool center_on_items
Automatically pan to cross-probed items.
bool auto_highlight
Automatically turn on highlight mode in the target frame.
TRACK_CLEARANCE_MODE m_TrackClearance
bool m_ForceShowFieldsWhenFPSelected
bool m_UseViaColorForNormalTHPadstacks