void HRMEMainWindow::setSelectedObject(MapObject* selected_object) { positionPropertyFrame->setEnabled(false); rotationPropertyFrame->setEnabled(false); scalePropertyFrame->setEnabled(false); colorPropertyFrame->setEnabled(false); attenuationPropertyFrame->setEnabled(false); meshInstancePropertyFrame->setEnabled(false); Light* light; MeshInstance* instance; if (selected_object) { switch (selected_object->getType()) { case MapObject::LIGHT: light = ((LightObject*)selected_object)->getLight(); lightStrengthBox->setValue(light->getStrength()); lightAttenuationBox->setChecked(light->getHasAttenuation()); attenuationPropertyFrame->setEnabled(true); break; case MapObject::MESH_INSTANCE: instance = ((MeshInstanceObject*)selected_object)->getMeshInstance(); meshInstancePropertyFrame->setEnabled(true); instanceTypeBox->setCurrentIndex(static_cast<int>(instance->getType())); ;break; default: break; } positionPropertyFrame->setEnabled(true); colorPropertyFrame->setEnabled(selected_object->hasColors()); rotationPropertyFrame->setEnabled(selected_object->hasRotation()); scalePropertyFrame->setEnabled(selected_object->hasScale()); } for (int i = 0; i < objectPropertyWidgets.size(); i++) { objectPropertyWidgets.at(i)->setVisible(objectPropertyWidgets.at(i)->parentWidget()->isEnabled()); } }