[190] | 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/qpopupmenu.h:1 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>qpopupmenu.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>qpopupmenu.h</h1>
|
---|
| 33 |
|
---|
| 34 | <p>This is the verbatim text of the qpopupmenu.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
| 35 | <hr>
|
---|
| 36 | <pre>
|
---|
| 37 | /****************************************************************************
|
---|
| 38 | ** $Id: qpopupmenu-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
| 39 | **
|
---|
| 40 | ** Definition of QPopupMenu class
|
---|
| 41 | **
|
---|
| 42 | ** Created : 941128
|
---|
| 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 QPOPUPMENU_H
|
---|
| 75 | #define QPOPUPMENU_H
|
---|
| 76 |
|
---|
| 77 | #ifndef QT_H
|
---|
| 78 | #include "qframe.h"
|
---|
| 79 | #include "qmenudata.h"
|
---|
| 80 | #endif // QT_H
|
---|
| 81 |
|
---|
| 82 | #ifndef QT_NO_POPUPMENU
|
---|
| 83 | class QPopupMenuPrivate;
|
---|
| 84 |
|
---|
| 85 | class Q_EXPORT QPopupMenu : public QFrame, public QMenuData
|
---|
| 86 | {
|
---|
| 87 | Q_OBJECT
|
---|
| 88 | Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable )
|
---|
| 89 | public:
|
---|
| 90 | QPopupMenu( QWidget* parent=0, const char* name=0 );
|
---|
| 91 | ~QPopupMenu();
|
---|
| 92 |
|
---|
| 93 | void popup( const QPoint & pos, int indexAtPoint = -1 ); // open
|
---|
| 94 | void updateItem( int id );
|
---|
| 95 |
|
---|
| 96 | virtual void setCheckable( bool );
|
---|
| 97 | bool isCheckable() const;
|
---|
| 98 |
|
---|
| 99 | void setFont( const QFont & );
|
---|
| 100 | void show();
|
---|
| 101 | void hide();
|
---|
| 102 |
|
---|
| 103 | int exec();
|
---|
| 104 | int exec( const QPoint & pos, int indexAtPoint = 0 ); // modal
|
---|
| 105 |
|
---|
| 106 | virtual void setActiveItem( int );
|
---|
| 107 | QSize sizeHint() const;
|
---|
| 108 |
|
---|
| 109 | int idAt( int index ) const { return QMenuData::idAt( index ); }
|
---|
| 110 | int idAt( const QPoint& pos ) const;
|
---|
| 111 |
|
---|
| 112 | bool customWhatsThis() const;
|
---|
| 113 |
|
---|
| 114 | int insertTearOffHandle( int id=-1, int index=-1 );
|
---|
| 115 |
|
---|
| 116 | void activateItemAt( int index );
|
---|
| 117 | QRect itemGeometry( int index );
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | signals:
|
---|
| 121 | void activated( int itemId );
|
---|
| 122 | void highlighted( int itemId );
|
---|
| 123 | void activatedRedirect( int itemId ); // to parent menu
|
---|
| 124 | void highlightedRedirect( int itemId );
|
---|
| 125 | void aboutToShow();
|
---|
| 126 | void aboutToHide();
|
---|
| 127 |
|
---|
| 128 | protected:
|
---|
| 129 | int itemHeight( int ) const;
|
---|
| 130 | int itemHeight( QMenuItem* mi ) const;
|
---|
| 131 | void drawItem( QPainter* p, int tab, QMenuItem* mi,
|
---|
| 132 | bool act, int x, int y, int w, int h);
|
---|
| 133 |
|
---|
| 134 | void drawContents( QPainter * );
|
---|
| 135 |
|
---|
| 136 | void closeEvent( QCloseEvent *e );
|
---|
| 137 | void paintEvent( QPaintEvent * );
|
---|
| 138 | void mousePressEvent( QMouseEvent * );
|
---|
| 139 | void mouseReleaseEvent( QMouseEvent * );
|
---|
| 140 | void mouseMoveEvent( QMouseEvent * );
|
---|
| 141 | void keyPressEvent( QKeyEvent * );
|
---|
| 142 | void focusInEvent( QFocusEvent * );
|
---|
| 143 | void focusOutEvent( QFocusEvent * );
|
---|
| 144 | void timerEvent( QTimerEvent * );
|
---|
| 145 | void leaveEvent( QEvent * );
|
---|
| 146 | void styleChange( QStyle& );
|
---|
| 147 | void enabledChange( bool );
|
---|
| 148 | int columns() const;
|
---|
| 149 |
|
---|
| 150 | bool focusNextPrevChild( bool next );
|
---|
| 151 |
|
---|
| 152 | int itemAtPos( const QPoint &, bool ignoreSeparator = TRUE ) const;
|
---|
| 153 |
|
---|
| 154 | private slots:
|
---|
| 155 | void subActivated( int itemId );
|
---|
| 156 | void subHighlighted( int itemId );
|
---|
| 157 | #ifndef QT_NO_ACCEL
|
---|
| 158 | void accelActivated( int itemId );
|
---|
| 159 | void accelDestroyed();
|
---|
| 160 | #endif
|
---|
| 161 | void popupDestroyed( QObject* );
|
---|
| 162 | void modalActivation( int );
|
---|
| 163 |
|
---|
| 164 | void subMenuTimer();
|
---|
| 165 | void subScrollTimer();
|
---|
| 166 | void allowAnimation();
|
---|
| 167 | void toggleTearOff();
|
---|
| 168 |
|
---|
| 169 | void performDelayedChanges();
|
---|
| 170 |
|
---|
| 171 | private:
|
---|
| 172 | void updateScrollerState();
|
---|
| 173 | void menuContentsChanged();
|
---|
| 174 | void menuStateChanged();
|
---|
| 175 | void performDelayedContentsChanged();
|
---|
| 176 | void performDelayedStateChanged();
|
---|
| 177 | void menuInsPopup( QPopupMenu * );
|
---|
| 178 | void menuDelPopup( QPopupMenu * );
|
---|
| 179 | void frameChanged();
|
---|
| 180 |
|
---|
| 181 | void actSig( int, bool = FALSE );
|
---|
| 182 | void hilitSig( int );
|
---|
| 183 | virtual void setFirstItemActive();
|
---|
| 184 | void hideAllPopups();
|
---|
| 185 | void hidePopups();
|
---|
| 186 | bool tryMenuBar( QMouseEvent * );
|
---|
| 187 | void byeMenuBar();
|
---|
| 188 |
|
---|
| 189 | QSize updateSize(bool force_recalc=FALSE, bool do_resize=TRUE);
|
---|
| 190 | void updateRow( int row );
|
---|
| 191 | #ifndef QT_NO_ACCEL
|
---|
| 192 | void updateAccel( QWidget * );
|
---|
| 193 | void enableAccel( bool );
|
---|
| 194 | #endif
|
---|
| 195 | QPopupMenuPrivate *d;
|
---|
| 196 | #ifndef QT_NO_ACCEL
|
---|
| 197 | QAccel *autoaccel;
|
---|
| 198 | #endif
|
---|
| 199 |
|
---|
| 200 | #if defined(Q_WS_MAC) && !defined(QMAC_QMENUBAR_NO_NATIVE)
|
---|
| 201 | bool macPopupMenu(const QPoint &, int);
|
---|
| 202 | uint mac_dirty_popup : 1;
|
---|
| 203 | #endif
|
---|
| 204 |
|
---|
| 205 | int popupActive;
|
---|
| 206 | int tab;
|
---|
| 207 | uint accelDisabled : 1;
|
---|
| 208 | uint checkable : 1;
|
---|
| 209 | uint connectModalRecursionSafety : 1;
|
---|
| 210 | uint tornOff : 1;
|
---|
| 211 | uint pendingDelayedContentsChanges : 1;
|
---|
| 212 | uint pendingDelayedStateChanges : 1;
|
---|
| 213 | int maxPMWidth;
|
---|
| 214 | int ncols;
|
---|
| 215 | bool snapToMouse;
|
---|
| 216 | bool tryMouseEvent( QPopupMenu *, QMouseEvent * );
|
---|
| 217 |
|
---|
| 218 | friend class QMenuData;
|
---|
| 219 | friend class QMenuBar;
|
---|
| 220 |
|
---|
| 221 | void connectModal(QPopupMenu* receiver, bool doConnect);
|
---|
| 222 |
|
---|
| 223 | private: // Disabled copy constructor and operator=
|
---|
| 224 | #if defined(Q_DISABLE_COPY)
|
---|
| 225 | QPopupMenu( const QPopupMenu & );
|
---|
| 226 | QPopupMenu &operator=( const QPopupMenu & );
|
---|
| 227 | #endif
|
---|
| 228 | };
|
---|
| 229 |
|
---|
| 230 |
|
---|
| 231 | #endif // QT_NO_POPUPMENU
|
---|
| 232 |
|
---|
| 233 | #endif // QPOPUPMENU_H
|
---|
| 234 | </pre>
|
---|
| 235 | <!-- eof -->
|
---|
| 236 | <p><address><hr><div align=center>
|
---|
| 237 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 238 | <td>Copyright © 2007
|
---|
| 239 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 240 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 241 | </table></div></address></body>
|
---|
| 242 | </html>
|
---|