1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qmenubar.h:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>qmenubar.h Include File</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qmenubar.h</h1>
|
---|
33 |
|
---|
34 | <p>This is the verbatim text of the qmenubar.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
35 | <hr>
|
---|
36 | <pre>
|
---|
37 | /****************************************************************************
|
---|
38 | ** $Id: qmenubar-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
39 | **
|
---|
40 | ** Definition of QMenuBar class
|
---|
41 | **
|
---|
42 | ** Created : 941209
|
---|
43 | **
|
---|
44 | ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
---|
45 | **
|
---|
46 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
---|
47 | **
|
---|
48 | ** This file may be distributed under the terms of the Q Public License
|
---|
49 | ** as defined by Trolltech ASA of Norway and appearing in the file
|
---|
50 | ** LICENSE.QPL included in the packaging of this file.
|
---|
51 | **
|
---|
52 | ** This file may be distributed and/or modified under the terms of the
|
---|
53 | ** GNU General Public License version 2 as published by the Free Software
|
---|
54 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
55 | ** packaging of this file.
|
---|
56 | **
|
---|
57 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
58 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
59 | ** Agreement provided with the Software.
|
---|
60 | **
|
---|
61 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
62 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
63 | **
|
---|
64 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
65 | ** information about Qt Commercial License Agreements.
|
---|
66 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
67 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
68 | **
|
---|
69 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
70 | ** not clear to you.
|
---|
71 | **
|
---|
72 | **********************************************************************/
|
---|
73 |
|
---|
74 | #ifndef QMENUBAR_H
|
---|
75 | #define QMENUBAR_H
|
---|
76 |
|
---|
77 | #ifndef QT_H
|
---|
78 | #include "qpopupmenu.h" // ### remove or keep for users' convenience?
|
---|
79 | #include "qframe.h"
|
---|
80 | #include "qmenudata.h"
|
---|
81 | #endif // QT_H
|
---|
82 |
|
---|
83 | #ifndef QT_NO_MENUBAR
|
---|
84 |
|
---|
85 | class QPopupMenu;
|
---|
86 |
|
---|
87 | class Q_EXPORT QMenuBar : public QFrame, public QMenuData
|
---|
88 | {
|
---|
89 | Q_OBJECT
|
---|
90 | Q_ENUMS( Separator )
|
---|
91 | Q_PROPERTY( Separator separator READ separator WRITE setSeparator DESIGNABLE false )
|
---|
92 | Q_PROPERTY( bool defaultUp READ isDefaultUp WRITE setDefaultUp )
|
---|
93 |
|
---|
94 | public:
|
---|
95 | QMenuBar( QWidget* parent=0, const char* name=0 );
|
---|
96 | ~QMenuBar();
|
---|
97 |
|
---|
98 | void updateItem( int id );
|
---|
99 |
|
---|
100 | void show(); // reimplemented show
|
---|
101 | void hide(); // reimplemented hide
|
---|
102 |
|
---|
103 | bool eventFilter( QObject *, QEvent * );
|
---|
104 |
|
---|
105 | int heightForWidth(int) const;
|
---|
106 |
|
---|
107 | enum Separator { Never=0, InWindowsStyle=1 };
|
---|
108 | Separator separator() const;
|
---|
109 | virtual void setSeparator( Separator when );
|
---|
110 |
|
---|
111 | void setDefaultUp( bool );
|
---|
112 | bool isDefaultUp() const;
|
---|
113 |
|
---|
114 | bool customWhatsThis() const;
|
---|
115 |
|
---|
116 | QSize sizeHint() const;
|
---|
117 | QSize minimumSize() const;
|
---|
118 | QSize minimumSizeHint() const;
|
---|
119 |
|
---|
120 | void activateItemAt( int index );
|
---|
121 |
|
---|
122 | #if defined(Q_WS_MAC) && !defined(QMAC_QMENUBAR_NO_NATIVE)
|
---|
123 | static void initialize();
|
---|
124 | static void cleanup();
|
---|
125 | #endif
|
---|
126 |
|
---|
127 | signals:
|
---|
128 | void activated( int itemId );
|
---|
129 | void highlighted( int itemId );
|
---|
130 |
|
---|
131 | protected:
|
---|
132 | void drawContents( QPainter * );
|
---|
133 | void fontChange( const QFont & );
|
---|
134 | void mousePressEvent( QMouseEvent * );
|
---|
135 | void mouseReleaseEvent( QMouseEvent * );
|
---|
136 | void mouseMoveEvent( QMouseEvent * );
|
---|
137 | void keyPressEvent( QKeyEvent * );
|
---|
138 | void focusInEvent( QFocusEvent * );
|
---|
139 | void focusOutEvent( QFocusEvent * );
|
---|
140 | void resizeEvent( QResizeEvent * );
|
---|
141 | void leaveEvent( QEvent * );
|
---|
142 | void menuContentsChanged();
|
---|
143 | void menuStateChanged();
|
---|
144 | void styleChange( QStyle& );
|
---|
145 | int itemAtPos( const QPoint & );
|
---|
146 | void hidePopups();
|
---|
147 | QRect itemRect( int item );
|
---|
148 |
|
---|
149 | private slots:
|
---|
150 | void subActivated( int itemId );
|
---|
151 | void subHighlighted( int itemId );
|
---|
152 | #ifndef QT_NO_ACCEL
|
---|
153 | void accelActivated( int itemId );
|
---|
154 | void accelDestroyed();
|
---|
155 | #endif
|
---|
156 | void popupDestroyed( QObject* );
|
---|
157 | void performDelayedChanges();
|
---|
158 |
|
---|
159 | void languageChange();
|
---|
160 |
|
---|
161 | private:
|
---|
162 | void performDelayedContentsChanged();
|
---|
163 | void performDelayedStateChanged();
|
---|
164 | void menuInsPopup( QPopupMenu * );
|
---|
165 | void menuDelPopup( QPopupMenu * );
|
---|
166 | void frameChanged();
|
---|
167 |
|
---|
168 | bool tryMouseEvent( QPopupMenu *, QMouseEvent * );
|
---|
169 | void tryKeyEvent( QPopupMenu *, QKeyEvent * );
|
---|
170 | void goodbye( bool cancelled = FALSE );
|
---|
171 | void openActPopup();
|
---|
172 |
|
---|
173 | void setActiveItem( int index, bool show = TRUE, bool activate_first_item = TRUE );
|
---|
174 | void setAltMode( bool );
|
---|
175 |
|
---|
176 | int calculateRects( int max_width = -1 );
|
---|
177 |
|
---|
178 | #ifndef QT_NO_ACCEL
|
---|
179 | void setupAccelerators();
|
---|
180 | QAccel *autoaccel;
|
---|
181 | #endif
|
---|
182 | QRect *irects;
|
---|
183 | int rightSide;
|
---|
184 |
|
---|
185 | uint mseparator : 1;
|
---|
186 | uint waitforalt : 1;
|
---|
187 | uint popupvisible : 1;
|
---|
188 | uint hasmouse : 1;
|
---|
189 | uint defaultup : 1;
|
---|
190 | uint toggleclose : 1;
|
---|
191 | uint pendingDelayedContentsChanges : 1;
|
---|
192 | uint pendingDelayedStateChanges : 1;
|
---|
193 |
|
---|
194 | friend class QPopupMenu;
|
---|
195 |
|
---|
196 | #if defined(Q_WS_MAC) && !defined(QMAC_QMENUBAR_NO_NATIVE)
|
---|
197 | friend class QWidget;
|
---|
198 | friend class QApplication;
|
---|
199 | friend void qt_mac_set_modal_state(bool, QMenuBar *);
|
---|
200 |
|
---|
201 | void macCreateNativeMenubar();
|
---|
202 | void macRemoveNativeMenubar();
|
---|
203 | void macDirtyNativeMenubar();
|
---|
204 |
|
---|
205 | #if !defined(QMAC_QMENUBAR_NO_EVENT)
|
---|
206 | static void qt_mac_install_menubar_event(MenuRef);
|
---|
207 | static OSStatus qt_mac_menubar_event(EventHandlerCallRef, EventRef, void *);
|
---|
208 | #endif
|
---|
209 | virtual void macWidgetChangedWindow();
|
---|
210 | bool syncPopups(MenuRef ret, QPopupMenu *d);
|
---|
211 | MenuRef createMacPopup(QPopupMenu *d, int id, bool =FALSE);
|
---|
212 | bool updateMenuBar();
|
---|
213 | #if !defined(QMAC_QMENUBAR_NO_MERGE)
|
---|
214 | uint isCommand(QMenuItem *, bool just_check=FALSE);
|
---|
215 | #endif
|
---|
216 |
|
---|
217 | uint mac_eaten_menubar : 1;
|
---|
218 | class MacPrivate;
|
---|
219 | MacPrivate *mac_d;
|
---|
220 | static bool activate(MenuRef, short, bool highlight=FALSE, bool by_accel=FALSE);
|
---|
221 | static bool activateCommand(uint cmd);
|
---|
222 | static bool macUpdateMenuBar();
|
---|
223 | static bool macUpdatePopupVisible(MenuRef, bool);
|
---|
224 | static bool macUpdatePopup(MenuRef);
|
---|
225 | #endif
|
---|
226 |
|
---|
227 | private: // Disabled copy constructor and operator=
|
---|
228 |
|
---|
229 | #if defined(Q_DISABLE_COPY)
|
---|
230 | QMenuBar( const QMenuBar & );
|
---|
231 | QMenuBar &operator=( const QMenuBar & );
|
---|
232 | #endif
|
---|
233 | };
|
---|
234 |
|
---|
235 |
|
---|
236 | #endif // QT_NO_MENUBAR
|
---|
237 |
|
---|
238 | #endif // QMENUBAR_H
|
---|
239 | </pre>
|
---|
240 | <!-- eof -->
|
---|
241 | <p><address><hr><div align=center>
|
---|
242 | <table width=100% cellspacing=0 border=0><tr>
|
---|
243 | <td>Copyright © 2007
|
---|
244 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
245 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
246 | </table></div></address></body>
|
---|
247 | </html>
|
---|