Salome HOME
Features editing commands
[modules/shaper.git] / src / XGUI / XGUI_MenuGroupPanel.h
index cda62888c6104459074158d7255f42b3deac481b..b43ef75c6e7175e3561c7294da3ee111c6791841 100644 (file)
@@ -1,40 +1,49 @@
-
 #ifndef XGUI_MenuGroupPanel_H
 #define XGUI_MenuGroupPanel_H
 
-#include "XGUI_Interfaces.h"
-
+#include "XGUI.h"
 #include <QWidget>
 #include <QMap>
 
-class QGridLayout;
 class XGUI_Command;
+class QGridLayout;
 
-class XGUI_MenuGroupPanel : public QWidget, public IMenuGroup
+/**\class XGUI_MenuGroupPanel
+ * \ingroup GUI
+ * \brief Represents a one group in a page of main menu (workbench)
+ */
+class XGUI_EXPORT XGUI_MenuGroupPanel: public QWidget
 {
-    Q_OBJECT
+Q_OBJECT
 public:
-    explicit XGUI_MenuGroupPanel(QWidget *parent = 0);
+  explicit XGUI_MenuGroupPanel(QWidget *parent = 0);
 
-    virtual IFeatureMenu* addFeature(const QString& theId, 
-                                     const QString& theTitle, 
-                                     const QString& theTip, 
-                                     const QIcon& theIcon, 
-                                     const QKeySequence& theKeys = QKeySequence());
+  //! Adding a new feature (Command) in the group
+  XGUI_Command* addFeature(const QString& theId, const QString& theTitle, const QString& theTip,
+                           const QIcon& theIcon, const QKeySequence& theKeys = QKeySequence(),
+                           bool isCheckable = false);
+
+  //! Returns already created command by its ID
+  XGUI_Command* feature(const QString& theId) const;
+
+  //! Returns list of created commands
+  QList<XGUI_Command*> features() const { return myActions; }
 
 protected:
-    virtual void resizeEvent(QResizeEvent *theEvent);
+  virtual void resizeEvent(QResizeEvent *theEvent);
 
 private:
-    void addWidget(QWidget* theWgt);
-    void placeWidget(QWidget* theWgt);
-    void addCommand(XGUI_Command* theAction);
-
-    QMap<XGUI_Command*, QWidget*> myActions;
-    QGridLayout* myLayout;
-    int myNewRow;
-    int myNewCol;
-    int myMaxRow;
+  void addWidget(QWidget* theWgt);
+  void placeWidget(QWidget* theWgt);
+  void addCommand(XGUI_Command* theAction);
+
+  QList<XGUI_Command*> myActions;
+  QWidgetList          myActionWidget;
+
+  QGridLayout* myLayout;
+  int myNewRow;
+  int myNewCol;
+  int myMaxRow;
 };
 
-#endif
\ No newline at end of file
+#endif