VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtMenuConfiguration Class Reference

A configuration of a menu layout. A menu configuration manages an ordered collection of menu paths that make up a menu. A menu configuration is used by the VR-Vantage's menu assembler to create the actual GUI elements for the menu.

The order the collection of menu paths follow depend on each menu paths' sort flags (see DtMenuConfiguration::MenuSortFlags). The sort flags for any menu item paths are ignored. If a menu path's sort flags has the NoSort flag enabled, then the menu path's children menus and menu items keep the order specified in the menu configuration. If a menu path's sort flags has its NoSort flag disabled and has any of the Sort[AllAphabetically|WithinSubmenus|BetweenSeparators|BetweenSubmenus] flags enabled, then the menu path's children menu items are not guaranteed to keep the order specified in the menu configuration. Additionally, the children menu items are sorted by their display string - defined within the C++ implementation of the child menu or menu item.

See Also
DtMenuAssembler
DtQtMenuAssembler
DtMenuPath
Inheritance diagram for makVrv::DtMenuConfiguration:
Inheritance graph
[legend]

Classes

struct  OrderParameters
 

Public Types

enum  MenuSortFlags {
  NoSort = 0x00000000, SortAllAlphabetically = 0x00000001, SortWithinSubmenus = 0x00000002, SortBetweenSeparators = 0x00000004,
  SortBetweenSubMenus = 0x00000010
}
 
typedef std::list< DtMenuPathMenuPathList
 
typedef std::set< DtMenuPathMenuPathSet
 
- Public Types inherited from makVrv::DtConfiguration
typedef std::map< std::string,
std::string > 
ParameterMap
 

Public Member Functions

 DtMenuConfiguration ()
 
virtual ~DtMenuConfiguration ()
 
void addMenuPath (const DtMenuPath &, const MenuSortFlags &sortFlagsIfMenu=(MenuSortFlags)(SortAllAlphabetically|SortWithinSubmenus|SortBetweenSeparators))
 
void addMenuPathAfter (const DtMenuPath &newPath, const DtMenuPath &relativeTo, const MenuSortFlags &sortFlagsIfMenu=(MenuSortFlags)(SortAllAlphabetically|SortWithinSubmenus|SortBetweenSeparators))
 
void addMenuPathBefore (const DtMenuPath &newPath, const DtMenuPath &relativeTo, const MenuSortFlags &sortFlagsIfMenu=(MenuSortFlags)(SortAllAlphabetically|SortWithinSubmenus|SortBetweenSeparators))
 
void addConfiguration (const DtMenuConfiguration &subConfiguration)
 
void removeMenuPath (const DtMenuPath &)
 
void getRootPaths (MenuPathList &children) const
 
void getChildren (const DtMenuPath &path, MenuPathList &children) const
 
void sortChildren (MenuPathList &children) const
 
DtMenuConfigurationoperator= (const DtMenuConfiguration &rhs)
 
void merge (const DtMenuConfiguration &rhs)
 
bool hasMenuPath (const DtMenuPath &p) const
 
bool menuSortFlags (const DtMenuPath &p, MenuSortFlags &flags) const
 
- Public Member Functions inherited from makVrv::DtConfiguration
 DtConfiguration (const std::string &name="")
 
 DtConfiguration (const DtConfiguration &)
 
DtConfigurationoperator= (const DtConfiguration &)
 
virtual ~DtConfiguration ()
 
virtual const std::string & name () const
 
virtual void setName (const std::string &name)
 
virtual const std::string * findOptionalParameter (const std::string &name) const
 
virtual void setOptionalParameter (const std::string &name, const std::string &value)
 
virtual void setOptionalParameters (const ParameterMap &)
 
virtual void removeOptionalParameter (const std::string &name)
 
const ParameterMapoptionalParameters () const
 

Protected Types

typedef std::map< DtMenuPath,
OrderParameters
MenuPathOrderMap
 
typedef std::map< DtMenuPath,
MenuSortFlags
MenuPathSortFlagsMap
 

Protected Member Functions

int getNewWeight ()
 
void addMenuPath (const DtMenuPath &, int weight)
 
bool sortAbsolute (const DtMenuPath &a, const DtMenuPath &b) const
 
- Protected Member Functions inherited from makVrv::DtConfiguration
template<class Archive >
void _serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

MenuPathSet myMenuPaths
 
MenuPathOrderMap myMenuOrder
 
MenuPathSortFlagsMap myMenuSortFlags
 
int myCurrentWeight
 
- Protected Attributes inherited from makVrv::DtConfiguration
std::string myName
 
ParameterMap myOptionalParameters
 
DtProxyWP myAttachedInterface
 

Member Typedef Documentation

Member Enumeration Documentation

The SortAllAlphabetically, SortWithinSubmenus, SortBetweenSeparators, and SortBetweenSubMenus flags can be ORed together to get a combination of their behavior.

Enumerator
NoSort 
SortAllAlphabetically 
SortWithinSubmenus 
SortBetweenSeparators 
SortBetweenSubMenus 

Constructor & Destructor Documentation

makVrv::DtMenuConfiguration::DtMenuConfiguration ( )

CTOR.

virtual makVrv::DtMenuConfiguration::~DtMenuConfiguration ( )
virtual

DTOR.

Member Function Documentation

void makVrv::DtMenuConfiguration::addMenuPath ( const DtMenuPath ,
const MenuSortFlags sortFlagsIfMenu = (MenuSortFlags)(SortAllAlphabetically|SortWithinSubmenus|SortBetweenSeparators) 
)

Adds the menu path (as well as its entire family).

void makVrv::DtMenuConfiguration::addMenuPathAfter ( const DtMenuPath newPath,
const DtMenuPath relativeTo,
const MenuSortFlags sortFlagsIfMenu = (MenuSortFlags)(SortAllAlphabetically|SortWithinSubmenus|SortBetweenSeparators) 
)

Adds the menu path after a relative (they must share the same parent).

void makVrv::DtMenuConfiguration::addMenuPathBefore ( const DtMenuPath newPath,
const DtMenuPath relativeTo,
const MenuSortFlags sortFlagsIfMenu = (MenuSortFlags)(SortAllAlphabetically|SortWithinSubmenus|SortBetweenSeparators) 
)

Adds the menu path before a relative (they must share the same parent).

void makVrv::DtMenuConfiguration::addConfiguration ( const DtMenuConfiguration subConfiguration)

Merges from an external configurations into this configuration.

void makVrv::DtMenuConfiguration::removeMenuPath ( const DtMenuPath )

Remove the menu path from this menu configuration.

void makVrv::DtMenuConfiguration::getRootPaths ( MenuPathList children) const

Get all paths which have no parents (aka top level paths).

void makVrv::DtMenuConfiguration::getChildren ( const DtMenuPath path,
MenuPathList children 
) const

Get a list of children (first generation only) for a given path./ An absolute path must be given./.

If there are these three menu items:
File\
File\Open\
File\Open\Terrain
And you call getChildren("File\",children).
children will only contain 'File\Open'.
void makVrv::DtMenuConfiguration::sortChildren ( MenuPathList children) const

Sort the list of children.

DtMenuConfiguration& makVrv::DtMenuConfiguration::operator= ( const DtMenuConfiguration rhs)
inline
void makVrv::DtMenuConfiguration::merge ( const DtMenuConfiguration rhs)

Merges in contents of supplied configuration, adding new paths. Order will get added at the end.

bool makVrv::DtMenuConfiguration::hasMenuPath ( const DtMenuPath p) const

Returns true if the menu configuration has the provided menu path.

bool makVrv::DtMenuConfiguration::menuSortFlags ( const DtMenuPath p,
MenuSortFlags flags 
) const

Returns the sort flags for the provided menu path.

int makVrv::DtMenuConfiguration::getNewWeight ( )
protected

Get new weight.

void makVrv::DtMenuConfiguration::addMenuPath ( const DtMenuPath ,
int  weight 
)
protected
bool makVrv::DtMenuConfiguration::sortAbsolute ( const DtMenuPath a,
const DtMenuPath b 
) const
protected

Member Data Documentation

MenuPathSet makVrv::DtMenuConfiguration::myMenuPaths
protected

Referenced by operator=().

MenuPathOrderMap makVrv::DtMenuConfiguration::myMenuOrder
protected

Referenced by operator=().

MenuPathSortFlagsMap makVrv::DtMenuConfiguration::myMenuSortFlags
protected

Referenced by operator=().

int makVrv::DtMenuConfiguration::myCurrentWeight
protected

Referenced by operator=().


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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)