1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : QAD_Menus.cxx
25 // Author : Nicolas REJNERI
29 #include "QAD_Menus.h"
35 QAD_Menus::QAD_Menus(QMainWindow* theParent)
37 myMainWindow=theParent;
38 myToolBarList.setAutoDelete(TRUE);
44 QAD_Menus::~QAD_Menus()
46 myToolBarList.clear();
47 myPopupMenuList.clear();
48 myMenuBarList.clear();
55 void QAD_Menus::append(QMenuBar* theMenuBar)
57 myMenuBarList.append(theMenuBar);
63 void QAD_Menus::append(QToolBar* theToolBar)
65 myToolBarList.append(theToolBar);
71 void QAD_Menus::append(QAD_ListPopupMenu* thePopupMenu)
73 myPopupMenuList.append(thePopupMenu);
79 void QAD_Menus::append(QAD_ListMenuIdAction* theMenu)
81 myMenuList.append(theMenu);
87 void QAD_Menus::showToolBar(QToolBar* theToolBar)
89 if(theToolBar!=NULL && theToolBar->isHidden()) {
97 void QAD_Menus::showAllToolBars()
101 for(aToolBar=myToolBarList.first();aToolBar!=NULL;aToolBar=myToolBarList.next()) {
102 if(aToolBar->isHidden()) {
111 void QAD_Menus::hideToolBar(QToolBar* theToolBar)
113 if(theToolBar!=NULL && theToolBar->isVisible()) {
121 void QAD_Menus::hideAllToolBars()
125 for(aToolBar=myToolBarList.first();aToolBar!=NULL;aToolBar=myToolBarList.next()) {
126 if(aToolBar->isVisible()) {
135 void QAD_Menus::setActiveMenuBar(QMenuBar* theMenuBar)
137 myActiveMenuBar=theMenuBar;
141 Sets current setActivePopupMenu with index \a thePopupMenuIndex
143 void QAD_Menus::setActivePopupMenu(int thePopupMenuIndex)
145 myActivePopupMenu=myPopupMenuList.at(thePopupMenuIndex)->getPopup();
149 Sets current PopupMenu
151 void QAD_Menus::setActivePopupMenu(QPopupMenu* thePopupMenu)
153 myActivePopupMenu=thePopupMenu;
157 Sets current ToolBar with index \a theToolBarIndex
159 void QAD_Menus::setActiveToolBar(int theToolBarIndex)
161 myActiveToolBar=myToolBarList.at(theToolBarIndex);
167 void QAD_Menus::setActiveToolBar(QToolBar* theToolBar)
169 myActiveToolBar=theToolBar;