\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=79pt]{classKContextMenuManager__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KContext\-Menu\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=171pt]{classKContextMenuManager__coll__graph}
\end{center}
\end{figure}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static void {\bf insert} ({\bf QWidget} $\ast$widget, {\bf QPopup\-Menu} $\ast$popup)
\item 
static bool {\bf show\-On\-Button\-Press} (void)
\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}
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: 

\footnotesize\begin{verbatim}   KContextMenuManager::insert( myWidget, myPopupMenu );
\end{verbatim}
\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: 

\footnotesize\begin{verbatim}    [ContextMenus]
    ShowOnPress=true|false
\end{verbatim}
\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: 

\footnotesize\begin{verbatim}   [Keys]
   ...
   PopupContextMenu=Menu
   ...
\end{verbatim}
\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 76 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::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}
