myActivePart(0)
{
// Register in event loop
- Events_Loop* aLoop = Events_Loop::loop();
- aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
- aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
- aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED));
+ //Events_Loop* aLoop = Events_Loop::loop();
+ //aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+ //aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ //aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED));
// Create a top part of data tree model
myModel = new XGUI_TopDataModel(this);
}
}
}
+
+//***************************************************
+void XGUI_ObjectsBrowser::processEvent(const Events_Message* theMessage)
+{
+ myDocModel->processEvent(theMessage);
+}
#include <ModuleBase_Definitions.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Events.h>
#include <QWidget>
#include <QTreeView>
void rebuildDataTree();
+ void processEvent(const Events_Message* theMessage);
+
signals:
//! Emited when selection is changed
void selectionChanged();
}
}
myOperationMgr->validateCurrentOperation();
+ if (myObjectBrowser)
+ myObjectBrowser->processEvent(theMsg);
}
//******************************************************
}
}
}
+ if (myObjectBrowser)
+ myObjectBrowser->processEvent(theMsg);
if (isDisplayed)
myDisplayer->updateViewer();
if (aHasPart) {
- //The created part will be created in Object Browser later and we have to activate it
- // only when it is created everywere
- QTimer::singleShot(50, this, SLOT(activateLastPart()));
+ activateLastPart();
}
}
//******************************************************
void XGUI_Workshop::onObjectDeletedMsg(const ModelAPI_ObjectDeletedMessage* theMsg)
{
+ if (myObjectBrowser)
+ myObjectBrowser->processEvent(theMsg);
//std::set<ObjectPtr> aFeatures = theMsg->objects();
}
std::string aGrpName = ModelAPI_ResultPart::group();
ObjectPtr aLastPart = aDoc->object(aGrpName, aDoc->size(aGrpName) - 1);
ResultPartPtr aPart = boost::dynamic_pointer_cast<ModelAPI_ResultPart>(aLastPart);
- if (aPart)
+ if (aPart) {
activatePart(aPart);
+ }
}
//**************************************************************