2 // File : QAD_OperatorMenus.cxx
3 // Created : Thu Jun 14 14:37:17 2001
4 // Author : Nicolas REJNERI
7 // Copyright : Open CASCADE
10 #include "QAD_OperatorMenus.h"
11 #include "QAD_Desktop.h"
16 QAD_OperatorMenus::QAD_OperatorMenus(QAD_Desktop* theDesktop)
24 QAD_OperatorMenus::~QAD_OperatorMenus()
29 Builds popup menu with a 'Context', a 'Parent' and an 'Object'.
30 Parent is equal to 'Objectbrowser' or 'Viewer'.
32 QAD_ListPopupMenu* QAD_OperatorMenus::createPopupMenu(const QString & theContext,
33 const QString & theParent,
34 const QString & theObject)
36 QAD_Menus* aMenus = myDesktop->getActiveMenus();
37 QAD_ListPopupMenu* aPopup;
39 QList<QAD_ListPopupMenu> PopupList = aMenus->getPopupMenuList();
41 for(aPopup=PopupList.first();aPopup!=NULL;aPopup=PopupList.next()){
42 if ((aPopup->getContext().compare(theContext)==0) &&
43 (aPopup->getParent().compare(theParent)==0) &&
44 (aPopup->getObject().compare(theObject)==0)) {
51 QAD_ListPopupMenu* QAD_OperatorMenus::createPopupMenu(int thePopupMenuId)
53 QAD_Menus* aMenus = myDesktop->getActiveMenus();
55 if(!aMenus->getPopupMenuList().isEmpty() &&
56 aMenus->getPopupMenuList().at(thePopupMenuId)!=NULL) {
57 return aMenus->getPopupMenuList().at(thePopupMenuId);
62 void QAD_OperatorMenus::showMenuBar(int theMenuBarId)
65 QAD_Menus* aMenus = myDesktop->getActiveMenus();
66 if(!aMenus->getMenuBarList().isEmpty() &&
67 aMenus->getMenuBarList().at(theMenuBarId)!=NULL) {
68 aMenus->getMenuBarList().at(theMenuBarId)->show();
72 void QAD_OperatorMenus::hideMenuBar(int theMenuBarId)
76 aMenus=myDesktop->getActiveMenus();
77 if(!aMenus->getMenuBarList().isEmpty() &&
78 aMenus->getMenuBarList().at(theMenuBarId)!=NULL) {
79 aMenus->getMenuBarList().at(theMenuBarId)->hide();
83 void QAD_OperatorMenus::showToolBar(int theToolBarId)
88 aMenus=myDesktop->getActiveMenus();
89 if(!aMenus->getToolBarList().isEmpty() &&
90 aMenus->getToolBarList().at(theToolBarId)!=NULL) {
91 aMenus->getToolBarList().at(theToolBarId)->show();
95 void QAD_OperatorMenus::hideToolBar(int theToolBarId)
100 aMenus=myDesktop->getActiveMenus();
101 if(!aMenus->getToolBarList().isEmpty() &&
102 aMenus->getToolBarList().at(theToolBarId)!=NULL) {
103 aMenus->getToolBarList().at(theToolBarId)->hide();