31 const wxArrayString& aPluginChoices,
32 wxString* aMRUDirectory,
const wxString& aProjectPath ) :
39 [
this](
WX_GRID* aCurrGrid,
int aRow ) -> wxString
41 return getFileTypes( aCurrGrid, aRow );
45 m_typesEditor->SetEditor(
new wxGridCellChoiceEditor( aPluginChoices ) );
48 m_boolAttr->SetRenderer(
new wxGridCellBoolRenderer() );
50 m_boolAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
55 m_warningAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
87 if( aRow < 0 || aRow >= (
int)
size() )
100 return wxEmptyString;
119 return _(
"Edit settings" );
121 return _(
"Open library table" );
123 return wxEmptyString;
126 return wxEmptyString;
154 if( !tableRow.
IsOk() )
192 return aTypeName == wxGRID_VALUE_BOOL;
195 return aTypeName == wxGRID_VALUE_STRING;
235 GetView()->CallAfter(
267 for(
size_t i = 0; i < aNumRows; i++ )
273 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, aPos, aNumRows );
274 GetView()->ProcessTableMessage( msg );
287 for(
int i = aNumRows; i; --i )
292 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
293 GetView()->ProcessTableMessage( msg );
304 if( aPos <
size() && aPos + aNumRows <=
size() )
307 erase( start, start + aNumRows );
311 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
312 GetView()->ProcessTableMessage( msg );
327 case COL_URI:
return _(
"Library Path" );
330 case COL_TYPE:
return _(
"Library Format" );
337 default:
return wxEmptyString;
344 for(
size_t i = 0; i <
size(); ++i )
360 for(
size_t row = 0; row <
size(); ++row )
370 return m_table.Rows().at( aIndex );
395 return m_table.Rows().insert( aIterator, aRow );
401 m_table.Rows().push_back( aRow );
408 return m_table.Rows().erase( aFirst, aLast );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
The interface used by the classes that actually can load IO plugins for the different parts of KiCad ...
void SetOptions(const wxString &aOptions)
void SetNickname(const wxString &aNickname)
void SetType(const wxString &aType)
const wxString & ErrorDescription() const
void SetDescription(const wxString &aDescription)
const wxString & Type() const
static const wxString TABLE_TYPE_NAME
void SetURI(const wxString &aUri)
const wxString & Description() const
void SetDisabled(bool aDisabled=true)
void SetHidden(bool aHidden=true)
const wxString & URI() const
const wxString & Nickname() const
const wxString & Options() const
virtual LIBRARY_TABLE_ROWS_ITER begin()
wxGridCellAttr * m_editSettingsAttr
bool AppendRows(size_t aNumRows=1) override
wxGridCellAttr * m_warningAttr
virtual LIBRARY_TABLE_ROW & at(size_t aIndex)
int GetNumberRows() override
wxGridCellAttr * m_noStatusAttr
bool ContainsNickname(const wxString &aNickname)
virtual LIBRARY_TABLE_ROWS_ITER erase(LIBRARY_TABLE_ROWS_ITER aFirst, LIBRARY_TABLE_ROWS_ITER aLast)
~LIB_TABLE_GRID_DATA_MODEL() override
void SetValueAsBool(int aRow, int aCol, bool aValue) override
virtual size_t size() const
virtual LIBRARY_TABLE_ROWS_ITER insert(LIBRARY_TABLE_ROWS_ITER aIterator, const LIBRARY_TABLE_ROW &aRow)
wxString GetValue(int aRow, int aCol) override
wxString GetColLabelValue(int aCol) override
wxGridCellAttr * m_uriEditor
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
wxGridCellAttr * m_boolAttr
bool DeleteRows(size_t aPos, size_t aNumRows) override
virtual void push_back(const LIBRARY_TABLE_ROW &aRow)
bool InsertRows(size_t aPos=0, size_t aNumRows=1) override
LIBRARY_MANAGER_ADAPTER * m_adapter
Handle to the adapter for the type of table this grid represents (may be null)
void SetValue(int aRow, int aCol, const wxString &aValue) override
LIBRARY_TABLE m_table
Working copy of a table.
wxGridCellAttr * m_typesEditor
wxGridCellAttr * m_openTableAttr
bool badCoords(int aRow, int aCol)
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)
virtual LIBRARY_TABLE_ROW makeNewRow()
int GetNumberCols() override
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
std::vector< LIBRARY_TABLE_ROW >::iterator LIBRARY_TABLE_ROWS_ITER
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...