Salome HOME
refs #193: OCC viwer problems when move line
[modules/shaper.git] / src / XGUI / XGUI_MenuGroupPanel.cpp
index f268c369122f0d70094eb6546747a7b1d506d71c..a1883f26baec7d7eb14dce73bb02302f07784e91 100644 (file)
 #include <iostream>
 
 XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent)
-    : QFrame(parent), myNewRow(0), myNewCol(0), myMaxRow(1)
+    : QFrame(parent),
+      myNewRow(0),
+      myNewCol(0),
+      myMaxRow(1)
 {
   myLayout = new QGridLayout(this);
   myLayout->setSpacing(0);
@@ -19,8 +22,6 @@ XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent)
   setFrameShape(QFrame::NoFrame);
 }
 
-
-
 void XGUI_MenuGroupPanel::addCommand(XGUI_Command* theAction)
 {
   myActions.append(theAction);
@@ -59,17 +60,32 @@ void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent)
   myMaxRow = aMaxRow;
   myNewRow = 0;
   myNewCol = 0;
-  foreach(QWidget* eachWidget, myActionWidget) {
+  foreach(QWidget* eachWidget, myActionWidget)
+  {
     placeWidget(eachWidget);
   }
-  myLayout->setRowStretch(myMaxRow + 1,  1);
+  myLayout->setRowStretch(myMaxRow + 1, 1);
+}
+
+XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId,
+                                              const QString& theTip,
+                                              const QString& theTitle,
+                                              const QIcon& theIcon,
+                                              const QKeySequence& theKeys)
+{
+  return addFeature(theId, theTip, theTitle, theIcon, QString(), theKeys, false);
 }
 
-XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle,
-                                              const QString& theTip, const QIcon& theIcon,
-                                              const QKeySequence& theKeys, bool isCheckable)
+XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId,
+                                              const QString& theTitle,
+                                              const QString& theTip,
+                                              const QIcon& theIcon,
+                                              const QString& theDocumentKind,
+                                              const QKeySequence& theKeys,
+                                              bool isCheckable)
 {
-  XGUI_Command* aCommand = new XGUI_Command(theId, theIcon, theTitle, this, isCheckable);
+  XGUI_Command* aCommand = new XGUI_Command(theId, theDocumentKind, theIcon,
+                                            theTitle, this, isCheckable);
   aCommand->setToolTip(theTip);
   if (!theKeys.isEmpty()) {
     aCommand->setShortcut(theKeys);
@@ -78,10 +94,10 @@ XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QStrin
   return aCommand;
 }
 
-
 XGUI_Command* XGUI_MenuGroupPanel::feature(const QString& theId) const
 {
-  foreach (XGUI_Command* aCmd, myActions) {
+  foreach (XGUI_Command* aCmd, myActions)
+  {
     if (aCmd->data().toString() == theId)
       return aCmd;
   }