summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KContextMenuManager.java
blob: 428801082a92b37b54acef4f3741523336e14dde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.TQMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.TQPopupMenu;
import org.kde.qt.TQWidget;
import org.kde.qt.TQObject;

/**

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:
<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 ( TQWidget.microFocusHint() ).
		@author Matthias Ettrich <ettrich@kde.org>

		@short Convenience class to mangage context menus.

*/
public class KContextMenuManager extends TQObject  {
	protected KContextMenuManager(Class dummy){super((Class) null);}
	public native TQMetaObject 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(TQWidget widget, TQPopupMenu 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();
}