X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Command.h;h=4247a7ca4b8be681ee54c0649bd5aea6f4cbdadd;hb=2e6153d900999f7ddc85ba595ef5c74474fc796c;hp=b1227ba2e88335a0636ee9c3416141477ddf516d;hpb=10c74b99318f5265c9a60a178932b03f69adfee5;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Command.h b/src/XGUI/XGUI_Command.h index b1227ba2e..4247a7ca4 100644 --- a/src/XGUI/XGUI_Command.h +++ b/src/XGUI/XGUI_Command.h @@ -1,37 +1,32 @@ #ifndef XGUI_Command_H #define XGUI_Command_H +#include "XGUI.h" #include -#define MIN_BUTTON_HEIGHT 18 -#define MIN_BUTTON_WIDTH 40 +#define MIN_BUTTON_HEIGHT 25 +#define MIN_BUTTON_WIDTH 60 /**\class XGUI_Command * \ingroup GUI * \brief Represents a command item in the application menu (Workbench) */ -class XGUI_Command: public QWidgetAction +class XGUI_EXPORT XGUI_Command: public QWidgetAction { Q_OBJECT public: - XGUI_Command(const QString& theId, QObject * parent); - XGUI_Command(const QString& theId, const QIcon& icon, const QString& text, QObject* parent); + XGUI_Command(const QString& theId, QObject * parent, bool isCheckable = false); + XGUI_Command(const QString& theId, const QIcon& icon, const QString& text, QObject* parent, bool isCheckable = false); ~XGUI_Command(); - //! Returns true if the command is enabled - virtual bool enabled() const; - - //! Set the command enabled - virtual void enable(); - - //! Set the command disabled - virtual void disable(); - - //! Returns Id of the command - virtual QString id() const + //VSV: Don't use this method for compatibility with SALOME. Use the construction below + /*virtual QString id() const { - return myId; - } + return data().toString(); + }*/ + + const QStringList& nestedCommands() const; + void setNestedCommands(const QStringList& myUnblockableCommands); //! Connect the command to a slot virtual void connectTo(const QObject* theResiver, const char* theSlot); @@ -41,7 +36,9 @@ protected: virtual QWidget* createWidget(QWidget* theParent); private: - QString myId; + bool myCheckable; + //! List of Ids of commands which WILL NOT be blocked when the command is on. + QStringList myNestedCommands; }; #endif