52 case 0:
return _(
"Text Items" );
53 case 1:
return _(
"Show" );
54 case 2:
return _(
"Layer" );
55 default:
return wxEmptyString;
63 case 0:
return _(
"Reference designator" );
64 case 1:
return _(
"Value" );
65 default:
return wxEmptyString;
69 bool CanGetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
73 case 0:
return aTypeName == wxGRID_VALUE_STRING;
74 case 1:
return aTypeName == wxGRID_VALUE_BOOL;
75 case 2:
return aTypeName == wxGRID_VALUE_NUMBER;
76 default: wxFAIL;
return false;
80 bool CanSetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override
89 void SetValue(
int row,
int col,
const wxString& value )
override
102 m_items[row].m_Visible = value;
112 m_items[row].m_Layer = (int) value;
117 for(
size_t i = 0; i < aNumRows; ++i )
122 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
123 GetView()->ProcessTableMessage( msg );
139 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
140 GetView()->ProcessTableMessage( msg );
185 wxGridCellAttr* attr =
new wxGridCellAttr;
186 attr->SetRenderer(
new wxGridCellBoolRenderer() );
188 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
191 attr =
new wxGridCellAttr;
225 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
228 [&](
int row,
int col )
231 m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
252 auto attr =
new wxGridCellAttr;
253 attr->SetRenderer(
new wxGridCellBoolRenderer() );
255 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
302 bool retVal = wxPanel::Show( aShow );
336 wxString msg =
_(
"Text will not be readable with a thickness greater than\n"
337 "1/4 its width or height." );
367 cfg.
m_TextItalic[ i ] = wxGridCellBoolEditor::IsTrueValue( msg );
376 wxString
text = table->GetValue( i, 0 );
377 bool visible = table->GetValueAsBool( i, 1 );
378 int layer = (int) table->GetValueAsLong( i, 2 );
395 table->AppendRows( 1 );
396 table->SetValueAsBool( newRow, 1, table->GetValueAsBool( newRow - 1, 1 ) );
397 table->SetValueAsLong( newRow, 2, table->GetValueAsLong( newRow - 1, 2 ) );
414 if( selectedRows.empty() )
417 for(
int row : selectedRows )
421 DisplayError(
nullptr,
_(
"Reference and value are mandatory." ) );
430 selectedRows.Sort( [](
int* first,
int* second ) {
return *second - *first; } );
432 for(
int row : selectedRows )
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
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.
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
Class PANEL_FP_EDITOR_DEFAULTS_BASE.
WX_GRID * m_textItemsGrid
STD_BITMAP_BUTTON * m_bpAdd
STD_BITMAP_BUTTON * m_bpDelete
wxStaticText * m_staticTextInfo
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(bool aLoadNow=true)
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
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.
wxFont GetInfoFont(wxWindow *aWindow)
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.