#include "XGUI_Tools.h"
#include "XGUI_Workshop.h"
-
#include <ModuleBase_IModule.h>
#include <ModuleBase_IWorkshop.h>
+//#define DEBUG_ACTIVE_SELECTOR
+
+#ifdef DEBUG_ACTIVE_SELECTOR
+void debugInfo(const QString& theMessage, XGUI_ActiveControlSelector* theSelector)
+{
+ std::cout << theMessage.toStdString().c_str() << ", active: "
+ << theSelector ? theSelector->getType().toStdString().c_str() : "NULL" << std::endl;
+}
+#endif
+
//********************************************************************
XGUI_ActiveControlMgr::XGUI_ActiveControlMgr(ModuleBase_IWorkshop* theWorkshop)
: myWorkshop(theWorkshop), myActiveSelector(0)
activateSelector(aSelector);
XGUI_Tools::workshop(myWorkshop)->selectionActivate()->updateSelectionModes();
XGUI_Tools::workshop(myWorkshop)->selectionActivate()->updateSelectionFilters();
+
+#ifdef DEBUG_ACTIVE_SELECTOR
+ debugInfo("onSelectorActivated", myActiveSelector);
+#endif
}
//********************************************************************
return;
myActiveSelector->setActive(false);
- myActiveSelector = NULL;
+ activateSelector(NULL);
XGUI_ActiveControlSelector* aSelectorToBeActivated = 0;
for (int i = 0, aCount = mySelectors.count(); i < aCount; i++)
XGUI_Tools::workshop(myWorkshop)->selectionActivate()->updateSelectionModes();
XGUI_Tools::workshop(myWorkshop)->selectionActivate()->updateSelectionFilters();
+#ifdef DEBUG_ACTIVE_SELECTOR
+ debugInfo("onSelectorDeactivated", myActiveSelector);
+#endif
}
//********************************************************************
return;
myActiveSelector->processSelection();
+#ifdef DEBUG_ACTIVE_SELECTOR
+ debugInfo("onSelectionChanged", myActiveSelector);
+#endif
}
//********************************************************************
void XGUI_ActiveControlMgr::activateSelector(XGUI_ActiveControlSelector* theSelector)
{
myActiveSelector = theSelector;
- theSelector->setActive(true);
+ if (myActiveSelector)
+ myActiveSelector->setActive(true);
}