Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_MenuGroupPanel.cpp
index 4f447117c97e1c6021f99d2aee9ba0a5777762e3..48a9ce1a87bc81f01734676f6e174917c193a3df 100644 (file)
@@ -7,6 +7,7 @@
 #include <QResizeEvent>
 
 #include <math.h>
+#include <iostream>
 
 XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent)
     : QWidget(parent), myNewRow(0), myNewCol(0), myMaxRow(1)
@@ -61,9 +62,9 @@ void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent)
 
 XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle,
                                               const QString& theTip, const QIcon& theIcon,
-                                              const QKeySequence& theKeys)
+                                              const QKeySequence& theKeys, bool isCheckable)
 {
-  XGUI_Command* aCommand = new XGUI_Command(theId, theIcon, theTitle, this);
+  XGUI_Command* aCommand = new XGUI_Command(theId, theIcon, theTitle, this, isCheckable);
   aCommand->setToolTip(theTip);
   if (!theKeys.isEmpty())
     aCommand->setShortcut(theKeys);
@@ -71,3 +72,13 @@ XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QStrin
   addCommand(aCommand);
   return aCommand;
 }
+
+
+XGUI_Command* XGUI_MenuGroupPanel::feature(const QString& theId) const
+{
+  foreach (XGUI_Command* aCmd, myActions) {
+    if (aCmd->data().toString() == theId)
+      return aCmd;
+  }
+  return 0;
+}