KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LIB_TABLE_GRID_DATA_MODEL Class Referenceabstract

This abstract base class mixes any object derived from #LIB_TABLE into wxGridTableBase so the result can be used as any type of library table within wxGrid. More...

#include <lib_table_grid_data_model.h>

Inheritance diagram for LIB_TABLE_GRID_DATA_MODEL:
WX_GRID_TABLE_BASE DESIGN_BLOCK_LIB_TABLE_GRID_DATA_MODEL FP_LIB_TABLE_GRID_DATA_MODEL SYMBOL_LIB_TABLE_GRID_DATA_MODEL

Public Member Functions

 LIB_TABLE_GRID_DATA_MODEL (DIALOG_SHIM *aParent, WX_GRID *aGrid, const LIBRARY_TABLE &aTableToEdit, LIBRARY_MANAGER_ADAPTER *aAdapter, const wxArrayString &aPluginChoices, wxString *aMRUDirectory, const wxString &aProjectPath)
 
 ~LIB_TABLE_GRID_DATA_MODEL () override
 
int GetNumberRows () override
 
int GetNumberCols () override
 
wxString GetValue (int aRow, int aCol) override
 
wxGridCellAttr * GetAttr (int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
 
bool CanGetValueAs (int aRow, int aCol, const wxString &aTypeName) override
 
bool GetValueAsBool (int aRow, int aCol) override
 
void SetValue (int aRow, int aCol, const wxString &aValue) override
 
void SetValueAsBool (int aRow, int aCol, bool aValue) override
 
bool IsEmptyCell (int aRow, int aCol) override
 
bool InsertRows (size_t aPos=0, size_t aNumRows=1) override
 
bool AppendRows (size_t aNumRows=1) override
 
bool DeleteRows (size_t aPos, size_t aNumRows) override
 
wxString GetColLabelValue (int aCol) override
 
bool ContainsNickname (const wxString &aNickname)
 
LIBRARY_TABLE_ROWAt (size_t aIndex)
 
LIBRARY_TABLETable ()
 
LIBRARY_MANAGER_ADAPTERAdapter () const
 
void SetColAttr (wxGridCellAttr *aAttr, int aCol) override
 
virtual bool IsExpanderColumn (int aCol) const
 
virtual GROUP_TYPE GetGroupType (int aRow) const
 

Protected Member Functions

virtual wxString getFileTypes (WX_GRID *aGrid, int aRow)=0
 
virtual LIBRARY_TABLE_ROWat (size_t aIndex)
 
virtual size_t size () const
 
virtual LIBRARY_TABLE_ROW makeNewRow ()
 
virtual LIBRARY_TABLE_ROWS_ITER begin ()
 
virtual LIBRARY_TABLE_ROWS_ITER insert (LIBRARY_TABLE_ROWS_ITER aIterator, const LIBRARY_TABLE_ROW &aRow)
 
virtual void push_back (const LIBRARY_TABLE_ROW &aRow)
 
virtual LIBRARY_TABLE_ROWS_ITER erase (LIBRARY_TABLE_ROWS_ITER aFirst, LIBRARY_TABLE_ROWS_ITER aLast)
 
wxGridCellAttr * enhanceAttr (wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
 

Protected Attributes

LIBRARY_TABLE m_table
 Working copy of a table.
 
wxGridCellAttr * m_uriEditor
 
wxGridCellAttr * m_typesEditor
 
wxGridCellAttr * m_boolAttr
 
wxGridCellAttr * m_warningAttr
 
wxGridCellAttr * m_editSettingsAttr
 
wxGridCellAttr * m_openTableAttr
 
LIBRARY_MANAGER_ADAPTERm_adapter
 Handle to the adapter for the type of table this grid represents (may be null)
 
std::map< int, wxGridCellAttr * > m_colAttrs
 

Friends

class LIB_TABLE_GRID_TRICKS
 

Detailed Description

This abstract base class mixes any object derived from #LIB_TABLE into wxGridTableBase so the result can be used as any type of library table within wxGrid.

Definition at line 48 of file lib_table_grid_data_model.h.

Constructor & Destructor Documentation

◆ LIB_TABLE_GRID_DATA_MODEL()

◆ ~LIB_TABLE_GRID_DATA_MODEL()

LIB_TABLE_GRID_DATA_MODEL::~LIB_TABLE_GRID_DATA_MODEL ( )
override

Member Function Documentation

◆ Adapter()

LIBRARY_MANAGER_ADAPTER * LIB_TABLE_GRID_DATA_MODEL::Adapter ( ) const
inline

Definition at line 97 of file lib_table_grid_data_model.h.

References m_adapter.

Referenced by LIB_TABLE_GRID_TRICKS::showPopupMenu().

◆ AppendRows()

bool LIB_TABLE_GRID_DATA_MODEL::AppendRows ( size_t aNumRows = 1)
override

Definition at line 265 of file lib_table_grid_data_model.cpp.

References makeNewRow(), and push_back().

◆ At()

◆ at()

◆ begin()

LIBRARY_TABLE_ROWS_ITER LIB_TABLE_GRID_DATA_MODEL::begin ( )
protectedvirtual

Definition at line 354 of file lib_table_grid_data_model.cpp.

References m_table.

Referenced by DeleteRows(), and InsertRows().

◆ CanGetValueAs()

bool LIB_TABLE_GRID_DATA_MODEL::CanGetValueAs ( int aRow,
int aCol,
const wxString & aTypeName )
override

Definition at line 176 of file lib_table_grid_data_model.cpp.

References COL_ENABLED, COL_VISIBLE, and size().

◆ ContainsNickname()

bool LIB_TABLE_GRID_DATA_MODEL::ContainsNickname ( const wxString & aNickname)

Definition at line 323 of file lib_table_grid_data_model.cpp.

References at(), LIBRARY_TABLE_ROW::Nickname(), and size().

◆ DeleteRows()

bool LIB_TABLE_GRID_DATA_MODEL::DeleteRows ( size_t aPos,
size_t aNumRows )
override

Definition at line 281 of file lib_table_grid_data_model.cpp.

References begin(), erase(), and size().

Referenced by LIB_TABLE_GRID_TRICKS::VerifyTable().

◆ enhanceAttr()

wxGridCellAttr * WX_GRID_TABLE_BASE::enhanceAttr ( wxGridCellAttr * aInputAttr,
int aRow,
int aCol,
wxGridCellAttr::wxAttrKind aKind )
protectedinherited

◆ erase()

LIBRARY_TABLE_ROWS_ITER LIB_TABLE_GRID_DATA_MODEL::erase ( LIBRARY_TABLE_ROWS_ITER aFirst,
LIBRARY_TABLE_ROWS_ITER aLast )
protectedvirtual

Definition at line 372 of file lib_table_grid_data_model.cpp.

References m_table.

Referenced by DeleteRows().

◆ GetAttr()

◆ GetColLabelValue()

wxString LIB_TABLE_GRID_DATA_MODEL::GetColLabelValue ( int aCol)
override

◆ getFileTypes()

virtual wxString LIB_TABLE_GRID_DATA_MODEL::getFileTypes ( WX_GRID * aGrid,
int aRow )
protectedpure virtual

◆ GetGroupType()

virtual GROUP_TYPE WX_GRID_TABLE_BASE::GetGroupType ( int aRow) const
inlinevirtualinherited

Reimplemented in FIELDS_EDITOR_GRID_DATA_MODEL, and LIB_FIELDS_EDITOR_GRID_DATA_MODEL.

Definition at line 80 of file wx_grid.h.

References GROUP_SINGLETON, and GROUP_TYPE.

◆ GetNumberCols()

int LIB_TABLE_GRID_DATA_MODEL::GetNumberCols ( )
inlineoverride

Definition at line 62 of file lib_table_grid_data_model.h.

References COL_COUNT.

◆ GetNumberRows()

◆ GetValue()

◆ GetValueAsBool()

bool LIB_TABLE_GRID_DATA_MODEL::GetValueAsBool ( int aRow,
int aCol )
override

◆ insert()

LIBRARY_TABLE_ROWS_ITER LIB_TABLE_GRID_DATA_MODEL::insert ( LIBRARY_TABLE_ROWS_ITER aIterator,
const LIBRARY_TABLE_ROW & aRow )
protectedvirtual

Definition at line 360 of file lib_table_grid_data_model.cpp.

References m_table.

Referenced by InsertRows().

◆ InsertRows()

bool LIB_TABLE_GRID_DATA_MODEL::InsertRows ( size_t aPos = 0,
size_t aNumRows = 1 )
override

Definition at line 244 of file lib_table_grid_data_model.cpp.

References begin(), insert(), makeNewRow(), and size().

◆ IsEmptyCell()

bool LIB_TABLE_GRID_DATA_MODEL::IsEmptyCell ( int aRow,
int aCol )
inlineoverride

Definition at line 75 of file lib_table_grid_data_model.h.

References GetValue().

◆ IsExpanderColumn()

virtual bool WX_GRID_TABLE_BASE::IsExpanderColumn ( int aCol) const
inlinevirtualinherited

Reimplemented in FIELDS_EDITOR_GRID_DATA_MODEL, and LIB_FIELDS_EDITOR_GRID_DATA_MODEL.

Definition at line 79 of file wx_grid.h.

◆ makeNewRow()

LIBRARY_TABLE_ROW LIB_TABLE_GRID_DATA_MODEL::makeNewRow ( )
protectedvirtual

Definition at line 348 of file lib_table_grid_data_model.cpp.

References m_table.

Referenced by AppendRows(), and InsertRows().

◆ push_back()

void LIB_TABLE_GRID_DATA_MODEL::push_back ( const LIBRARY_TABLE_ROW & aRow)
protectedvirtual

Definition at line 366 of file lib_table_grid_data_model.cpp.

References m_table.

Referenced by AppendRows().

◆ SetColAttr()

void WX_GRID_TABLE_BASE::SetColAttr ( wxGridCellAttr * aAttr,
int aCol )
inlineoverrideinherited

Definition at line 62 of file wx_grid.h.

References m_colAttrs.

◆ SetValue()

◆ SetValueAsBool()

void LIB_TABLE_GRID_DATA_MODEL::SetValueAsBool ( int aRow,
int aCol,
bool aValue )
override

◆ size()

◆ Table()

Friends And Related Symbol Documentation

◆ LIB_TABLE_GRID_TRICKS

friend class LIB_TABLE_GRID_TRICKS
friend

Definition at line 50 of file lib_table_grid_data_model.h.

References LIB_TABLE_GRID_TRICKS.

Referenced by LIB_TABLE_GRID_TRICKS.

Member Data Documentation

◆ m_adapter

LIBRARY_MANAGER_ADAPTER* LIB_TABLE_GRID_DATA_MODEL::m_adapter
protected

Handle to the adapter for the type of table this grid represents (may be null)

Definition at line 128 of file lib_table_grid_data_model.h.

Referenced by Adapter(), GetAttr(), GetValue(), and LIB_TABLE_GRID_DATA_MODEL().

◆ m_boolAttr

wxGridCellAttr* LIB_TABLE_GRID_DATA_MODEL::m_boolAttr
protected

◆ m_colAttrs

std::map<int, wxGridCellAttr*> WX_GRID_TABLE_BASE::m_colAttrs
protectedinherited

◆ m_editSettingsAttr

wxGridCellAttr* LIB_TABLE_GRID_DATA_MODEL::m_editSettingsAttr
protected

◆ m_openTableAttr

wxGridCellAttr* LIB_TABLE_GRID_DATA_MODEL::m_openTableAttr
protected

◆ m_table

LIBRARY_TABLE LIB_TABLE_GRID_DATA_MODEL::m_table
protected

Working copy of a table.

Definition at line 118 of file lib_table_grid_data_model.h.

Referenced by at(), begin(), erase(), insert(), LIB_TABLE_GRID_DATA_MODEL(), makeNewRow(), push_back(), size(), and Table().

◆ m_typesEditor

wxGridCellAttr* LIB_TABLE_GRID_DATA_MODEL::m_typesEditor
protected

◆ m_uriEditor

wxGridCellAttr* LIB_TABLE_GRID_DATA_MODEL::m_uriEditor
protected

◆ m_warningAttr

wxGridCellAttr* LIB_TABLE_GRID_DATA_MODEL::m_warningAttr
protected

The documentation for this class was generated from the following files: