X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MenuGroupPanel.h;h=b43ef75c6e7175e3561c7294da3ee111c6791841;hb=00265e8a59b2eff159cef64eef8de47ed4b9b728;hp=9c72384d19d6c25dde6999eda0418cd3bf646d74;hpb=5bd491bf7444d3859f91ed88142e6186d8881f6e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MenuGroupPanel.h b/src/XGUI/XGUI_MenuGroupPanel.h index 9c72384d1..b43ef75c6 100644 --- a/src/XGUI/XGUI_MenuGroupPanel.h +++ b/src/XGUI/XGUI_MenuGroupPanel.h @@ -1,38 +1,49 @@ - #ifndef XGUI_MenuGroupPanel_H #define XGUI_MenuGroupPanel_H +#include "XGUI.h" #include #include class XGUI_Command; class QGridLayout; -class XGUI_MenuGroupPanel : public QWidget +/**\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); + + //! 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; - XGUI_Command* addFeature(const QString& theId, - const QString& theTitle, - const QString& theTip, - const QIcon& theIcon, - const QKeySequence& theKeys = QKeySequence()); + //! Returns list of created commands + QList 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 myActions; - QGridLayout* myLayout; - int myNewRow; - int myNewCol; - int myMaxRow; + void addWidget(QWidget* theWgt); + void placeWidget(QWidget* theWgt); + void addCommand(XGUI_Command* theAction); + + QList myActions; + QWidgetList myActionWidget; + + QGridLayout* myLayout; + int myNewRow; + int myNewCol; + int myMaxRow; }; #endif