Fixed set printable state for a first instance after increasing instance count

This commit is contained in:
YuSanka 2019-08-13 18:15:12 +02:00
parent 4cd4d2c8b5
commit 5cf9bb0282

View File

@ -806,7 +806,15 @@ wxDataViewItem ObjectDataViewModel::AddInstanceChild(const wxDataViewItem& paren
size_t counter = 0;
while (counter < print_indicator.size()) {
instance_node = new ObjectDataViewModelNode(inst_root_node, itInstance);
instance_node->set_printable_icon(print_indicator[counter] ? piPrintable : piUnprintable);
// if InstanceRoot item is just created and start to adding Instances
if (just_created && counter == 0) {
ObjectDataViewModelNode* obj_node = (ObjectDataViewModelNode*)parent_item.GetID();
// use object's printable state to first instance
instance_node->set_printable_icon(obj_node->IsPrintable());
}
else
instance_node->set_printable_icon(print_indicator[counter] ? piPrintable : piUnprintable);
inst_root_node->Append(instance_node);
// notify control