]> SALOME platform Git repositories - modules/kernel.git/blob - src/SALOMEGUI/QAD_Menus.cxx
Salome HOME
Initialisation de la base KERNEL avec la version operationnelle de KERNEL_SRC issue...
[modules/kernel.git] / src / SALOMEGUI / QAD_Menus.cxx
1 using namespace std;
2 //  File      : QAD_Menus.cxx
3 //  Created   : Thu Jun 14 13:56:16 2001
4 //  Author    : Nicolas REJNERI
5 //  Project   : SALOME
6 //  Module    : SALOMEGUI
7 //  Copyright : Open CASCADE
8 //  $Header$
9
10
11 #include "QAD_Menus.h"
12
13 /*!
14   Constructor.
15 */
16 QAD_Menus::QAD_Menus(QMainWindow* theParent)
17 {
18   myMainWindow=theParent;
19   myToolBarList.setAutoDelete(TRUE);
20 }
21
22 /*!
23   Desctructor.
24 */
25 QAD_Menus::~QAD_Menus()
26 {
27   myToolBarList.clear();
28   myPopupMenuList.clear();
29   myMenuBarList.clear();
30   myMenuList.clear();
31 }
32
33 /*!
34   Appends a MenuBar
35 */
36 void QAD_Menus::append(QMenuBar* theMenuBar)
37 {
38   myMenuBarList.append(theMenuBar);
39 }
40
41 /*!
42   Appends a ToolBar
43 */
44 void QAD_Menus::append(QToolBar* theToolBar)
45 {
46   myToolBarList.append(theToolBar);
47 }
48
49 /*!
50   Appends a PopupMenu
51 */
52 void QAD_Menus::append(QAD_ListPopupMenu* thePopupMenu)
53 {
54   myPopupMenuList.append(thePopupMenu);
55 }
56
57 /*!
58   Appends a MenuId
59 */
60 void QAD_Menus::append(QAD_ListMenuIdAction* theMenu)
61 {
62   myMenuList.append(theMenu);
63 }
64
65 /*!
66   Shows a ToolBar
67 */
68 void QAD_Menus::showToolBar(QToolBar* theToolBar)
69 {
70   if(theToolBar!=NULL && theToolBar->isHidden()) {
71     theToolBar->show();
72   }
73 }
74
75 /*!
76   Shows all ToolBars
77 */
78 void QAD_Menus::showAllToolBars()
79 {
80   QToolBar* aToolBar;
81   
82   for(aToolBar=myToolBarList.first();aToolBar!=NULL;aToolBar=myToolBarList.next()) {
83     if(aToolBar->isHidden()) {
84       aToolBar->show();
85     }
86   }
87 }
88
89 /*!
90   Hides a ToolBar
91 */
92 void QAD_Menus::hideToolBar(QToolBar* theToolBar)
93 {
94   if(theToolBar!=NULL && theToolBar->isVisible()) {
95     theToolBar->hide();
96   }
97 }
98
99 /*!
100   Hides all ToolBars
101 */
102 void QAD_Menus::hideAllToolBars()
103 {
104   QToolBar* aToolBar;
105   
106   for(aToolBar=myToolBarList.first();aToolBar!=NULL;aToolBar=myToolBarList.next()) {
107     if(aToolBar->isVisible()) {
108       aToolBar->hide();
109     }
110   }
111 }
112
113 /*!
114   Sets current MenuBar
115 */
116 void QAD_Menus::setActiveMenuBar(QMenuBar* theMenuBar)
117 {
118   myActiveMenuBar=theMenuBar;
119 }
120
121 /*!
122   Sets current setActivePopupMenu with index \a thePopupMenuIndex
123 */
124 void QAD_Menus::setActivePopupMenu(int thePopupMenuIndex)
125 {
126   myActivePopupMenu=myPopupMenuList.at(thePopupMenuIndex)->getPopup();
127 }
128
129 /*!
130   Sets current PopupMenu
131 */
132 void QAD_Menus::setActivePopupMenu(QPopupMenu* thePopupMenu)
133 {
134   myActivePopupMenu=thePopupMenu;
135 }
136
137 /*!
138   Sets current ToolBar with index \a theToolBarIndex
139 */
140 void QAD_Menus::setActiveToolBar(int theToolBarIndex)
141 {
142   myActiveToolBar=myToolBarList.at(theToolBarIndex);
143 }
144
145 /*!
146   Sets current ToolBar
147 */
148 void QAD_Menus::setActiveToolBar(QToolBar* theToolBar)
149 {
150   myActiveToolBar=theToolBar;
151 }