Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Ui::OPopupMenu Class Reference

A menu with title items. More...

#include </home/clem/local/src/opie/libopie2/opieui/opopupmenu.h>

List of all members.

Signals

void aboutToShowContextMenu (Opie::Ui::OPopupMenu *menu, int menuItem, QPopupMenu *ctxMenu)

Public Member Functions

 OPopupMenu (QWidget *parent=0, const char *name=0)
 ~OPopupMenu ()
int insertTitle (const QString &text, int id=-1, int index=-1)
int insertTitle (const QPixmap &icon, const QString &text, int id=-1, int index=-1)
void changeTitle (int id, const QString &text)
void changeTitle (int id, const QPixmap &icon, const QString &text)
QString title (int id=-1) const
QPixmap titlePixmap (int id) const
void setKeyboardShortcutsEnabled (bool enable)
void setKeyboardShortcutsExecute (bool enable)
 OPopupMenu (const QString &title, QWidget *parent=0, const char *name=0)
void setTitle (const QString &title)
QPopupMenu * contextMenu ()
void cancelContextMenuShow ()

Static Public Member Functions

static OPopupMenucontextMenuFocus ()
static int contextMenuFocusItem ()

Protected Slots

QString underlineText (const QString &text, uint length)
void resetKeyboardVars (bool noMatches=false)
void itemHighlighted (int whichItem)
void showCtxMenu (QPoint pos)
void ctxMenuHiding ()

Protected Member Functions

virtual void closeEvent (QCloseEvent *)
virtual void keyPressEvent (QKeyEvent *e)
virtual bool eventFilter (QObject *obj, QEvent *event)
virtual void hideEvent (QHideEvent *)
virtual void virtual_hook (int id, void *data)

Private Attributes

OPopupMenuPrivate * d


Detailed Description

A menu with title items.

OPopupMenu 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.

Author:
Daniel M. Duley <mosfet@kde.org>

Hamish Rodda <meddie@yoyo.its.monash.edu.au>

Definition at line 129 of file opopupmenu.h.


Constructor & Destructor Documentation

Opie::Ui::OPopupMenu::OPopupMenu QWidget *  parent = 0,
const char *  name = 0
 

Constructs a OPopupMenu.

Opie::Ui::OPopupMenu::~OPopupMenu  ) 
 

Destructs the object

Opie::Ui::OPopupMenu::OPopupMenu const QString title,
QWidget *  parent = 0,
const char *  name = 0
 

Obsolete method provided for backwards compatibility only. Use the normal constructor and insertTitle instead.


Member Function Documentation

void Opie::Ui::OPopupMenu::aboutToShowContextMenu Opie::Ui::OPopupMenu menu,
int  menuItem,
QPopupMenu *  ctxMenu
[signal]
 

connect to this signal to be notified when a context menu is about to be shown

Parameters:
menu The menu that the context menu is about to be shown for
menuItem The menu item that the context menu is currently on
ctxMenu The context menu itself
Since:
3.2

Referenced by OPopupMenu::showCtxMenu().

void Opie::Ui::OPopupMenu::cancelContextMenuShow  ) 
 

Hides the context menu if shown

Since:
3.2

void Opie::Ui::OPopupMenu::changeTitle int  id,
const QPixmap &  icon,
const QString text
 

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

void Opie::Ui::OPopupMenu::changeTitle int  id,
const QString text
 

Changes the title of the item at the specified id. If a icon was previously set it is cleared.

virtual void Opie::Ui::OPopupMenu::closeEvent QCloseEvent *   )  [protected, virtual]
 

QPopupMenu* Opie::Ui::OPopupMenu::contextMenu  ) 
 

Returns the context menu associated with this menu

Since:
3.2

static OPopupMenu* Opie::Ui::OPopupMenu::contextMenuFocus  )  [static]
 

Returns the OPopupMenu associated with the current context menu

Since:
3.2

static int Opie::Ui::OPopupMenu::contextMenuFocusItem  )  [static]
 

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

Since:
3.2

void Opie::Ui::OPopupMenu::ctxMenuHiding  )  [protected, slot]
 

Referenced by OPopupMenu::contextMenu().

virtual bool Opie::Ui::OPopupMenu::eventFilter QObject *  obj,
QEvent *  event
[protected, virtual]
 

virtual void Opie::Ui::OPopupMenu::hideEvent QHideEvent *   )  [protected, virtual]
 

int Opie::Ui::OPopupMenu::insertTitle const QPixmap &  icon,
const QString text,
int  id = -1,
int  index = -1
 

Inserts a title item with the given icon and title.

int Opie::Ui::OPopupMenu::insertTitle const QString text,
int  id = -1,
int  index = -1
 

Inserts a title item with no icon.

void Opie::Ui::OPopupMenu::itemHighlighted int  whichItem  )  [protected, slot]
 

Referenced by OPopupMenu::ctxMenuHiding(), and OPopupMenu::showCtxMenu().

virtual void Opie::Ui::OPopupMenu::keyPressEvent QKeyEvent *  e  )  [protected, virtual]
 

void Opie::Ui::OPopupMenu::resetKeyboardVars bool  noMatches = false  )  [protected, slot]
 

Since:
3.1

Referenced by OPopupMenu::closeEvent(), and OPopupMenu::keyPressEvent().

void Opie::Ui::OPopupMenu::setKeyboardShortcutsEnabled bool  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.

Since:
3.1

void Opie::Ui::OPopupMenu::setKeyboardShortcutsExecute bool  enable  ) 
 

Enables execution of the menu item once it is uniquely specified. Defaults to off.

Since:
3.1

void Opie::Ui::OPopupMenu::setTitle const QString title  ) 
 

Obsolete method provided for backwards compatibility only. Use insertTitle and changeTitle instead.

Referenced by OpieUIDemo::OpieUIDemo().

void Opie::Ui::OPopupMenu::showCtxMenu QPoint  pos  )  [protected, slot]
 

Referenced by OPopupMenu::eventFilter(), and OPopupMenu::itemHighlighted().

QString Opie::Ui::OPopupMenu::title int  id = -1  )  const
 

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.

QPixmap Opie::Ui::OPopupMenu::titlePixmap int  id  )  const
 

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

QString Opie::Ui::OPopupMenu::underlineText const QString text,
uint  length
[protected, slot]
 

Since:
3.1

Referenced by OPopupMenu::keyPressEvent().

virtual void Opie::Ui::OPopupMenu::virtual_hook int  id,
void *  data
[protected, virtual]
 


Member Data Documentation

OPopupMenuPrivate* Opie::Ui::OPopupMenu::d [private]
 

Definition at line 257 of file opopupmenu.h.

Referenced by OPopupMenu::closeEvent(), OPopupMenu::contextMenu(), OPopupMenu::eventFilter(), OPopupMenu::hideEvent(), OPopupMenu::itemHighlighted(), OPopupMenu::keyPressEvent(), OPopupMenu::resetKeyboardVars(), OPopupMenu::setKeyboardShortcutsEnabled(), OPopupMenu::setKeyboardShortcutsExecute(), OPopupMenu::setTitle(), OPopupMenu::showCtxMenu(), OPopupMenu::title(), and OPopupMenu::~OPopupMenu().


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 18:02:01 2005 for OPIE by  doxygen 1.4.2