Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git]
/
src
/
XGUI
/
XGUI_ContextMenuMgr.h
diff --git
a/src/XGUI/XGUI_ContextMenuMgr.h
b/src/XGUI/XGUI_ContextMenuMgr.h
index 3ce0051fda314ed9624d02be22465e2b5750df58..a48bd79c770d442bab75cf086aa5a2d108f73b44 100644
(file)
--- a/
src/XGUI/XGUI_ContextMenuMgr.h
+++ b/
src/XGUI/XGUI_ContextMenuMgr.h
@@
-12,6
+12,9
@@
class QAction;
class QContextMenuEvent;
class QMenu;
class QContextMenuEvent;
class QMenu;
+/**
+* A claas wihich provides manement of context menu
+*/
class XGUI_EXPORT XGUI_ContextMenuMgr: public QObject
{
Q_OBJECT
class XGUI_EXPORT XGUI_ContextMenuMgr: public QObject
{
Q_OBJECT
@@
-19,18
+22,27
@@
public:
XGUI_ContextMenuMgr(XGUI_Workshop* theParent);
virtual ~XGUI_ContextMenuMgr();
XGUI_ContextMenuMgr(XGUI_Workshop* theParent);
virtual ~XGUI_ContextMenuMgr();
+ /// Create all actions for context menus. It is called on creation of application
void createActions();
void createActions();
- void addAction(const QString& theId, QAction* theAction);
-
+ /// Returns action according to the given ID
QAction* action(const QString& theId) const;
QAction* action(const QString& theId) const;
+ /// Returns list of registered actions Ids
QStringList actionIds() const;
QStringList actionIds() const;
+ /// update state of internal commands
void updateCommandsStatus();
void updateCommandsStatus();
+ /// Connect to object browser from workshop. Has to called at creation of viewer.
void connectObjectBrowser() const;
void connectObjectBrowser() const;
+ /// Connect to viewer from workshop. Has to called at creation of viewer.
+ void connectViewer() const;
+
+ /// Add menu atems for viewer into the given menu (used in SALOME mode)
+ void addViewerItems(QMenu* theMenu) const;
+
signals:
void actionTriggered(const QString& theId, bool isChecked);
signals:
void actionTriggered(const QString& theId, bool isChecked);
@@
-40,7
+52,16
@@
private slots:
void onContextMenuRequest(QContextMenuEvent* theEvent);
private:
void onContextMenuRequest(QContextMenuEvent* theEvent);
private:
+ /**
+ * Add action
+ * \param theId - string ID of the item
+ * \param theAction - action to add
+ */
+ void addAction(const QString& theId, QAction* theAction);
+
+
QMenu* objectBrowserMenu() const;
QMenu* objectBrowserMenu() const;
+ QMenu* viewerMenu() const;
QMap<QString, QAction*> myActions;
QMap<QString, QAction*> myActions;