Sub OnIsFolderElem(Sender: Object; Args: IMetabaseTreeNodeSpecialEventArgs);
Begin
//set of operators;
End Sub OnIsFolderElem;
Sender. The parameter that returns the component that has generated the event.
Args. The parameter that determines event parameters.
The OnIsFolderElem event is used to set whether elements displayed in the component tree are set as folders.
The event occurs when a tree is built for each element displayed in the tree.
The Node property of event argument can be used to get the current element, for which the event is generated. If the Special property of the event argument is set to True, the Node current element is set as a folder, and a child element tree is built. The OnIsFolderElem event is also generated for each child element.
The event can be used to set the ability of viewing contents of various band objects.
NOTE. It is necessary to consider value of the ShowInternalObjects property as some child elements stored in band objects are internal objects and by default are not displayed.
Executing the example requires a form and the MetabaseTreeCombo component located on it. The component is set to display data of a repository folder. This procedure is set as the OnIsFolderElem event handler for the component.
Sub MetabaseTreeCombo1OnIsFolderElem(Sender: Object; Args: IMetabaseTreeNodeSpecialEventArgs);
Begin
If Args.Node.ObjectDescriptor.ClassId = MetabaseObjectClass.KE_CLASS_MODELSPACE Then
Args.Special := True;
End If;
End Sub MetabaseTreeCombo1OnIsFolderElem;
After the form is started in the element tree of the MetabaseTreeCombo component, modeling containers are presented as folders with the ability to view child objects.
See also: