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