Make numbers in pin table read only

This commit is contained in:
Dominik Wernberger 2020-08-29 12:06:33 +02:00
parent 19832c7599
commit b653df2b21
1 changed files with 8 additions and 1 deletions

View File

@ -36,11 +36,13 @@ class SCH_PIN_TABLE_DATA_MODEL : public wxGridTableBase, public std::vector<SCH_
{
protected:
std::vector<wxGridCellAttr*> m_nameAttrs;
wxGridCellAttr* m_numberAttr;
wxGridCellAttr* m_typeAttr;
wxGridCellAttr* m_shapeAttr;
public:
SCH_PIN_TABLE_DATA_MODEL() :
m_numberAttr( nullptr ),
m_typeAttr( nullptr ),
m_shapeAttr( nullptr )
{
@ -51,12 +53,16 @@ public:
for( wxGridCellAttr* attr : m_nameAttrs )
attr->DecRef();
m_numberAttr->DecRef();
m_typeAttr->DecRef();
m_shapeAttr->DecRef();
}
void BuildAttrs()
{
m_numberAttr = new wxGridCellAttr;
m_numberAttr->SetReadOnly( true );
for( const SCH_PIN& pin : *this )
{
wxArrayString choices;
@ -128,7 +134,8 @@ public:
return m_nameAttrs[ aRow ];
case COL_NUMBER:
return nullptr;
m_numberAttr->IncRef();
return m_numberAttr;
case COL_TYPE:
m_typeAttr->IncRef();