Added "Add/Delete" functions to the MyObjectTreeModel

This commit is contained in:
YuSanka 2018-05-29 22:45:35 +02:00
parent 45b6c99353
commit db7c58009c
3 changed files with 76 additions and 28 deletions

View file

@ -209,13 +209,17 @@ class MyObjectTreeModel :public wxDataViewModel
{
std::set<MyObjectTreeModelNode*> m_objects;
public:
MyObjectTreeModel();
MyObjectTreeModel(){}
~MyObjectTreeModel()
{
for (auto object : m_objects)
delete object;
}
void Add(wxString &name);
void AddChild(const wxDataViewItem &parent_item, wxString &name);
void Delete(const wxDataViewItem &item);
// helper method for wxLog
wxString GetName(const wxDataViewItem &item) const;
@ -224,10 +228,6 @@ public:
// helper methods to change the model
// void AddToClassical(const wxString &title, const wxString &artist,
// unsigned int year);
// void Delete(const wxDataViewItem &item);
virtual unsigned int GetColumnCount() const override { return 3;}
virtual wxString GetColumnType(unsigned int col) const override{ return wxT("string"); }