VR-Forces 4.1 Class Documentation
List of all members | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtMenuWidget Class Reference
Inheritance diagram for DtMenuWidget:
Inheritance graph
[legend]

Public Slots

virtual void validateMenuItems ()
 slots

Signals

void validate ()
 signals
void menuRecreated (DtMainMenuType)
 Emitted when a menu is recreated via the recreateMenu method.

Public Member Functions

 DtMenuWidget (QWidget *parent=NULL)
virtual ~DtMenuWidget ()
virtual bool init (DtFeatureActionManager *)
virtual bool createMenuSystem ()
virtual DtMenuItemType typeFromAction (QAction *action)
 Asks all the menus to see if this QAction is part of their popup system, and, if so, returns the type assocated with it.
virtual DtPopupMenumenuFromAction (QAction *)
 Returns the menu that has the particular action.
virtual QActionmenuItemForType (DtMenuItemType iType)
 Asks all the menus if they have a menu item of this type, and, if so, return it.
virtual DtPopupMenumenuForType (DtMainMenuType iType)
 Returns the menu that is of the particular type.
virtual DtPopupMenumenuThatHasMenuType (DtMenuItemType iType)
 Returns the menu that contains the particular menu item.
virtual DtPopupMenumenuThatHasActionGroupType (DtMenuItemType iType)
 Returns the menu that contains the particular action group for the menu item supplied.
virtual DtPopupMenucreateMenuOfType (DtMainMenuType iType, QWidget *owner)
 Creates and returns a menu of the specific type without adding it to internal structures.
virtual DtPopupMenuinitializeMenuOfType (DtMainMenuType iType, QWidget *owner)
 Creates a new menu object and initializes it with menu items.
virtual bool createMenu (DtPopupMenu *newMenu)
 Applies any global removes of menu items and creates the menu items for the menu.
virtual void updateMenuItems ()
 Cycles through all popup menus, telling them to update as need be.
virtual DtPopupMenumenuWithName (const QString &)
 Returns a menu that has the given menu name.
virtual DtMenuItemType uniqueId () const
 Returns a unique id amongst all menus.
virtual DtMainMenuType uniqueMenuId () const
 Returns an id (max + 1) for a menu.
virtual DtMainMenuType insertItem (DtPopupMenu *menu, int index=-1)
 Inserts the precreated menu (assigning it a new unique id) into internal structures.
virtual QActionaddMenuItem (const QString &featureName, const QString &item, const QString &addToMenu, DtMenuItemType &retId, bool toggle=false, QObject *actionReceiver=NULL, const char *action=NULL, QObject *validationReceiver=NULL, const char *validation=NULL, const QString &tooltip=QString::null, const QString &accelerator=QString::null, bool addSep=false)
 Adds a new menu item given the menu item, path to add, action and validator.
virtual void appendMenuValidator (const QString &menuName, const QString &itemName, QObject *validatorReceiver, char *validator)
 Adds the specified validator to a list of validators that can be called for the menu item.
virtual bool removeMenuItem (const QString &item)
 Removes the menu item specified by the menu path (i.e.
virtual bool removeMenuGroup (const QString &group)
 Removes all menu items from the specified group and the group itself specified by the menu path (i.e.
virtual void recreateMenu (DtMainMenuType menu, bool useBaseMenuIfExists=true)
 Deletes current and creates a new menu of the specified type in the same spot that the menu was defined to be in.
DtFeatureActionManagerfeatureActionManager () const
 Accessors for featureActionManager.
void setFeatureActionManager (DtFeatureActionManager *)
virtual DtPopupMenumenuAt (int iPos)
 Returns the menu at the specified position.
virtual QString menuTextForAction (QAction *)
 Returns text for the menu (or sub-menu) that contains the action.
virtual int insertPopupMenu (DtMainMenuType iType, DtPopupMenuCreatorFcn fcn, DtMainMenuType iPos=DtNoMenu)
 Use this function add popup menus that will be created during the "create" call.
virtual int replacePopupMenu (DtMainMenuType iType, DtPopupMenuCreatorFcn with)
 Replaces either the menu scheduled for creation or removes the current menu at given position and replaces it with the supplied menu.
virtual bool removePopupMenu (DtMainMenuType iType, bool permenant=true)
 Removes a popup menu from either the internal create list (if the menu has not been created yet) or from the current menu bar (if it has been created).
virtual DtPopupMenurestoreMenu (DtMainMenuType type)
 Creates the popup menu (if it does not currently exist) and inserts it at the position that it exists in the ordered creator list.
virtual void removeMenuAtPosition (int iPos, bool freeMemory=false)
 Removes the menu item at the specified poitions.
virtual QHash< DtMainMenuType,
DtPopupMenu * > & 
popupMenus ()
 Returns the popup menu objects list.
virtual void swapMenus (DtMainMenuType iA, DtMainMenuType iB)
 Swaps menu A with menu B (positionally). If created also swaps live.

Static Public Member Functions

static void globalInsertPopupMenu (DtMainMenuType iType, DtPopupMenuCreatorFcn fcn, DtMainMenuType iAfterType=DtNoMenu)
 Use these function to effect all menus created in the system.
static void globalReplacePopupMenu (DtMainMenuType iType, DtPopupMenuCreatorFcn with)
 Replaces the menu with the supplied creator with the new menu creator.
static void globalRemovePopupMenu (DtMainMenuType iType)
 Do not create the menu at this slot when creating menus.
static void globalSwapMenuPositions (DtMainMenuType iA, DtMainMenuType iB)
 Will swap the positions of menu item A with B.
static void globalCreateOnlyItemsForMenu (DtMainMenuType iType, QList< DtMenuItemType > menuItems)
 Use this call to schedule to only create the specified menu items for the particular menu.
static DtMenuWidgetcreate (QWidget *parent=NULL)
 Creates a new instance of this object.

Protected Member Functions

virtual void modifyLocalMenuWithGlobalChanges ()
 Called from the create routine, takes the local init of this menu and applies any changes added at the global level.
virtual DtPopupMenucreateMenu (DtPopupMenuCreatorFcn fcn, DtMainMenuType iType, int iPos=-1, bool initializeOnly=false, DtPopupMenu *menuBase=NULL)
 Creates a new menu item and puts it at position. If position is -1, it is appened.
virtual int positionOfCreator (DtPopupMenuCreatorFcn fcn)
 Returns the position of the creator function in internal lists.
virtual int positionOfCreator (DtMainMenuType iType)
virtual DtMainMenuType typeForCreator (DtPopupMenuCreatorFcn fcn)
 Returns the type of the menu for the specified creator.
virtual void removeOrderedCreator (int iPos)
 Removes a creator from the ordered list.
virtual void insertOrderedCreator (DtPopupMenuCreatorFcn, int iPos)
 Inserts a creator into the ordered list at the specified position (-1 appends)

Protected Attributes

QList< DtPopupMenuCreatorFcnmyOrderedCreators
QHash< DtMainMenuType,
DtPopupCreator
myPopupMenuCreators
QHash< DtMainMenuType,
DtPopupMenu * > 
myPopupMenus
bool myCreated
QWidgetmyOwner
bool myGloballyModified
DtFeatureActionManagermyFeatureActionManager

Static Protected Attributes

static QList< DtGlobalChangemyGlobalPopups

Constructor & Destructor Documentation

DtMenuWidget::DtMenuWidget ( QWidget parent = NULL)
virtual DtMenuWidget::~DtMenuWidget ( )
virtual

Member Function Documentation

virtual bool DtMenuWidget::init ( DtFeatureActionManager )
virtual

Reimplemented in DtTMMenuWidget.

virtual bool DtMenuWidget::createMenuSystem ( )
virtual
virtual DtMenuItemType DtMenuWidget::typeFromAction ( QAction action)
virtual

Asks all the menus to see if this QAction is part of their popup system, and, if so, returns the type assocated with it.

virtual DtPopupMenu* DtMenuWidget::menuFromAction ( QAction )
virtual

Returns the menu that has the particular action.

virtual QAction* DtMenuWidget::menuItemForType ( DtMenuItemType  iType)
virtual

Asks all the menus if they have a menu item of this type, and, if so, return it.

virtual DtPopupMenu* DtMenuWidget::menuForType ( DtMainMenuType  iType)
virtual

Returns the menu that is of the particular type.

virtual DtPopupMenu* DtMenuWidget::menuThatHasMenuType ( DtMenuItemType  iType)
virtual

Returns the menu that contains the particular menu item.

virtual DtPopupMenu* DtMenuWidget::menuThatHasActionGroupType ( DtMenuItemType  iType)
virtual

Returns the menu that contains the particular action group for the menu item supplied.

virtual DtPopupMenu* DtMenuWidget::createMenuOfType ( DtMainMenuType  iType,
QWidget owner 
)
virtual

Creates and returns a menu of the specific type without adding it to internal structures.

virtual DtPopupMenu* DtMenuWidget::initializeMenuOfType ( DtMainMenuType  iType,
QWidget owner 
)
virtual

Creates a new menu object and initializes it with menu items.

Must call createMenu() on the menu to finalize the process. Calling this first gives an opportunity to modify the menu before final creation

virtual bool DtMenuWidget::createMenu ( DtPopupMenu newMenu)
virtual

Applies any global removes of menu items and creates the menu items for the menu.

virtual void DtMenuWidget::updateMenuItems ( )
virtual

Cycles through all popup menus, telling them to update as need be.

virtual DtPopupMenu* DtMenuWidget::menuWithName ( const QString &  )
virtual

Returns a menu that has the given menu name.

Only valid after the menu system has been created

virtual DtMenuItemType DtMenuWidget::uniqueId ( ) const
virtual

Returns a unique id amongst all menus.

virtual DtMainMenuType DtMenuWidget::uniqueMenuId ( ) const
virtual

Returns an id (max + 1) for a menu.

virtual DtMainMenuType DtMenuWidget::insertItem ( DtPopupMenu menu,
int  index = -1 
)
virtual

Inserts the precreated menu (assigning it a new unique id) into internal structures.

Parameters
indexOptional position on the menu for the new item. If -1 (the default) it will be added to the end of the menu.
virtual QAction* DtMenuWidget::addMenuItem ( const QString &  featureName,
const QString &  item,
const QString &  addToMenu,
DtMenuItemType retId,
bool  toggle = false,
QObject actionReceiver = NULL,
const char *  action = NULL,
QObject validationReceiver = NULL,
const char *  validation = NULL,
const QString &  tooltip = QString::null,
const QString &  accelerator = QString::null,
bool  addSep = false 
)
virtual

Adds a new menu item given the menu item, path to add, action and validator.

If menu has been created, returns the new QAction, else returns null

virtual void DtMenuWidget::appendMenuValidator ( const QString &  menuName,
const QString &  itemName,
QObject validatorReceiver,
char *  validator 
)
virtual

Adds the specified validator to a list of validators that can be called for the menu item.

virtual bool DtMenuWidget::removeMenuItem ( const QString &  item)
virtual

Removes the menu item specified by the menu path (i.e.

Set/Heading...). Calls down to removeMenuItem(const QString&) of the found menu.

virtual bool DtMenuWidget::removeMenuGroup ( const QString &  group)
virtual

Removes all menu items from the specified group and the group itself specified by the menu path (i.e.

File/Open). Calls down to removeMenuGroup(const QString&) of the found menu

virtual void DtMenuWidget::recreateMenu ( DtMainMenuType  menu,
bool  useBaseMenuIfExists = true 
)
virtual

Deletes current and creates a new menu of the specified type in the same spot that the menu was defined to be in.

DtFeatureActionManager * DtMenuWidget::featureActionManager ( ) const
inline

Accessors for featureActionManager.

References myFeatureActionManager.

void DtMenuWidget::setFeatureActionManager ( DtFeatureActionManager m)
inline
virtual DtPopupMenu* DtMenuWidget::menuAt ( int  iPos)
virtual

Returns the menu at the specified position.

virtual QString DtMenuWidget::menuTextForAction ( QAction )
virtual

Returns text for the menu (or sub-menu) that contains the action.

Firsts find the popup menu that contains the action, then asks the popup menu for the menu text that contains the action

virtual int DtMenuWidget::insertPopupMenu ( DtMainMenuType  iType,
DtPopupMenuCreatorFcn  fcn,
DtMainMenuType  iPos = DtNoMenu 
)
virtual

Use this function add popup menus that will be created during the "create" call.

If the menu has already been created, these routines will immediately add the popup menus to the menu bar. If iPos is -1 the new menu will be appended to the end. The type is the type of menu item this represents (as defined in menuItems.h)

virtual int DtMenuWidget::replacePopupMenu ( DtMainMenuType  iType,
DtPopupMenuCreatorFcn  with 
)
virtual

Replaces either the menu scheduled for creation or removes the current menu at given position and replaces it with the supplied menu.

virtual bool DtMenuWidget::removePopupMenu ( DtMainMenuType  iType,
bool  permenant = true 
)
virtual

Removes a popup menu from either the internal create list (if the menu has not been created yet) or from the current menu bar (if it has been created).

If permenant is true, then removes the creator from the system as well

virtual DtPopupMenu* DtMenuWidget::restoreMenu ( DtMainMenuType  type)
virtual

Creates the popup menu (if it does not currently exist) and inserts it at the position that it exists in the ordered creator list.

If the menu is already created it returns that menu. If the menu widget has not been intialized, it returns NULL

virtual void DtMenuWidget::removeMenuAtPosition ( int  iPos,
bool  freeMemory = false 
)
virtual

Removes the menu item at the specified poitions.

virtual QHash<DtMainMenuType, DtPopupMenu*>& DtMenuWidget::popupMenus ( )
virtual

Returns the popup menu objects list.

virtual void DtMenuWidget::swapMenus ( DtMainMenuType  iA,
DtMainMenuType  iB 
)
virtual

Swaps menu A with menu B (positionally). If created also swaps live.

static void DtMenuWidget::globalInsertPopupMenu ( DtMainMenuType  iType,
DtPopupMenuCreatorFcn  fcn,
DtMainMenuType  iAfterType = DtNoMenu 
)
static

Use these function to effect all menus created in the system.

Insert this menu at the specific position when menu is created. If iType is -1, the menu item will be appended, else it will be appened after the specified menu

static void DtMenuWidget::globalReplacePopupMenu ( DtMainMenuType  iType,
DtPopupMenuCreatorFcn  with 
)
static

Replaces the menu with the supplied creator with the new menu creator.

static void DtMenuWidget::globalRemovePopupMenu ( DtMainMenuType  iType)
static

Do not create the menu at this slot when creating menus.

static void DtMenuWidget::globalSwapMenuPositions ( DtMainMenuType  iA,
DtMainMenuType  iB 
)
static

Will swap the positions of menu item A with B.

static void DtMenuWidget::globalCreateOnlyItemsForMenu ( DtMainMenuType  iType,
QList< DtMenuItemType menuItems 
)
static

Use this call to schedule to only create the specified menu items for the particular menu.

What will basically happen is after the menu has the menu items created, it will be told to only keep the menu items listed in the value list (i.e. remove all other menu items)

static DtMenuWidget* DtMenuWidget::create ( QWidget parent = NULL)
static

Creates a new instance of this object.

Reimplemented in DtTMMenuWidget.

virtual void DtMenuWidget::modifyLocalMenuWithGlobalChanges ( )
protectedvirtual

Called from the create routine, takes the local init of this menu and applies any changes added at the global level.

virtual DtPopupMenu* DtMenuWidget::createMenu ( DtPopupMenuCreatorFcn  fcn,
DtMainMenuType  iType,
int  iPos = -1,
bool  initializeOnly = false,
DtPopupMenu menuBase = NULL 
)
protectedvirtual

Creates a new menu item and puts it at position. If position is -1, it is appened.

virtual int DtMenuWidget::positionOfCreator ( DtPopupMenuCreatorFcn  fcn)
protectedvirtual

Returns the position of the creator function in internal lists.

virtual int DtMenuWidget::positionOfCreator ( DtMainMenuType  iType)
protectedvirtual
virtual DtMainMenuType DtMenuWidget::typeForCreator ( DtPopupMenuCreatorFcn  fcn)
protectedvirtual

Returns the type of the menu for the specified creator.

virtual void DtMenuWidget::removeOrderedCreator ( int  iPos)
protectedvirtual

Removes a creator from the ordered list.

virtual void DtMenuWidget::insertOrderedCreator ( DtPopupMenuCreatorFcn  ,
int  iPos 
)
protectedvirtual

Inserts a creator into the ordered list at the specified position (-1 appends)

void DtMenuWidget::validate ( )
signal

signals

void DtMenuWidget::menuRecreated ( DtMainMenuType  )
signal

Emitted when a menu is recreated via the recreateMenu method.

Use this signal to restore any connections made to a menu that has been previously removed

virtual void DtMenuWidget::validateMenuItems ( )
virtualslot

slots

Member Data Documentation

QList<DtPopupMenuCreatorFcn> DtMenuWidget::myOrderedCreators
protected
QHash<DtMainMenuType, DtPopupCreator> DtMenuWidget::myPopupMenuCreators
protected
QHash<DtMainMenuType, DtPopupMenu*> DtMenuWidget::myPopupMenus
protected
bool DtMenuWidget::myCreated
protected
QWidget* DtMenuWidget::myOwner
protected
bool DtMenuWidget::myGloballyModified
protected
DtFeatureActionManager* DtMenuWidget::myFeatureActionManager
protected
QList<DtGlobalChange> DtMenuWidget::myGlobalPopups
staticprotected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)