Added checking for a extruder value in ObjectList. Set value to "default" if "0" is selected.

This commit is contained in:
YuSanka 2019-07-22 10:28:25 +02:00
parent f6633df57b
commit fb39516c65
2 changed files with 24 additions and 21 deletions

View file

@ -552,6 +552,29 @@ void ObjectDataViewModelNode::msw_rescale()
update_settings_digest_bitmaps();
}
bool ObjectDataViewModelNode::SetValue(const wxVariant& variant, unsigned col)
{
switch (col)
{
case 0: {
DataViewBitmapText data;
data << variant;
m_bmp = data.GetBitmap();
m_name = data.GetText();
return true; }
case 1: {
const wxString & val = variant.GetString();
m_extruder = val == "0" ? _(L("default")) : val;
return true; }
case 2:
m_action_icon << variant;
return true;
default:
printf("MyObjectTreeModel::SetValue: wrong column");
}
return false;
}
void ObjectDataViewModelNode::SetIdx(const int& idx)
{
m_idx = idx;