49 case 0:
return _(
"Text Items" );
50 case 1:
return _(
"Show" );
51 case 2:
return _(
"Layer" );
52 default:
return wxEmptyString;
60 case 0:
return _(
"Reference designator" );
61 case 1:
return _(
"Value" );
62 default:
return wxEmptyString;
66 bool CanGetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override 70 case 0:
return aTypeName == wxGRID_VALUE_STRING;
71 case 1:
return aTypeName == wxGRID_VALUE_BOOL;
72 case 2:
return aTypeName == wxGRID_VALUE_NUMBER;
73 default: wxFAIL;
return false;
77 bool CanSetValueAs(
int aRow,
int aCol,
const wxString& aTypeName )
override 86 void SetValue(
int row,
int col,
const wxString& value )
override 109 m_items[row].m_Layer = (int) value;
114 for(
size_t i = 0; i < aNumRows; ++i )
119 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
120 GetView()->ProcessTableMessage( msg );
136 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
137 GetView()->ProcessTableMessage( msg );
173 m_brdSettings( aFrame->GetDesignSettings() ),
182 wxGridCellAttr* attr =
new wxGridCellAttr;
183 attr->SetRenderer(
new wxGridCellBoolRenderer() );
187 attr =
new wxGridCellAttr;
199 wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
200 infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
214 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
216 #define SET_MILS_CELL( row, col, val ) \ 217 m_layerClassesGrid->SetCellValue( row, col, StringFromValue( m_frame->GetUserUnits(), val, true ) ) 219 #define DISABLE_CELL( row, col ) \ 220 m_layerClassesGrid->SetReadOnly( row, col ); m_layerClassesGrid->SetCellBackgroundColour( row, col, disabledColour ); 240 auto attr =
new wxGridCellAttr;
241 attr->SetRenderer(
new wxGridCellBoolRenderer() );
243 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
280 bool retVal = wxPanel::Show( aShow );
321 wxString msg =
_(
"Text will not be readable with a thickness greater than\n" 322 "1/4 its width or height." );
358 wxString
text = table->GetValue( i, 0 );
359 bool visible = table->GetValueAsBool( i, 1 );
360 int layer = (int) table->GetValueAsLong( i, 2 );
382 table->AppendRows( 1 );
383 table->SetValueAsBool( newRow, 1, table->GetValueAsBool( newRow - 1, 1 ) );
384 table->SetValueAsLong( newRow, 2, table->GetValueAsLong( newRow - 1, 2 ) );
406 curRow = std::max( 0, curRow - 1 );
wxStaticText * m_staticTextInfo
int GetNumberCols() override
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
wxBitmapButton * m_bpDelete
bool AppendRows(size_t aNumRows=1) override
bool GetValueAsBool(int row, int col) override
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
BOARD_DESIGN_SETTINGS m_brdSettings
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
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 DeleteRows(size_t aPos, size_t aNumRows) override
WX_GRID * m_layerClassesGrid
int GetNumberRows() override
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=false, bool aKeep=true)
Calculates the specified column based on the actual size of the text on screen.
void SetValueAsLong(int row, int col, long value) override
bool TransferDataFromWindow() override
wxSize m_TextSize[LAYER_CLASS_COUNT]
bool Show(bool aShow) override
void SetValue(int row, int col, const wxString &value) override
int m_TextThickness[LAYER_CLASS_COUNT]
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
wxString GetColLabelValue(int aCol) override
virtual void OnDeleteTextItem(wxCommandEvent &event) override
wxString GetRowLabelValue(int aRow) override
PANEL_FP_EDITOR_DEFAULTS(FOOTPRINT_EDIT_FRAME *aFrame, PAGED_DIALOG *aParent)
bool m_TextItalic[LAYER_CLASS_COUNT]
bool TransferDataToWindow() override
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
int m_LineThickness[LAYER_CLASS_COUNT]
~PANEL_FP_EDITOR_DEFAULTS() override
#define SET_MILS_CELL(row, col, val)
std::vector< TEXT_ITEM_INFO > m_items
virtual void OnAddTextItem(wxCommandEvent &event) override
int getGridValue(int aRow, int aCol)
Class PANEL_FP_EDITOR_DEFAULTS_BASE.
#define DISABLE_CELL(row, col)
long GetValueAsLong(int row, int col) override
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
FOOTPRINT_EDIT_FRAME * m_frame
void SetValueAsBool(int row, int col, bool value) override
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
wxString GetValue(int row, int col) override
WX_GRID * m_textItemsGrid
wxBitmap KiBitmap(BITMAPS aBitmap)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...