Registering Name Property Hooks
After have defined the hook function, it must be registered before being called by the Gantt chart object. The registration is based on the Rogue Wave® Views class property feature, in which a property is registered at the class level.
In the Gantt library, the key for allowing the property value to be retrieved is an
IlSymbol defined in the
IlvGanttChart class:
IlSymbol* IlvGanttChart::nameProperty() const;
where IlSymbol is defined as GanttName. Here is an example of registering the hook function we defined above. You can find this function in <ILVHOME>/samples/gantt/common/src/utils.cpp:
// --------------------------------------------------------------------------
void RegisterGanttNameProperty(IlvGraphic* graphic)
{
// Test if the Gantt name property is added to the IlvGraphic.
IlvGanttSetGraphicName function =
IL_FPTRTOANYCAST(IlvGanttSetGraphicName)
(graphic->getClassProperty(IlvGanttChart::nameProperty(), IlTrue));
if (function)
return;
graphic->AddProperty(IlvGanttChart::nameProperty(), (IlAny)
IL_FPTRTOANYCAST(IlvGanttSetGraphicName)(OnGanttObjectNameChanged));
}
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.