mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
CallBack from C++ to Perl to manipulations with object list
This commit is contained in:
parent
bc6e6492af
commit
9e0d2793cb
7 changed files with 94 additions and 13 deletions
|
@ -452,6 +452,18 @@ wxDataViewItem MyObjectTreeModel::GetItemById(int obj_idx)
|
|||
}
|
||||
|
||||
|
||||
int MyObjectTreeModel::GetIdByItem(wxDataViewItem& item)
|
||||
{
|
||||
wxASSERT(item.IsOk());
|
||||
|
||||
MyObjectTreeModelNode *node = (MyObjectTreeModelNode*)item.GetID();
|
||||
auto it = find(m_objects.begin(), m_objects.end(), node);
|
||||
if (it == m_objects.end())
|
||||
return -1;
|
||||
|
||||
return it - m_objects.begin();
|
||||
}
|
||||
|
||||
wxString MyObjectTreeModel::GetName(const wxDataViewItem &item) const
|
||||
{
|
||||
MyObjectTreeModelNode *node = (MyObjectTreeModelNode*)item.GetID();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue