\section{KPopup\-Menu Class Reference}
\label{classKPopupMenu}\index{KPopupMenu@{KPopupMenu}}
KPopup\-Menu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options. A menu with title items.  


{\tt \#include $<$kpopupmenu.h$>$}

Inheritance diagram for KPopup\-Menu:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=58pt]{classKPopupMenu__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KPopup\-Menu:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=58pt]{classKPopupMenu__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KPopup\-Menu} ({\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a KPopup\-Menu. \item\end{CompactList}\item 
{\bf $\sim$KPopup\-Menu} ()
\begin{CompactList}\small\item\em Destructs the object. \item\end{CompactList}\item 
int {\bf insert\-Title} (const  {\bf QString} \&{\bf text}, int id=-1, int index=-1)
\begin{CompactList}\small\item\em Inserts a title item with no icon. \item\end{CompactList}\item 
int {\bf insert\-Title} (const  {\bf QPixmap} \&icon, const  {\bf QString} \&{\bf text}, int id=-1, int index=-1)
\begin{CompactList}\small\item\em Inserts a title item with the given icon and title. \item\end{CompactList}\item 
void {\bf change\-Title} (int id, const  {\bf QString} \&{\bf text})
\begin{CompactList}\small\item\em Changes the title of the item at the specified id. \item\end{CompactList}\item 
void {\bf change\-Title} (int id, const  {\bf QPixmap} \&icon, const  {\bf QString} \&{\bf text})
\begin{CompactList}\small\item\em Changes the title and icon of the title item at the specified id. \item\end{CompactList}\item 
{\bf QString} {\bf title} (int id=-1) const 
\begin{CompactList}\small\item\em Returns the title of the title item at the specified id. \item\end{CompactList}\item 
{\bf QPixmap} {\bf title\-Pixmap} (int id) const 
\begin{CompactList}\small\item\em Returns the icon of the title item at the specified id. \item\end{CompactList}\item 
void {\bf set\-Keyboard\-Shortcuts\-Enabled} (bool enable)
\begin{CompactList}\small\item\em Enables keyboard navigation by searching for the entered key sequence. \item\end{CompactList}\item 
void {\bf set\-Keyboard\-Shortcuts\-Execute} (bool enable)
\begin{CompactList}\small\item\em Enables execution of the menu item once it is uniquely specified. \item\end{CompactList}\item 
{\bf KPopup\-Menu} (const  {\bf QString} \&title, {\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Obsolete method provided for backwards compatibility only. \item\end{CompactList}\item 
void {\bf set\-Title} (const  {\bf QString} \&title)
\begin{CompactList}\small\item\em Obsolete method provided for backwards compatibility only. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
{\bf QString} {\bf underline\-Text} (const  {\bf QString} \&{\bf text}, uint length)
\begin{CompactList}\small\item\em \begin{Desc}
\item[Since:]3.1 \end{Desc}
\item\end{CompactList}\item 
void {\bf reset\-Keyboard\-Vars} (bool no\-Matches=false)
\begin{CompactList}\small\item\em \begin{Desc}
\item[Since:]3.1 \end{Desc}
\item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf close\-Event} ({\bf QClose\-Event} $\ast$)
\begin{CompactList}\small\item\em This is re-implemented for keyboard navigation. \item\end{CompactList}\item 
virtual void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast${\bf e})\label{classKPopupMenu_b1}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKPopupMenu_b2}

\end{CompactItemize}


\subsection{Detailed Description}
KPopup\-Menu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options. A menu with title items. 

It acts identically to {\bf QPopup\-Menu}, with the addition of {\bf insert\-Title()}{\rm (p.\,\pageref{classKPopupMenu_a2})}, {\bf change\-Title()}{\rm (p.\,\pageref{classKPopupMenu_a4})}, {\bf set\-Keyboard\-Shortcuts\-Enabled()}{\rm (p.\,\pageref{classKPopupMenu_a8})} and {\bf set\-Keyboard\-Shortcuts\-Execute()}{\rm (p.\,\pageref{classKPopupMenu_a9})} methods.

The titles support a text string, an icon, plus user defined gradients, colors, and background pixmaps.

The keyboard search algorithm is incremental with additional underlining for user feedback.

\begin{Desc}
\item[Author:]Daniel M. Duley $<${\tt mosfet@kde.org}$>$ 

Hamish Rodda $<${\tt meddie@yoyo.its.monash.edu.au}$>$ \end{Desc}




Definition at line 116 of file kpopupmenu.h.

\subsection{Constructor \& Destructor Documentation}
\index{KPopupMenu@{KPopup\-Menu}!KPopupMenu@{KPopupMenu}}
\index{KPopupMenu@{KPopupMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPopup\-Menu::KPopup\-Menu ({\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKPopupMenu_a0}


Constructs a KPopup\-Menu. 



Definition at line 223 of file kpopupmenu.cpp.

References KStd\-Accel::name(), and reset\-Keyboard\-Vars().\index{KPopupMenu@{KPopup\-Menu}!~KPopupMenu@{$\sim$KPopupMenu}}
\index{~KPopupMenu@{$\sim$KPopupMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPopup\-Menu::$\sim${\bf KPopup\-Menu} ()}\label{classKPopupMenu_a1}


Destructs the object. 



Definition at line 231 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!KPopupMenu@{KPopupMenu}}
\index{KPopupMenu@{KPopupMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPopup\-Menu::KPopup\-Menu (const {\bf QString} \& {\em title}, {\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKPopupMenu_a10}


Obsolete method provided for backwards compatibility only. 

Use the normal constructor and insert\-Title instead. 

Definition at line 515 of file kpopupmenu.cpp.

References KStd\-Accel::name(), and set\-Title().

\subsection{Member Function Documentation}
\index{KPopupMenu@{KPopup\-Menu}!insertTitle@{insertTitle}}
\index{insertTitle@{insertTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPopup\-Menu::insert\-Title (const {\bf QString} \& {\em text}, int {\em id} = -1, int {\em index} = -1)}\label{classKPopupMenu_a2}


Inserts a title item with no icon. 



Definition at line 236 of file kpopupmenu.cpp.

References QPopup\-Menu::insert\-Item(), QPopup\-Menu::set\-Item\-Enabled(), and KPopup\-Title::set\-Title().

Referenced by KSystem\-Tray::KSystem\-Tray().\index{KPopupMenu@{KPopup\-Menu}!insertTitle@{insertTitle}}
\index{insertTitle@{insertTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPopup\-Menu::insert\-Title (const {\bf QPixmap} \& {\em icon}, const {\bf QString} \& {\em text}, int {\em id} = -1, int {\em index} = -1)}\label{classKPopupMenu_a3}


Inserts a title item with the given icon and title. 



Definition at line 245 of file kpopupmenu.cpp.

References QPopup\-Menu::insert\-Item(), QPopup\-Menu::set\-Item\-Enabled(), and KPopup\-Title::set\-Title().\index{KPopupMenu@{KPopup\-Menu}!changeTitle@{changeTitle}}
\index{changeTitle@{changeTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::change\-Title (int {\em id}, const {\bf QString} \& {\em text})}\label{classKPopupMenu_a4}


Changes the title of the item at the specified id. 

If a icon was previously set it is cleared. 

Definition at line 255 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!changeTitle@{changeTitle}}
\index{changeTitle@{changeTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::change\-Title (int {\em id}, const {\bf QPixmap} \& {\em icon}, const {\bf QString} \& {\em text})}\label{classKPopupMenu_a5}


Changes the title and icon of the title item at the specified id. 



Definition at line 268 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!title@{title}}
\index{title@{title}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KPopup\-Menu::title (int {\em id} = -1) const}\label{classKPopupMenu_a6}


Returns the title of the title item at the specified id. 

The default id of -1 is for backwards compatibility only, you should always specify the id. 

Definition at line 281 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!titlePixmap@{titlePixmap}}
\index{titlePixmap@{titlePixmap}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KPopup\-Menu::title\-Pixmap (int {\em id}) const}\label{classKPopupMenu_a7}


Returns the icon of the title item at the specified id. 



Definition at line 297 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!setKeyboardShortcutsEnabled@{setKeyboardShortcutsEnabled}}
\index{setKeyboardShortcutsEnabled@{setKeyboardShortcutsEnabled}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::set\-Keyboard\-Shortcuts\-Enabled (bool {\em enable})}\label{classKPopupMenu_a8}


Enables keyboard navigation by searching for the entered key sequence. 

Also underlines the currently selected item, providing feedback on the search.

Defaults to off.

WARNING: calls to {\bf text()} of currently keyboard-selected items will contain additional ampersand characters.

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. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 501 of file kpopupmenu.cpp.

Referenced by KPanel\-Menu::init().\index{KPopupMenu@{KPopup\-Menu}!setKeyboardShortcutsExecute@{setKeyboardShortcutsExecute}}
\index{setKeyboardShortcutsExecute@{setKeyboardShortcutsExecute}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::set\-Keyboard\-Shortcuts\-Execute (bool {\em enable})}\label{classKPopupMenu_a9}


Enables execution of the menu item once it is uniquely specified. 

Defaults to off. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 506 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!setTitle@{setTitle}}
\index{setTitle@{setTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::set\-Title (const {\bf QString} \& {\em title})}\label{classKPopupMenu_a11}


Obsolete method provided for backwards compatibility only. 

Use insert\-Title and change\-Title instead. 

Definition at line 523 of file kpopupmenu.cpp.

References QPopup\-Menu::insert\-Item(), and KPopup\-Title::set\-Title().

Referenced by KPopup\-Menu().\index{KPopupMenu@{KPopup\-Menu}!closeEvent@{closeEvent}}
\index{closeEvent@{closeEvent}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::close\-Event ({\bf QClose\-Event} $\ast$ {\em e})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKPopupMenu_b0}


This is re-implemented for keyboard navigation. 



Definition at line 315 of file kpopupmenu.cpp.

References reset\-Keyboard\-Vars().\index{KPopupMenu@{KPopup\-Menu}!underlineText@{underlineText}}
\index{underlineText@{underlineText}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KPopup\-Menu::underline\-Text (const {\bf QString} \& {\em text}, uint {\em length})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKPopupMenu_j0}


\begin{Desc}
\item[Since:]3.1 \end{Desc}




Definition at line 476 of file kpopupmenu.cpp.

References QString::insert().\index{KPopupMenu@{KPopup\-Menu}!resetKeyboardVars@{resetKeyboardVars}}
\index{resetKeyboardVars@{resetKeyboardVars}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::reset\-Keyboard\-Vars (bool {\em no\-Matches} = false)\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKPopupMenu_j1}


\begin{Desc}
\item[Since:]3.1 \end{Desc}




Definition at line 486 of file kpopupmenu.cpp.

References QPopup\-Menu::change\-Item(), and QPopup\-Menu::id\-At().

Referenced by close\-Event(), and KPopup\-Menu().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kpopupmenu.h\item 
kpopupmenu.cpp\end{CompactItemize}
