VR-Forces 4.0.4 Class Documentation
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtContextMenu Class Reference

Creates a menu based on context. More...

Inheritance diagram for DtContextMenu:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual bool createMenu ()
 Returns true if something was created.

Public Member Functions

 DtContextMenu (QWidget *parent)
 default constructor
virtual ~DtContextMenu ()
 destructor
virtual void setOwner (DtBaseWindow *)
virtual DtBaseWindowowner () const
virtual void setMenuWidget (DtMenuWidget *menuWidget)
virtual void addMenuActionGroup (DtMainMenuType iType, DtMenuItemType iActionGroup, bool addSeparator=false, DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
 Note, these add routine will not replace items if the menu type and group already exist in the list.
virtual void addMenu (QString menuName, DtMainMenuType iType, bool addSeparator=false, DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
virtual void addMenuItem (DtMenuItemType iType, bool addSeparator=false, DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
virtual void addMenuForGroup (QString menuName, DtMainMenuType iType, DtMenuItemType iGroup, bool addSeparator, DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
virtual void addSeparator (DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
 Simply adds a separator at the current position.
virtual void removeOccurancesOf (DtMenuItemType iType, DtMenuItemType iActionGroup=DtNoMenuItem)
 If action group is not -1, only removes a specific type/group match, else removes all occurnaces of that type.
virtual void removeItem (const QString &name)
 Removes any item (menu, menu item) that matches the give name.
virtual int addMenuItem (QString itemName, QObject *slotObj, const char *slot, QString accel=QString::null, bool addSeparator=false, DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
 Allow for adding context items that are created as part of this menu.
virtual void cleanup ()
 Cleans up allocated memory.

Static Public Member Functions

static DtContextMenucreate (QWidget *parent)

Protected Member Functions

virtual void addMenuItems ()
 Override to add menu items to this context menu.
virtual bool exists (const DtContextItems &item)
 Returns true if the item exists.
virtual void addContextItem (DtContextItems &item, DtMenuItemType iBeforeType=DtNoMenuItem, DtMenuItemType iAfterType=DtNoMenuItem)
 Adds this new context item before or after the specified types (if not -1)
virtual void insertBefore (DtContextItems &item, DtMenuItemType iType)
 Inserts item before the specified type.
virtual void insertAfter (DtContextItems &item, DtMenuItemType iType)
 Inserts after the specified type.
virtual const char * eventMenuContext () const
 Override to give context for event signaller.
virtual DtMenuItemType uniqueId () const
virtual bool matchesName (QString lhs, QString rhs) const
 Returns true if the supplied name matches the menu name of this menu. Will take & into account.
virtual void addedMenuItem (QObject *, const DtContextItems &)
 Called right after a menu item is added with the item and context.

Protected Attributes

DtBaseWindowmyOwner
QList< DtContextItemsmyContextItems
QList< QObject * > myAllocatedItems
DtMenuWidgetmyMenuWidget
int myInternalIdCount

Detailed Description

Creates a menu based on context.


Constructor & Destructor Documentation

default constructor

virtual DtContextMenu::~DtContextMenu ( ) [virtual]

destructor


Member Function Documentation

virtual void DtContextMenu::setOwner ( DtBaseWindow ) [virtual]
virtual DtBaseWindow* DtContextMenu::owner ( ) const [virtual]
virtual void DtContextMenu::setMenuWidget ( DtMenuWidget menuWidget) [virtual]
virtual void DtContextMenu::addMenuActionGroup ( DtMainMenuType  iType,
DtMenuItemType  iActionGroup,
bool  addSeparator = false,
DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [virtual]

Note, these add routine will not replace items if the menu type and group already exist in the list.

If before or after type are not -1, will add this item before or after the specified type

virtual void DtContextMenu::addMenu ( QString  menuName,
DtMainMenuType  iType,
bool  addSeparator = false,
DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [virtual]
virtual void DtContextMenu::addMenuItem ( DtMenuItemType  iType,
bool  addSeparator = false,
DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [virtual]
virtual void DtContextMenu::addMenuForGroup ( QString  menuName,
DtMainMenuType  iType,
DtMenuItemType  iGroup,
bool  addSeparator,
DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [virtual]
virtual void DtContextMenu::addSeparator ( DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [virtual]

Simply adds a separator at the current position.

virtual void DtContextMenu::removeOccurancesOf ( DtMenuItemType  iType,
DtMenuItemType  iActionGroup = DtNoMenuItem 
) [virtual]

If action group is not -1, only removes a specific type/group match, else removes all occurnaces of that type.

virtual void DtContextMenu::removeItem ( const QString &  name) [virtual]

Removes any item (menu, menu item) that matches the give name.

virtual int DtContextMenu::addMenuItem ( QString  itemName,
QObject slotObj,
const char *  slot,
QString  accel = QString::null,
bool  addSeparator = false,
DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [virtual]

Allow for adding context items that are created as part of this menu.

The integer returned is an id that can be used to identify this menu item in the addedMenuItem method for the context passed in

virtual void DtContextMenu::cleanup ( ) [virtual]

Cleans up allocated memory.

virtual bool DtContextMenu::createMenu ( ) [virtual, slot]

Returns true if something was created.

virtual void DtContextMenu::addMenuItems ( ) [protected, virtual]

Override to add menu items to this context menu.

Reimplemented in DtFormationRightClickMenu.

virtual bool DtContextMenu::exists ( const DtContextItems item) [protected, virtual]

Returns true if the item exists.

virtual void DtContextMenu::addContextItem ( DtContextItems item,
DtMenuItemType  iBeforeType = DtNoMenuItem,
DtMenuItemType  iAfterType = DtNoMenuItem 
) [protected, virtual]

Adds this new context item before or after the specified types (if not -1)

virtual void DtContextMenu::insertBefore ( DtContextItems item,
DtMenuItemType  iType 
) [protected, virtual]

Inserts item before the specified type.

virtual void DtContextMenu::insertAfter ( DtContextItems item,
DtMenuItemType  iType 
) [protected, virtual]

Inserts after the specified type.

virtual const char* DtContextMenu::eventMenuContext ( ) const [inline, protected, virtual]

Override to give context for event signaller.

References DtContextMenuEvent.

virtual DtMenuItemType DtContextMenu::uniqueId ( ) const [protected, virtual]
virtual bool DtContextMenu::matchesName ( QString  lhs,
QString  rhs 
) const [protected, virtual]

Returns true if the supplied name matches the menu name of this menu. Will take & into account.

virtual void DtContextMenu::addedMenuItem ( QObject ,
const DtContextItems  
) [protected, virtual]

Called right after a menu item is added with the item and context.

Reimplemented in DtFormationRightClickMenu.

static DtContextMenu* DtContextMenu::create ( QWidget parent) [static]

Member Data Documentation


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)