org.kde.koala

Class KPopupMenu

public class KPopupMenu extends QPopupMenu

KPopupMenu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options. It acts identically to QPopupMenu, with the addition of insertTitle(), changeTitle(), setKeyboardShortcutsEnabled() and setKeyboardShortcutsExecute() methods. The titles support a text string, an icon, plus user defined gradients, colors, and background pixmaps. The keyboard search algorithm is incremental with additional underlining for user feedback. See KPopupMenuSignals for signals emitted by KPopupMenu

Author: Hamish Rodda

UNKNOWN: A menu with title items.

Constructor Summary
protected KPopupMenu(Class dummy)
KPopupMenu(QWidget parent, String name)
Constructs a KPopupMenu.
KPopupMenu(QWidget parent)
KPopupMenu()
Method Summary
voidactivateItemAt(int index)
Reimplemented for internal purposes
voidchangeTitle(int id, String text)
Changes the title of the item at the specified id.
voidchangeTitle(int id, QPixmap icon, String text)
Changes the title and icon of the title item at the specified id.
StringclassName()
protected voidcloseEvent(QCloseEvent arg1)
QPopupMenucontextMenu()
Returns the context menu associated with this menu
protected voidcontextMenuEvent(QContextMenuEvent e)
static KPopupMenucontextMenuFocus()
Returns the KPopupMenu associated with the current context menu
static intcontextMenuFocusItem()
returns the ID of the menuitem associated with the current context menu
protected voidctxMenuHideShowingMenu()
protected voidctxMenuHiding()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
protected booleanfocusNextPrevChild(boolean next)
voidhideContextMenu()
Hides the context menu if shown
protected voidhideEvent(QHideEvent arg1)
intinsertTitle(String text, int id, int index)
Inserts a title item with no icon.
intinsertTitle(String text, int id)
intinsertTitle(String text)
intinsertTitle(QPixmap icon, String text, int id, int index)
Inserts a title item with the given icon and title.
intinsertTitle(QPixmap icon, String text, int id)
intinsertTitle(QPixmap icon, String text)
booleanisDisposed()
Has the wrapped C++ instance been deleted?
protected voiditemHighlighted(int whichItem)
protected voidkeyPressEvent(QKeyEvent e)
QMetaObjectmetaObject()
protected voidmousePressEvent(QMouseEvent e)
protected voidmouseReleaseEvent(QMouseEvent e)
protected voidresetKeyboardVars(boolean noMatches)
protected voidresetKeyboardVars()
voidsetKeyboardShortcutsEnabled(boolean enable)
Enables keyboard navigation by searching for the entered key sequence.
voidsetKeyboardShortcutsExecute(boolean enable)
Enables execution of the menu item once it is uniquely specified.
protected voidshowCtxMenu(QPoint pos)
intstate()
Return the state of the mouse button and keyboard modifiers when the last menuitem was activated.
Stringtitle(int id)
Returns the title of the title item at the specified id.
Stringtitle()
QPixmaptitlePixmap(int id)
Returns the icon of the title item at the specified id.
protected StringunderlineText(String text, int length)

Constructor Detail

KPopupMenu

protected KPopupMenu(Class dummy)

KPopupMenu

public KPopupMenu(QWidget parent, String name)
Constructs a KPopupMenu.

UNKNOWN: Constructs a KPopupMenu.

KPopupMenu

public KPopupMenu(QWidget parent)

KPopupMenu

public KPopupMenu()

Method Detail

activateItemAt

public void activateItemAt(int index)
Reimplemented for internal purposes

UNKNOWN: Reimplemented for internal purposes

changeTitle

public void changeTitle(int id, String text)
Changes the title of the item at the specified id. If a icon was previously set it is cleared.

UNKNOWN: Changes the title of the item at the specified id.

changeTitle

public void changeTitle(int id, QPixmap icon, String text)
Changes the title and icon of the title item at the specified id.

UNKNOWN: Changes the title and icon of the title item at the specified id.

className

public String className()

closeEvent

protected void closeEvent(QCloseEvent arg1)

contextMenu

public QPopupMenu contextMenu()
Returns the context menu associated with this menu

UNKNOWN: Returns the context menu associated with this menu

contextMenuEvent

protected void contextMenuEvent(QContextMenuEvent e)

contextMenuFocus

public static KPopupMenu contextMenuFocus()
Returns the KPopupMenu associated with the current context menu

UNKNOWN: Returns the KPopupMenu associated with the current context menu

contextMenuFocusItem

public static int contextMenuFocusItem()
returns the ID of the menuitem associated with the current context menu

UNKNOWN: returns the ID of the menuitem associated with the current context menu

ctxMenuHideShowingMenu

protected void ctxMenuHideShowingMenu()

ctxMenuHiding

protected void ctxMenuHiding()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

focusNextPrevChild

protected boolean focusNextPrevChild(boolean next)

hideContextMenu

public void hideContextMenu()
Hides the context menu if shown

UNKNOWN: Hides the context menu if shown

hideEvent

protected void hideEvent(QHideEvent arg1)

insertTitle

public int insertTitle(String text, int id, int index)
Inserts a title item with no icon.

UNKNOWN: Inserts a title item with no icon.

insertTitle

public int insertTitle(String text, int id)

insertTitle

public int insertTitle(String text)

insertTitle

public int insertTitle(QPixmap icon, String text, int id, int index)
Inserts a title item with the given icon and title.

UNKNOWN: Inserts a title item with the given icon and title.

insertTitle

public int insertTitle(QPixmap icon, String text, int id)

insertTitle

public int insertTitle(QPixmap icon, String text)

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

itemHighlighted

protected void itemHighlighted(int whichItem)

keyPressEvent

protected void keyPressEvent(QKeyEvent e)

metaObject

public QMetaObject metaObject()

mousePressEvent

protected void mousePressEvent(QMouseEvent e)

mouseReleaseEvent

protected void mouseReleaseEvent(QMouseEvent e)

resetKeyboardVars

protected void resetKeyboardVars(boolean noMatches)

resetKeyboardVars

protected void resetKeyboardVars()

setKeyboardShortcutsEnabled

public void setKeyboardShortcutsEnabled(boolean enable)
Enables keyboard navigation by searching for the entered key sequence. Also underlines the currently selected item, providing feedback on the search. Defaults to off. WARNING: calls to text() of currently keyboard-selected items will contain additional ampersand characters. WARNING: though pre-existing keyboard shortcuts will not interfere with the operation of this feature, they may be confusing to the user as the existing shortcuts will not work.

UNKNOWN: Enables keyboard navigation by searching for the entered key sequence.

setKeyboardShortcutsExecute

public void setKeyboardShortcutsExecute(boolean enable)
Enables execution of the menu item once it is uniquely specified. Defaults to off.

UNKNOWN: Enables execution of the menu item once it is uniquely specified.

showCtxMenu

protected void showCtxMenu(QPoint pos)

state

public int state()
Return the state of the mouse button and keyboard modifiers when the last menuitem was activated.

UNKNOWN: Return the state of the mouse button and keyboard modifiers when the last menuitem was activated.

title

public String title(int id)
Returns the title of the title item at the specified id. The default id of -1 is for backwards compatibility only, you should always specify the id.

UNKNOWN: Returns the title of the title item at the specified id.

title

public String title()

titlePixmap

public QPixmap titlePixmap(int id)
Returns the icon of the title item at the specified id.

UNKNOWN: Returns the icon of the title item at the specified id.

underlineText

protected String underlineText(String text, int length)