55 case 1:
return _(
"Show" );
56 case 2:
return _(
"Layer" );
57 default:
return wxEmptyString;
65 case 0:
return _(
"Reference designator" );
66 case 1:
return _(
"Value" );
67 default:
return wxEmptyString;
71 bool CanGetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
75 case 0:
return aTypeName == wxGRID_VALUE_STRING;
76 case 1:
return aTypeName == wxGRID_VALUE_BOOL;
77 case 2:
return aTypeName == wxGRID_VALUE_NUMBER;
78 default: wxFAIL;
return false;
82 bool CanSetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
91 void SetValue(
int row,
int col,
const wxString& value )
override
104 m_items[row].m_Visible = value;
114 m_items[row].m_Layer = (int) value;
119 for(
size_t i = 0; i < aNumRows; ++i )
124 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
125 GetView()->ProcessTableMessage( msg );
141 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
142 GetView()->ProcessTableMessage( msg );
185 wxGridCellAttr* attr =
new wxGridCellAttr;
186 attr->SetRenderer(
new wxGridCellBoolRenderer() );
188 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
191 attr =
new wxGridCellAttr;
202 attr =
new wxGridCellAttr;
203 attr->SetRenderer(
new wxGridCellBoolRenderer() );
205 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
208 attr =
new wxGridCellAttr;
241 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
244 [&](
int row,
int col )
247 m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
268 auto attr =
new wxGridCellAttr;
269 attr->SetRenderer(
new wxGridCellBoolRenderer() );
271 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
330 bool retVal = wxPanel::Show( aShow );
371 cfg.
m_TextItalic[ i ] = wxGridCellBoolEditor::IsTrueValue( msg );
381 wxString
text = table->GetValue( i, 0 );
382 bool visible = table->GetValueAsBool( i, 1 );
383 int layer = (int) table->GetValueAsLong( i, 2 );
392 wxString
text = table->GetValue( i, 0 );
393 bool visible = table->GetValueAsBool( i, 1 );
394 int layer = (int) table->GetValueAsLong( i, 2 );
411 table->AppendRows( 1 );
412 table->SetValueAsBool( newRow, 1, table->GetValueAsBool( newRow - 1, 1 ) );
413 table->SetValueAsLong( newRow, 2, table->GetValueAsLong( newRow - 1, 2 ) );
430 if( selectedRows.empty() )
433 for(
int row : selectedRows )
437 DisplayError(
nullptr,
_(
"Reference and value are mandatory." ) );
446 selectedRows.Sort( [](
int* first,
int* second ) {
return *second - *first; } );
448 for(
int row : selectedRows )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Container for design settings for a BOARD object.
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
int m_TextThickness[LAYER_CLASS_COUNT]
int m_LineThickness[LAYER_CLASS_COUNT]
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
bool m_TextItalic[LAYER_CLASS_COUNT]
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_DEFAULTS_BASE.
WX_GRID * m_textItemsGrid
STD_BITMAP_BUTTON * m_bpAdd
WX_GRID * m_fieldPropsGrid
STD_BITMAP_BUTTON * m_bpDelete
virtual void OnAddTextItem(wxCommandEvent &event) override
bool TransferDataFromWindow() override
void ResetPanel() override
Reset the contents of this panel.
bool TransferDataToWindow() override
~PANEL_FP_EDITOR_DEFAULTS() override
bool Show(bool aShow) override
PANEL_FP_EDITOR_DEFAULTS(wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider)
virtual void OnDeleteTextItem(wxCommandEvent &event) override
void loadFPSettings(FOOTPRINT_EDITOR_SETTINGS *aCfg)
T * GetAppSettings()
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
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
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 SetUnitValue(int aRow, int aCol, int aValue)
Set a unitized cell's value.
int GetUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
void SetAutoEvalCols(const std::vector< int > &aCols)
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a UNITS_PROVIDER to enable use of unit- and eval-based Getters.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
Base window classes and related definitions.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".