MetabaseTreeCombo.OnIsFolderElem

Syntax

Sub OnIsFolderElem(Sender: Object; Args: IMetabaseTreeNodeSpecialEventArgs);

Begin

//set of operators;

End Sub OnIsFolderElem;

Parameters

Sender. Parameter returning the component that has generated the event.

Args. Parameter allowing to determine event parameters.

Description

The OnIsFolderElem event is used to set whether elements displayed in the component tree are set as folders.

Comments

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 container objects.

NOTE. It is necessary to consider value of the ShowInternalObjects property, as some child elements stored in container objects are internal objects and by default are not displayed.

Example

Executing the example requires a form and the MetabaseTreeCombo component positioned on it. Component is set to display data of a repository folder. This procedure is set as the OnIsFolderElem event handler for a 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:

MetabaseTreeCombo