• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Static Public Member Functions | Friends | List of all members
KContextMenuManager Class Reference

#include <kcmenumngr.h>

Inherits TQObject.

Static Public Member Functions

static void insert (TQWidget *widget, TQPopupMenu *popup)
 
static bool showOnButtonPress (void)
 

Friends

class I_really_like_this_class
 

Detailed Description

Convenience class to mangage context menus.

Author
Matthias Ettrich ettri.nosp@m.ch@k.nosp@m.de.or.nosp@m.g

KContextMenuManager manages configurable context popup menus. Instead of reimplementing TQWidget::mousePressEvent() or TQWidget::mouseReleaseEvent() and/or TQWidget::keyPressEvent(), simply create the popup menu and insert it into the context menu manager with the static function insert().

Example:

KContextMenuManager::insert( myWidget, myPopupMenu );
KContextMenuManager::insert
static void insert(TQWidget *widget, TQPopupMenu *popup)
Makes popup a context popup menu for widget widget.
Definition: kcmenumngr.cpp:57

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

Menus are configurable in the [ContextMenus] group of the application's configuration file, usually in kdeglobals:

[ContextMenus]
ShowOnPress=true|false

ShowOnPress 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:

[Keys]
...
PopupContextMenu=Menu
...

The key can be configured with the standard keys module in the 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 ( TQWidget::microFocusHint() ).

Definition at line 76 of file kcmenumngr.h.

Member Function Documentation

◆ insert()

void KContextMenuManager::insert ( TQWidget *  widget,
TQPopupMenu *  popup 
)
static

Makes popup a context popup menu for widget widget.

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

Definition at line 57 of file kcmenumngr.cpp.

◆ showOnButtonPress()

bool KContextMenuManager::showOnButtonPress ( void  )
static

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.

Returns
true if the menu should be made visible on a button press or false after a button press-release sequence.

Definition at line 49 of file kcmenumngr.cpp.

Friends And Related Function Documentation

◆ I_really_like_this_class

friend class I_really_like_this_class
friend

Definition at line 109 of file kcmenumngr.h.


The documentation for this class was generated from the following files:
  • kcmenumngr.h
  • kcmenumngr.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.