* Add the specified action as an item in the popup menu, with the
* specified visible rule. The default is "visible for object browser".
*/
-void StandardApp_Module::addActionInPopupMenu(int actionId,const QString& rule) {
+void StandardApp_Module::addActionInPopupMenu(int actionId,const QString& menus,const QString& rule) {
// _GBO_ for a fine customization of the rule (for example with a
// test on the type of the selected object), see the LIGTH module:
// implement "LightApp_Selection* createSelection() const;"
int parentId = -1;
QtxPopupMgr* mgr = this->popupMgr();
this->action( actionId )->setIconVisibleInMenu(true);
- mgr->insert ( this->action( actionId ), parentId, 0 );
+ if (! menus.isEmpty())
+ mgr->insert ( this->action( actionId ), menus, parentId, 0 );
+ else
+ mgr->insert ( this->action( actionId ), parentId, 0 );
mgr->setRule( this->action( actionId ), rule, QtxPopupMgr::VisibleRule );
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Guillaume Boulant (EDF)
+// Author : Guillaume Boulant (EDF)
#ifndef _STANDARDAPP_MODULE_HXX_
#define _STANDARDAPP_MODULE_HXX_
public:
/* Creates an action with standard default values */
int createStandardAction(const QString& label,
- QObject * slotobject,
+ QObject * slotobject,
const char* slotmember,
const QString& iconName=QString(),
const QString& tooltip=QString(),
void addActionInToolbar(int actionId);
void addActionInMenubar(int actionId, int menuId=UNSPECIFIED_INT);
- void addActionInPopupMenu(int actionId,const QString& rule="client='ObjectBrowser'");
+ void addActionInPopupMenu(int actionId,const QString& menus="",const QString& rule="client='ObjectBrowser'");
protected:
/* Implement this to create additionnal widget (e.g. docked widget) */
};
virtual void setDockLayout(DockLayoutType layoutType);
virtual void unsetDockLayout();
-
+
SUIT_ResourceMgr* _resourceMgr;
int _defaultMenuId;
int _defaultToolbarId;