Salome HOME
Command New Document provided
[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 protected:
25   virtual void resizeEvent(QResizeEvent *theEvent);
26
27 private:
28   void addWidget(QWidget* theWgt);
29   void placeWidget(QWidget* theWgt);
30   void addCommand(XGUI_Command* theAction);
31
32   QList<XGUI_Command*> myActions;
33   QWidgetList          myActionWidget;
34
35   QGridLayout* myLayout;
36   int myNewRow;
37   int myNewCol;
38   int myMaxRow;
39 };
40
41 #endif