Salome HOME
Release version on WIndows
[modules/shaper.git] / src / XGUI / XGUI_MenuGroupPanel.h
1 #ifndef XGUI_MenuGroupPanel_H
2 #define XGUI_MenuGroupPanel_H
3
4 #include <QWidget>
5 #include <QMap>
6
7 class XGUI_Command;
8 class QGridLayout;
9
10 /**\class XGUI_MenuGroupPanel
11  * \ingroup GUI
12  * \brief Represents a one group in a page of main menu (workbench)
13  */
14 class XGUI_MenuGroupPanel: public QWidget
15 {
16 Q_OBJECT
17 public:
18   explicit XGUI_MenuGroupPanel(QWidget *parent = 0);
19
20   //! Adding a new feature (Command) in the group
21   XGUI_Command* addFeature(const QString& theId, const QString& theTitle, const QString& theTip,
22                            const QIcon& theIcon, const QKeySequence& theKeys = QKeySequence());
23
24   //! Returns already created command by its ID
25   XGUI_Command* feature(const QString& theId) const;
26
27   //! Returns list of created commands
28   QList<XGUI_Command*> features() const { return myActions; }
29
30 protected:
31   virtual void resizeEvent(QResizeEvent *theEvent);
32
33 private:
34   void addWidget(QWidget* theWgt);
35   void placeWidget(QWidget* theWgt);
36   void addCommand(XGUI_Command* theAction);
37
38   QList<XGUI_Command*> myActions;
39   QWidgetList          myActionWidget;
40
41   QGridLayout* myLayout;
42   int myNewRow;
43   int myNewCol;
44   int myMaxRow;
45 };
46
47 #endif