\section{KContext\-Menu\-Manager Class Reference}
\label{classKContextMenuManager}\index{KContextMenuManager@{KContextMenuManager}}
Convenience class to mangage context menus.  


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

Inheritance diagram for KContext\-Menu\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=84pt]{classKContextMenuManager__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KContext\-Menu\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=184pt]{classKContextMenuManager__coll__graph}
\end{center}
\end{figure}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf insert} ({\bf QWidget} $\ast$widget, {\bf QPopup\-Menu} $\ast$popup)
\begin{CompactList}\small\item\em Makes {\tt popup} a context popup menu for widget {\tt widget}. \item\end{CompactList}\item 
bool {\bf show\-On\-Button\-Press} (void)
\begin{CompactList}\small\item\em Use this method to get information about when a popup menu should be activated. \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf I\_\-really\_\-like\_\-this\_\-class}\label{classKContextMenuManager_n0}

\end{CompactItemize}


\subsection{Detailed Description}
Convenience class to mangage context menus. 

\begin{Desc}
\item[Author:]Matthias Ettrich $<${\tt ettrich@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kcmenumngr.h}{\rm (p.\,\pageref{kcmenumngr_8h})},v 1.8 2001/11/21 21:24:08 ellis Exp \end{Desc}
\end{Desc}
KContext\-Menu\-Manager manages configurable context popup menus. Instead of reimplementing {\bf QWidget::mouse\-Press\-Event}() or {\bf QWidget::mouse\-Release\-Event}() and/or {\bf QWidget::key\-Press\-Event}(), simply create the popup menu and insert it into the context menu manager with the static function {\bf insert}{\rm (p.\,\pageref{classKContextMenuManager_e0})}().

Example: \small\begin{alltt}
   #include $<${\bf kcmenumngr.h}{\rm (p.\,\pageref{kcmenumngr_8h})}$>$
   ...
   KContextMenuManager::insert( myWidget, myPopupMenu );
\end{alltt}\normalsize 


Context menus are invoked with either a special shortcut key (usually the menu key) or the right mouse button.

Menus are configurable in the [Context\-Menus] group of the application's configuration file, usually in kdeglobals: \small\begin{alltt}
    [ContextMenus]
    ShowOnPress=true|false
\end{alltt}\normalsize 


{\tt Show\-On\-Press} defines whether the menu shall be shown on mouse press or on mouse release.

The shortcut key to invoke the context menu is defined in the standard [Keys] section of the application configuration: \small\begin{alltt}
   [Keys]
   ...
   PopupContextMenu=Menu
   ...
\end{alltt}\normalsize 
 The key can be configured with the standard keys module in the {\bf KDE} control center.

If the popup menu is invoked with the keyboard shortcut, it's shown at the position of the micro focus hint of the widget ( {\bf QWidget::micro\-Focus\-Hint}() ). 



Definition at line 78 of file kcmenumngr.h.

\subsection{Member Function Documentation}
\index{KContextMenuManager@{KContext\-Menu\-Manager}!insert@{insert}}
\index{insert@{insert}!KContextMenuManager@{KContext\-Menu\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KContext\-Menu\-Manager::insert ({\bf QWidget} $\ast$ {\em widget}, {\bf QPopup\-Menu} $\ast$ {\em popup})\hspace{0.3cm}{\tt  [static]}}\label{classKContextMenuManager_e0}


Makes {\tt popup} a context popup menu for widget {\tt widget}. 

Ownership of the popup menu is not transferred to the context menu manager. 

Definition at line 57 of file kcmenumngr.cpp.

References QObject::connect(), QObject::destroyed(), QPtr\-Dict$<$ QPopup\-Menu $>$::insert(), and menus.

Referenced by KEdit::install\-RBPopup().\index{KContextMenuManager@{KContext\-Menu\-Manager}!showOnButtonPress@{showOnButtonPress}}
\index{showOnButtonPress@{showOnButtonPress}!KContextMenuManager@{KContext\-Menu\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KContext\-Menu\-Manager::show\-On\-Button\-Press (void)\hspace{0.3cm}{\tt  [static]}}\label{classKContextMenuManager_e1}


Use this method to get information about when a popup menu should be activated. 

This can be useful if the popup menu is to be activated from a listview.

\begin{Desc}
\item[Returns:]true if the menu should be made visible on a button press or false after a button press-release sequence. \end{Desc}


Definition at line 49 of file kcmenumngr.cpp.

References show\-On\-Press.

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