2 // File : QAD_Menus.cxx
3 // Created : Thu Jun 14 13:56:16 2001
4 // Author : Nicolas REJNERI
7 // Copyright : Open CASCADE
11 #include "QAD_Menus.h"
16 QAD_Menus::QAD_Menus(QMainWindow* theParent)
18 myMainWindow=theParent;
19 myToolBarList.setAutoDelete(TRUE);
25 QAD_Menus::~QAD_Menus()
27 myToolBarList.clear();
28 myPopupMenuList.clear();
29 myMenuBarList.clear();
36 void QAD_Menus::append(QMenuBar* theMenuBar)
38 myMenuBarList.append(theMenuBar);
44 void QAD_Menus::append(QToolBar* theToolBar)
46 myToolBarList.append(theToolBar);
52 void QAD_Menus::append(QAD_ListPopupMenu* thePopupMenu)
54 myPopupMenuList.append(thePopupMenu);
60 void QAD_Menus::append(QAD_ListMenuIdAction* theMenu)
62 myMenuList.append(theMenu);
68 void QAD_Menus::showToolBar(QToolBar* theToolBar)
70 if(theToolBar!=NULL && theToolBar->isHidden()) {
78 void QAD_Menus::showAllToolBars()
82 for(aToolBar=myToolBarList.first();aToolBar!=NULL;aToolBar=myToolBarList.next()) {
83 if(aToolBar->isHidden()) {
92 void QAD_Menus::hideToolBar(QToolBar* theToolBar)
94 if(theToolBar!=NULL && theToolBar->isVisible()) {
102 void QAD_Menus::hideAllToolBars()
106 for(aToolBar=myToolBarList.first();aToolBar!=NULL;aToolBar=myToolBarList.next()) {
107 if(aToolBar->isVisible()) {
116 void QAD_Menus::setActiveMenuBar(QMenuBar* theMenuBar)
118 myActiveMenuBar=theMenuBar;
122 Sets current setActivePopupMenu with index \a thePopupMenuIndex
124 void QAD_Menus::setActivePopupMenu(int thePopupMenuIndex)
126 myActivePopupMenu=myPopupMenuList.at(thePopupMenuIndex)->getPopup();
130 Sets current PopupMenu
132 void QAD_Menus::setActivePopupMenu(QPopupMenu* thePopupMenu)
134 myActivePopupMenu=thePopupMenu;
138 Sets current ToolBar with index \a theToolBarIndex
140 void QAD_Menus::setActiveToolBar(int theToolBarIndex)
142 myActiveToolBar=myToolBarList.at(theToolBarIndex);
148 void QAD_Menus::setActiveToolBar(QToolBar* theToolBar)
150 myActiveToolBar=theToolBar;