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 );
151 m_isPCBEdit( dynamic_cast<
PCBNEW_SETTINGS*>( aAppSettings ) != nullptr )
164 wxGridCellAttr* attr =
new wxGridCellAttr;
196 wxString orig_name = item.first;
203 table->AppendRows( 1 );
204 table->SetValueAsLong( row, 0, layer );
205 table->SetValue( row, 1, item.second );
231 bool retVal = wxPanel::Show( aShow );
272 std::set<int> usedLayers;
279 if( !usedLayers.contains( ii ) )
291 if( event.GetCol() == 0 )
293 int layer =
static_cast<int>(
table->GetValueAsLong( event.GetRow(), 0 ) );
297 if( i != event.GetRow()
298 &&
table->GetValueAsLong( i, 0 ) == layer )
308 wxString layerName =
table->GetValue( ii, 1 );
310 if( ii != event.GetRow() && layerName ==
table->GetValue( event.GetRow(), 1 ) )
312 wxString msg = wxString::Format(
_(
"Layer name %s already in use." ), layerName );
328 table->AppendRows( 1 );
342 if( selectedRows.empty() )
350 [](
int* first,
int* second )
352 return *second - *first;
355 for(
int row : selectedRows )
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
bool ResetPanel(APP_SETTINGS_BASE *aAppSettings)
bool TransferDataToWindow() override
Load the panel controls from the given opt.
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
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 LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu 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 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)
Class PANEL_DISPLAY_OPTIONS_BASE.
wxCheckBox * m_checkCrossProbeOnSelection
wxCheckBox * m_live3Drefresh
wxCheckBox * m_checkCrossProbeCenter
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
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)
int getNextAvailableLayer() const
void OnAddLayerItem(wxCommandEvent &event) override
void loadFPSettings(const FOOTPRINT_EDITOR_SETTINGS *aCfg)
bool Show(bool aShow) override
GAL_OPTIONS_PANEL * m_galOptsPanel
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
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * GetAppSettings(const char *aFilename)
Return a handle to the a given settings by type.
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...
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
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
PGM_BASE & Pgm()
The global program "get" accessor.
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