void ModelAPI_ResultField::ModelAPI_FieldStep::setDisplayed(const bool theDisplay)
{
- myIsDisplayed = theDisplay;
- //static Events_Loop* aLoop = Events_Loop::loop();
- //static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- //static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
- //aECreator->sendUpdated(FieldStepPtr(this), EVENT_DISP);
+ if (myIsDisplayed != theDisplay) {
+ myIsDisplayed = theDisplay;
+ static Events_Loop* aLoop = Events_Loop::loop();
+ static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+ if (field()) {
+ aECreator->sendUpdated(field()->step(id()), EVENT_DISP); // updated pointer to this
+ }
+ }
}
if (toDisplay) {
for (int i = 0; i < aField->stepsSize(); i++) {
aField->step(i)->setDisplayed(false);
- // TODO: Sending events has to be removed when step will be defined as Object
- aECreator->sendUpdated(aField->step(i), EVENT_DISP);
}
}
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
aField->setDisplayed(false);
for (int i = 0; i < aField->stepsSize(); i++) {
aField->step(i)->setDisplayed(i == aId);
- // TODO: Sending events has to be removed when step will be defined as Object
- aECreator->sendUpdated(aField->step(i), EVENT_DISP);
}
}
else {