Salome HOME
SketchShapePlugin: checked group box/multi editor controls, which highlight the paren...
[modules/shaper.git] / src / SketchShapePlugin / SketchShapePlugin_WidgetMultiSelector.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchShapePlugin_PageGroupBox.h
4 // Created:     13 Dec 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #include <SketchShapePlugin_WidgetMultiSelector.h>
8
9 #include <SketchShapePlugin_PageGroupBox.h>
10
11 #include <ModuleBase_IWorkshop.h>
12
13 #include <Config_WidgetAPI.h>
14
15 SketchShapePlugin_WidgetMultiSelector::SketchShapePlugin_WidgetMultiSelector(QWidget* theParent,
16                                                                ModuleBase_IWorkshop* theWorkshop,
17                                                                const Config_WidgetAPI* theData,
18                                                                const std::string& theParentId)
19   : ModuleBase_WidgetMultiSelector(theParent, theWorkshop, theData, theParentId)
20 {
21 }
22
23 void SketchShapePlugin_WidgetMultiSelector::setHighlighted(bool isHighlighted)
24 {
25   SketchShapePlugin_PageGroupBox* aShapeGroupBox = 0;
26   QWidget* aParent = qobject_cast<QWidget*>(parent());
27   while (aParent) {
28     aShapeGroupBox = dynamic_cast<SketchShapePlugin_PageGroupBox*>(aParent);
29     if (aShapeGroupBox)
30       break;
31     aParent = qobject_cast<QWidget*>(aParent->parent());
32   }
33
34   if (aShapeGroupBox)
35     aShapeGroupBox->setHighlightedGroupBox(isHighlighted);
36 }
37