summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KContextMenuManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'kdejava/koala/org/kde/koala/KContextMenuManager.java')
-rw-r--r--kdejava/koala/org/kde/koala/KContextMenuManager.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/KContextMenuManager.java b/kdejava/koala/org/kde/koala/KContextMenuManager.java
new file mode 100644
index 00000000..08c073f1
--- /dev/null
+++ b/kdejava/koala/org/kde/koala/KContextMenuManager.java
@@ -0,0 +1,69 @@
+//Auto-generated by kalyptus. DO NOT EDIT.
+package org.kde.koala;
+
+import org.kde.qt.Qt;
+import org.kde.qt.QMetaObject;
+import org.kde.qt.QtSupport;
+import org.kde.qt.QPopupMenu;
+import org.kde.qt.QWidget;
+import org.kde.qt.QObject;
+
+/**
+
+KContextMenuManager manages configurable context popup menus. Instead
+of reimplementing QWidget.mousePressEvent() or
+ QWidget.mouseReleaseEvent() and/or QWidget.keyPressEvent(), simply
+create the popup menu and insert it into the context menu manager with
+the static function insert().
+Example:
+<pre>
+ KContextMenuManager.insert( myWidget, myPopupMenu );
+</pre>
+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:
+<pre>
+ [ContextMenus]
+ ShowOnPress=true|false
+</pre>
+<code>ShowOnPress</code> 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:
+<pre>
+ [Keys]
+ ...
+ PopupContextMenu=Menu
+ ...
+</pre>
+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 ( QWidget.microFocusHint() ).
+ @author Matthias Ettrich <ettrich@kde.org>
+
+ @short Convenience class to mangage context menus.
+
+*/
+public class KContextMenuManager extends QObject {
+ protected KContextMenuManager(Class dummy){super((Class) null);}
+ public native QMetaObject metaObject();
+ public native String className();
+ /**
+ Makes <code>popup</code> a context popup menu for widget <code>widget.</code>
+ Ownership of the popup menu is not transferred to the context
+ menu manager.
+ @short Makes <code>popup</code> a context popup menu for widget <code>widget.</code>
+ */
+ public static native void insert(QWidget widget, QPopupMenu popup);
+ /**
+ 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.
+ @return true if the menu should be made visible on a button press
+ or false after a button press-release sequence.
+
+ @short Use this method to get information about when a popup menu should be activated.
+ */
+ public static native boolean showOnButtonPress();
+}