.TH "KPopupMenu" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPopupMenu \- A menu with title items.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpopupmenu.h>\fP
.PP
Inherits \fBQPopupMenu\fP.
.PP
Inherited by \fBKPanelMenu\fP, and KWindowListMenu.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBaboutToShowContextMenu\fP (\fBKPopupMenu\fP *menu, int menuItem, \fBQPopupMenu\fP *ctxMenu)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPopupMenu\fP (\fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fB~KPopupMenu\fP ()"
.br
.ti -1c
.RI "int \fBinsertTitle\fP (const \fBQString\fP &\fBtext\fP, int id=-1, int index=-1)"
.br
.ti -1c
.RI "int \fBinsertTitle\fP (const \fBQPixmap\fP &icon, const \fBQString\fP &\fBtext\fP, int id=-1, int index=-1)"
.br
.ti -1c
.RI "void \fBchangeTitle\fP (int id, const \fBQString\fP &\fBtext\fP)"
.br
.ti -1c
.RI "void \fBchangeTitle\fP (int id, const \fBQPixmap\fP &icon, const \fBQString\fP &\fBtext\fP)"
.br
.ti -1c
.RI "\fBQString\fP \fBtitle\fP (int id=-1) const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBtitlePixmap\fP (int id) const "
.br
.ti -1c
.RI "void \fBsetKeyboardShortcutsEnabled\fP (bool enable)"
.br
.ti -1c
.RI "void \fBsetKeyboardShortcutsExecute\fP (bool enable)"
.br
.ti -1c
.RI "\fBKPopupMenu\fP (const \fBQString\fP &title, \fBQWidget\fP *parent=0, const char *name=0) KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBsetTitle\fP (const \fBQString\fP &title) KDE_DEPRECATED"
.br
.ti -1c
.RI "\fBQPopupMenu\fP * \fBcontextMenu\fP ()"
.br
.ti -1c
.RI "const \fBQPopupMenu\fP * \fBcontextMenu\fP () const "
.br
.ti -1c
.RI "void \fBhideContextMenu\fP ()"
.br
.ti -1c
.RI "virtual void \fBactivateItemAt\fP (int index)"
.br
.ti -1c
.RI "Qt::ButtonState \fBstate\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKPopupMenu\fP * \fBcontextMenuFocus\fP ()"
.br
.ti -1c
.RI "static int \fBcontextMenuFocusItem\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "\fBQString\fP \fBunderlineText\fP (const \fBQString\fP &\fBtext\fP, uint length)"
.br
.ti -1c
.RI "void \fBresetKeyboardVars\fP (bool noMatches=false)"
.br
.ti -1c
.RI "void \fBitemHighlighted\fP (int whichItem)"
.br
.ti -1c
.RI "void \fBshowCtxMenu\fP (\fBQPoint\fP pos)"
.br
.ti -1c
.RI "void \fBctxMenuHiding\fP ()"
.br
.ti -1c
.RI "void \fBctxMenuHideShowingMenu\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBcloseEvent\fP (\fBQCloseEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBkeyPressEvent\fP (\fBQKeyEvent\fP *\fBe\fP)"
.br
.ti -1c
.RI "virtual void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *\fBe\fP)"
.br
.ti -1c
.RI "virtual void \fBmousePressEvent\fP (\fBQMouseEvent\fP *\fBe\fP)"
.br
.ti -1c
.RI "virtual bool \fBfocusNextPrevChild\fP (bool next)"
.br
.ti -1c
.RI "virtual void \fBcontextMenuEvent\fP (\fBQContextMenuEvent\fP *\fBe\fP)"
.br
.ti -1c
.RI "virtual void \fBhideEvent\fP (\fBQHideEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A menu with title items. 

KPopupMenu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options. It acts identically to \fBQPopupMenu\fP, with the addition of \fBinsertTitle()\fP, \fBchangeTitle()\fP, \fBsetKeyboardShortcutsEnabled()\fP and \fBsetKeyboardShortcutsExecute()\fP methods.
.PP
The titles support a text string, an icon, plus user defined gradients, colors, and background pixmaps.
.PP
The keyboard search algorithm is incremental with additional underlining for user feedback.
.PP
\fBAuthor:\fP
.RS 4
Daniel M. Duley <mosfet@kde.org> 
.PP
Hamish Rodda <rodda@kde.org> 
.RE
.PP

.PP
Definition at line 123 of file kpopupmenu.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPopupMenu::KPopupMenu (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a KPopupMenu. 
.PP
Definition at line 164 of file kpopupmenu.cpp.
.PP
References resetKeyboardVars().
.SS "KPopupMenu::~\fBKPopupMenu\fP ()"
.PP
Destructs the object. 
.PP
Definition at line 172 of file kpopupmenu.cpp.
.SS "KPopupMenu::KPopupMenu (const \fBQString\fP & title, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
end of RMB menus on menus support 
.PP
\fBDeprecated\fP
.RS 4
Obsolete method provided for backwards compatibility only. Use the normal constructor and insertTitle instead. 
.RE
.PP

.PP
Definition at line 670 of file kpopupmenu.cpp.
.PP
References insertTitle(), and title().
.SH "Member Function Documentation"
.PP 
.SS "int KPopupMenu::insertTitle (const \fBQString\fP & text, int id = \fC-1\fP, int index = \fC-1\fP)"
.PP
Inserts a title item with no icon. 
.PP
Definition at line 183 of file kpopupmenu.cpp.
.PP
References QPopupMenu::insertItem(), QPopupMenu::setItemEnabled(), and KPopupTitle::setTitle().
.PP
Referenced by KDateTable::contentsMousePressEvent(), KPixmapRegionSelectorWidget::createPopupMenu(), KPopupMenu(), and KSystemTray::KSystemTray().
.SS "int KPopupMenu::insertTitle (const \fBQPixmap\fP & icon, const \fBQString\fP & text, int id = \fC-1\fP, int index = \fC-1\fP)"
.PP
Inserts a title item with the given icon and title. 
.PP
Definition at line 192 of file kpopupmenu.cpp.
.PP
References QPopupMenu::insertItem(), QPopupMenu::setItemEnabled(), and KPopupTitle::setTitle().
.SS "void KPopupMenu::changeTitle (int id, const \fBQString\fP & text)"
.PP
Changes the title of the item at the specified id. 
.PP
If a icon was previously set it is cleared. 
.PP
Definition at line 202 of file kpopupmenu.cpp.
.PP
References endl(), kdWarning(), and KPopupTitle::setTitle().
.SS "void KPopupMenu::changeTitle (int id, const \fBQPixmap\fP & icon, const \fBQString\fP & text)"
.PP
Changes the title and icon of the title item at the specified id. 
.PP
Definition at line 219 of file kpopupmenu.cpp.
.PP
References endl(), and kdWarning().
.SS "\fBQString\fP KPopupMenu::title (int id = \fC-1\fP) const"
.PP
Returns the title of the title item at the specified id. 
.PP
The default id of -1 is for backwards compatibility only, you should always specify the id. 
.PP
Definition at line 236 of file kpopupmenu.cpp.
.PP
Referenced by KPopupMenu(), and setTitle().
.SS "\fBQPixmap\fP KPopupMenu::titlePixmap (int id) const"
.PP
Returns the icon of the title item at the specified id. 
.PP
Definition at line 252 of file kpopupmenu.cpp.
.SS "void KPopupMenu::setKeyboardShortcutsEnabled (bool enable)"
.PP
Enables keyboard navigation by searching for the entered key sequence. 
.PP
Also underlines the currently selected item, providing feedback on the search.
.PP
Defaults to off.
.PP
WARNING: calls to \fBtext()\fP of currently keyboard-selected items will contain additional ampersand characters.
.PP
WARNING: though pre-existing keyboard shortcuts will not interfere with the operation of this feature, they may be confusing to the user as the existing shortcuts will not work. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 477 of file kpopupmenu.cpp.
.PP
Referenced by KPanelMenu::init().
.SS "void KPopupMenu::setKeyboardShortcutsExecute (bool enable)"
.PP
Enables execution of the menu item once it is uniquely specified. 
.PP
Defaults to off. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 482 of file kpopupmenu.cpp.
.SS "void KPopupMenu::setTitle (const \fBQString\fP & title)"
.PP
\fBDeprecated\fP
.RS 4
Obsolete method provided for backwards compatibility only. Use insertTitle and changeTitle instead. 
.RE
.PP

.PP
Definition at line 678 of file kpopupmenu.cpp.
.PP
References QPopupMenu::insertItem(), KPopupTitle::setTitle(), and title().
.SS "\fBQPopupMenu\fP * KPopupMenu::contextMenu ()"
.PP
Returns the context menu associated with this menu 
.PP
\fBSince:\fP
.RS 4
3.2. 
.RE
.PP

.PP
Definition at line 514 of file kpopupmenu.cpp.
.PP
References QPopupMenu::aboutToHide(), and QPopupMenu::QPopupMenu().
.SS "const \fBQPopupMenu\fP * KPopupMenu::contextMenu () const"
.PP
Returns the context menu associated with this menu 
.PP
\fBSince:\fP
.RS 4
3.2. 
.RE
.PP

.PP
Definition at line 525 of file kpopupmenu.cpp.
.SS "void KPopupMenu::hideContextMenu ()"
.PP
Hides the context menu if shown 
.PP
\fBSince:\fP
.RS 4
3.2. 
.RE
.PP

.PP
Definition at line 530 of file kpopupmenu.cpp.
.SS "\fBKPopupMenu\fP * KPopupMenu::contextMenuFocus ()\fC [static]\fP"
.PP
Returns the KPopupMenu associated with the current context menu 
.PP
\fBSince:\fP
.RS 4
3.2. 
.RE
.PP

.PP
Definition at line 540 of file kpopupmenu.cpp.
.SS "int KPopupMenu::contextMenuFocusItem ()\fC [static]\fP"
.PP
returns the ID of the menuitem associated with the current context menu 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 535 of file kpopupmenu.cpp.
.SS "void KPopupMenu::activateItemAt (int index)\fC [virtual]\fP"
.PP
Reimplemented for internal purposes 
.PP
\fBSince:\fP
.RS 4
3.4. 
.RE
.PP

.PP
Definition at line 277 of file kpopupmenu.cpp.
.SS "Qt::ButtonState KPopupMenu::state () const"
.PP
Return the state of the mouse button and keyboard modifiers when the last menuitem was activated. 
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 283 of file kpopupmenu.cpp.
.PP
Referenced by KAction::slotPopupActivated().
.SS "void KPopupMenu::aboutToShowContextMenu (\fBKPopupMenu\fP * menu, int menuItem, \fBQPopupMenu\fP * ctxMenu)\fC [signal]\fP"
.PP
connect to this signal to be notified when a context menu is about to be shown 
.PP
\fBParameters:\fP
.RS 4
\fImenu\fP The menu that the context menu is about to be shown for 
.br
\fImenuItem\fP The menu item that the context menu is currently on 
.br
\fIctxMenu\fP The context menu itself 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.SS "void KPopupMenu::closeEvent (\fBQCloseEvent\fP * e)\fC [protected, virtual]\fP"
.PP
This is re-implemented for keyboard navigation. 
.PP
Definition at line 270 of file kpopupmenu.cpp.
.PP
References resetKeyboardVars().
.SS "void KPopupMenu::mouseReleaseEvent (\fBQMouseEvent\fP * e)\fC [protected, virtual]\fP"
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 505 of file kpopupmenu.cpp.
.SS "void KPopupMenu::mousePressEvent (\fBQMouseEvent\fP * e)\fC [protected, virtual]\fP"
.PP
RMB menus on menus. 
.PP
Definition at line 494 of file kpopupmenu.cpp.
.SS "\fBQString\fP KPopupMenu::underlineText (const \fBQString\fP & text, uint length)\fC [protected, slot]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 452 of file kpopupmenu.cpp.
.PP
References QString::insert().
.SS "void KPopupMenu::resetKeyboardVars (bool noMatches = \fCfalse\fP)\fC [protected, slot]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 462 of file kpopupmenu.cpp.
.PP
References QPopupMenu::changeItem(), and QPopupMenu::idAt().
.PP
Referenced by closeEvent(), and KPopupMenu().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
