TreeListNodeTypeRegister

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalNumber TreeListNodeTypeRegister( SalString sName,
		                 SalString sPic,
		                 SalString sPicSelected,
		                 SalString sDisplayAttr,
		                 SalBoolean bAllowCut,
		                 SalBoolean bAllowCopy,
		                 SalString sPasteFlags )

Applications may call the TreeListNodeTypeRegister to registers a node type in run-time.

Parameters

Name Description
SalString sName Name of the node type. This name is only for the developers convenience, it is never used by the framework.
SalString sPic Name of the picture to be used for this node type when the node is not selected. The picture name is specified in F1 syntax (see method Cache.PictureHandleGet for details). You can also use the reserved text "VT_DLLName" to represent the name of the Visual Toolchest dll.
SalString sPicSelected Name of the picture to be used for this node type when the node is selected. The picture name is specified in F1 syntax (see method Cache.PictureHandleGet for details). You can also use the reserved text "VT_DLLName" to represent the name of the Visual Toolchest dll.
SalString sDisplayAttr Name of the attribute to be used as the display text that's visible to the right of the nodes icon. This attribute must be included in the node data passed to method TreeListNodeInsert. This attribute is also the default text used for tool tips.
SalBoolean bAllowCut Specified whether nodes of this type can be cut.
SalBoolean bAllowCopy Specified whether nodes of this type can be copied.
SalString sPasteFlags Specifies for which node types paste of this node is permitted. This attribute should be a packed cMessage containing attributes as NodeTypes and paste action. Node types not present in the message or with invalid action type will be set to Const.PASTE_NotAllowed. Valid actiontype constants are  Const.PASTE_NotAllowed, Const.PASTE_AsSibling, Const.PASTE_AsChild.

Returns

The return value is the number of the new node type created.

Comments

Node types that are known in design-time should be defined using Foundation1 properties. This method should only be used when new node types must be generated dynamically as the application is running.

Example

! To register a node type which would display the COMPANY object.

msgPasteFlags.Construct( )
msgPasteFlags.AddAttribute( '1', PASTE_AsChild )
msgPasteFlags.AddAttribute( '2', PASTE_AsSibling )
Set nNodeType = TreeListNodeTypeRegister( 'COMPANY', 'VT_DLLName,fdr',
 'bmpSelectedFolder', 'COMPANY_NAME', FALSE, TRUE, msgPasteFlags.Pack( ) )
C# code
// Register the node
TreeListNodeTypeRegister(Msg.GetAttribute("NodeLabel"), 
Msg.GetAttribute("NodePicNotSelect"),
Msg.GetAttribute("NodePicSelect"),
Msg.GetAttribute("NodeDisAttrib"),
Int.PalStrToBoolean(Msg.GetAttribute("NodeAllowCut")),
Int.PalStrToBoolean(Msg.GetAttribute("NodeAllowCopy")),
Msg.GetAttribute("NodePasteFlags"));