Views
Gadgets Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvMenuItemGroup Class Reference

Named property class. More...

#include <ilviews/gadgets/amenu.h>

Inheritance diagram for IlvMenuItemGroup:
IlvNamedProperty IlvValueInterface IlvMenuItemHighlighter IlvMenuItemSelector

Public Member Functions

 IlvMenuItemGroup (IlSymbol *symbol)
 Constructor. More...
 
void addItem (const IlSymbol *name)
 Adds an item to the group. More...
 
void addItem (IlvMenuItem *item)
 Adds an item to the group. More...
 
void addTo (IlvAbstractMenu *menu)
 Adds the menu items group to the specified abstract menu. More...
 
IlBoolean contains (const IlSymbol *name) const
 Indicates whether the specified name is managed by this group. More...
 
IlvAbstractMenugetAbstractMenu () const
 Returns the IlvAbstractMenu object to which the group is connected. More...
 
IlvMenuItemgetItem (const IlSymbol *name) const
 Returns the item of the group corresponding to the specified name. More...
 
const IlSymbol *const * getItemNames (IlUShort &count) const
 Returns an array of all the items names of this group. More...
 
IlvMenuItem *const * getItems (IlUShort &count) const
 Returns an array of all the items names of this group. More...
 
void removeFrom (IlvAbstractMenu *menu)
 Removes the menu items group from the specified abstract menu. More...
 
void removeItem (const IlSymbol *name)
 Removes an item from the group. More...
 

Static Public Member Functions

static IlvMenuItemGroupGet (const IlvAbstractMenu *menu, const IlSymbol *name)
 Returns the IlvMenuItemGroup object with the specified name and connected to the specified menu. More...
 
static IlvMenuItemGroupRemoveFrom (IlvAbstractMenu *menu, const IlSymbol *name)
 Removes the menu items group specified from the specified abstract menu. More...
 

Detailed Description

Named property class.

Library: ilvgadgt

The class IlvMenuItemGroup is a named property that can be set on an IlvAbstractMenu object to implement menu items groups. A group of menu item is a list of menu item. The menu items are referenced by their name inside the group, and thus, changing the name of an item located in a group is not allowed. Furthermore, you must be aware that you cannot add a group to a menu if this menu already has a named property with the same name as the group.

See also
IlvAbstractMenu, IlvMenuItem, addTo().

Constructor & Destructor Documentation

◆ IlvMenuItemGroup()

IlvMenuItemGroup::IlvMenuItemGroup ( IlSymbol symbol)

Constructor.

Initializes a new instance of the IlvMenuItemGroup class.

Parameters
symbolThe group name.

Member Function Documentation

◆ addItem() [1/2]

void IlvMenuItemGroup::addItem ( const IlSymbol name)

Adds an item to the group.

Parameters
nameThe item name.
See also
removeItem().

◆ addItem() [2/2]

void IlvMenuItemGroup::addItem ( IlvMenuItem item)

Adds an item to the group.

This member function call the addItem() member function that takes an IlSymbol as parameter with the name of item.

If item has no name, it is given a unique name inside this group.

Parameters
itemThe item.
See also
removeItem().

◆ addTo()

void IlvMenuItemGroup::addTo ( IlvAbstractMenu menu)

Adds the menu items group to the specified abstract menu.

Does nothing if the menu already has a named property with the same symbol as this.

Parameters
menuThe abstract menu.
See also
Get(), removeFrom().

◆ contains()

IlBoolean IlvMenuItemGroup::contains ( const IlSymbol name) const

Indicates whether the specified name is managed by this group.

Parameters
nameThe item name.
Returns
IlTrue if the specified name is managed by this group and IlFalse if it is not.
See also
getItem().

◆ Get()

static IlvMenuItemGroup* IlvMenuItemGroup::Get ( const IlvAbstractMenu menu,
const IlSymbol name 
)
static

Returns the IlvMenuItemGroup object with the specified name and connected to the specified menu.

Parameters
menuThe abstract menu.
nameThe group name.
Returns
The IlvMenuItemGroup object with the specified name connected to the specified menu.
See also
addTo(), removeFrom().

◆ getAbstractMenu()

IlvAbstractMenu* IlvMenuItemGroup::getAbstractMenu ( ) const

Returns the IlvAbstractMenu object to which the group is connected.

Returns
The IlvAbstractMenu object to which the group is connected. Returns 0 if the group has not been added to an IlvAbstractMenu object.
See also
addTo().

◆ getItem()

IlvMenuItem* IlvMenuItemGroup::getItem ( const IlSymbol name) const

Returns the item of the group corresponding to the specified name.

Parameters
nameThe item name.
Returns
The item corresponding to the specified name.
See also
contains().

◆ getItemNames()

const IlSymbol* const* IlvMenuItemGroup::getItemNames ( IlUShort count) const

Returns an array of all the items names of this group.

Parameters
countThe number of elements of the returned array.
Returns
An array of count symbols that includes all the items names stored in the group.
See also
getItems(), getItem().

◆ getItems()

IlvMenuItem* const* IlvMenuItemGroup::getItems ( IlUShort count) const

Returns an array of all the items names of this group.

Parameters
countThe number of elements of the returned array.
Returns
An array of count items that includes all the items stored in the group. If the group has not been connected to an IlvAbstractMenu object, the method returns 0.
See also
getItemNames(), getItem().

◆ removeFrom()

void IlvMenuItemGroup::removeFrom ( IlvAbstractMenu menu)

Removes the menu items group from the specified abstract menu.

Parameters
menuThe abstract menu.
See also
Get(), addTo(), RemoveFrom().

◆ RemoveFrom()

static IlvMenuItemGroup* IlvMenuItemGroup::RemoveFrom ( IlvAbstractMenu menu,
const IlSymbol name 
)
static

Removes the menu items group specified from the specified abstract menu.

Parameters
menuThe abstract menu.
nameThe group name.
See also
Get(), addTo().

◆ removeItem()

void IlvMenuItemGroup::removeItem ( const IlSymbol name)

Removes an item from the group.

Parameters
nameThe item name.
See also
addItem().