Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[modules/shaper.git] / src / PartSet / PartSet_WidgetEditor.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetShapeSelector.cpp
4 // Created:     27 Nov 2014
5 // Author:      Vitaly Smetannikov
6
7 #include "PartSet_WidgetEditor.h"
8 #include "PartSet_Module.h"
9
10 #include <ModuleBase_IWorkshop.h>
11
12 #include <Config_WidgetAPI.h>
13
14 #include <QWidget>
15
16 PartSet_WidgetEditor::PartSet_WidgetEditor(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
17                                            const Config_WidgetAPI* theData,
18                                            const std::string& theParentId)
19  : ModuleBase_WidgetEditor(theParent, theData, theParentId), myWorkshop(theWorkshop)
20 {
21 }
22
23 bool PartSet_WidgetEditor::focusTo()
24 {
25   PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
26   if (aModule->isMouseOverWindow())
27     return ModuleBase_WidgetEditor::focusTo();
28   else {
29     return ModuleBase_WidgetDoubleValue::focusTo();
30   }
31 }