54 case 1:
return _(
"Show" );
55 case 2:
return _(
"Layer" );
56 default:
return wxEmptyString;
64 case 0:
return _(
"Reference designator" );
65 case 1:
return _(
"Value" );
66 default:
return wxEmptyString;
70 bool CanGetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
74 case 0:
return aTypeName == wxGRID_VALUE_STRING;
75 case 1:
return aTypeName == wxGRID_VALUE_BOOL;
76 case 2:
return aTypeName == wxGRID_VALUE_NUMBER;
77 default: wxFAIL;
return false;
81 bool CanSetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
87 void SetValue(
int row,
int col,
const wxString& value )
override
104 m_items[row].m_Layer = (int) value;
109 for(
size_t i = 0; i < aNumRows; ++i )
114 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
115 GetView()->ProcessTableMessage( msg );
131 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
132 GetView()->ProcessTableMessage( msg );
160 wxGridCellAttr* attr =
new wxGridCellAttr;
161 attr->SetRenderer(
new wxGridCellBoolRenderer() );
163 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
166 attr =
new wxGridCellAttr;
177 attr =
new wxGridCellAttr;
178 attr->SetRenderer(
new wxGridCellBoolRenderer() );
180 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
183 attr =
new wxGridCellAttr;
242 bool retVal = wxPanel::Show( aShow );
271 wxString
text = table->GetValue( i, 0 );
272 bool visible = table->GetValueAsBool( i, 1 );
273 int layer = (int) table->GetValueAsLong( i, 2 );
282 wxString
text = table->GetValue( i, 0 );
283 bool visible = table->GetValueAsBool( i, 1 );
284 int layer = (int) table->GetValueAsLong( i, 2 );
301 table->AppendRows( 1 );
302 table->SetValueAsBool( newRow, 1, table->GetValueAsBool( newRow - 1, 1 ) );
303 table->SetValueAsLong( newRow, 2, table->GetValueAsLong( newRow - 1, 2 ) );
320 if( selectedRows.empty() )
328 [](
int* first,
int* second )
330 return *second - *first;
333 for(
int row : selectedRows )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Container for design settings for a BOARD object.
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
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.
Class PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE.
STD_BITMAP_BUTTON * m_bpAdd
WX_GRID * m_textItemsGrid
WX_GRID * m_fieldPropsGrid
STD_BITMAP_BUTTON * m_bpDelete
BOARD_DESIGN_SETTINGS & m_designSettings
bool TransferDataFromWindow() override
PANEL_FP_EDITOR_FIELD_DEFAULTS(wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider)
virtual void OnAddTextItem(wxCommandEvent &event) override
virtual void OnDeleteTextItem(wxCommandEvent &event) override
~PANEL_FP_EDITOR_FIELD_DEFAULTS() override
void loadFPSettings(const FOOTPRINT_EDITOR_SETTINGS *aCfg)
void ResetPanel() override
Reset the contents of this panel.
bool TransferDataToWindow() override
bool Show(bool aShow) override
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
std::vector< TEXT_ITEM_INFO > m_items
bool DeleteRows(size_t aPos, size_t aNumRows) override
int GetNumberCols() override
wxString GetRowLabelValue(int aRow) override
TEXT_ITEMS_GRID_TABLE(bool aForFieldProps)
void SetValueAsLong(int row, int col, long value) override
void SetValue(int row, int col, const wxString &value) override
wxString GetValue(int row, int col) override
void SetValueAsBool(int row, int col, bool value) override
wxString GetColLabelValue(int aCol) override
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
int GetNumberRows() override
bool GetValueAsBool(int row, int col) override
bool AppendRows(size_t aNumRows=1) override
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
long GetValueAsLong(int row, int col) override
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.
This file is part of the common library.
static FOOTPRINT_EDITOR_SETTINGS & GetPgmSettings()
PGM_BASE & Pgm()
The global Program "get" accessor.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".