]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_WidgetSketchLabel.cpp
Salome HOME
Create check box "Show constraints"
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchLabel.cpp
index e70a8a0975dedcdab221a48d4d8c8ad9fae1e85f..1b645c062821a47d4190355106ae8cb9fa8989a1 100644 (file)
 #include <QTimer>
 #include <QApplication>
 #include <QVBoxLayout>
+#include <QCheckBox>
 
 
 PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
                                                      const Config_WidgetAPI* theData,
-                                                     const std::string& theParentId)
+                                                     const std::string& theParentId,
+                                                     bool toShowConstraints)
     : ModuleBase_WidgetValidated(theParent, theData, theParentId),
       myPreviewDisplayed(false),
       myWorkshop(NULL)
@@ -65,7 +67,13 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
   QVBoxLayout* aLayout = new QVBoxLayout(this);
   ModuleBase_Tools::zeroMargins(aLayout);
   aLayout->addWidget(myLabel);
+
+  myShowConstraints = new QCheckBox(tr("Show constraints"), this);
+  aLayout->addWidget(myShowConstraints);
+
   setLayout(aLayout);
+  connect(myShowConstraints, SIGNAL(toggled(bool)), this, SIGNAL(showConstraintToggled(bool)));
+  myShowConstraints->setChecked(toShowConstraints);
 }
 
 PartSet_WidgetSketchLabel::~PartSet_WidgetSketchLabel()
@@ -359,3 +367,9 @@ void PartSet_WidgetSketchLabel::setSketchingMode()
 
   aDisp->activateObjects(aModes);
 }
+
+void PartSet_WidgetSketchLabel::showConstraints(bool theOn)
+{
+  myShowConstraints->setChecked(theOn);
+  emit showConstraintToggled(theOn);
+}