Unit 'ShellCtrls' Package
[Overview][Types][Classes][Procedures and functions][Index] [#lcl]

TCustomShellTreeView.DrawBuiltInIcon

Draws the Shell Icon for the specified tree node.

Declaration

Source position: shellctrls.pas line 88

protected function TCustomShellTreeView.DrawBuiltInIcon(

  ANode: TTreeNode;

  ARect: TRect

):TSize; override;

Arguments

ANode

  

Tree node with the name for the file system entry.

ARect

  

Rectangle where the icon is drawn.

Function result

TSize instance with the dimension for the icon.

Description

DrawBuiltInIcon is an overridden TSize function used draw an icon in the tree using the Shell icon for the file name in ANode. It re-implements the method in the TCustomTreeView ancestor, and does not call the inherited method.

When UseBuiltinIcons is True, the internal GetShellIcon routine is called to get the icon used for the file. The icon is drawn on the control Canvas using the rectangle in ARect. The icon is centered vertically in the specified rectangle.

The return value contains the dimensions for the icon as a TSize instance. When UseBuiltinIcons is False, the return value always contains a TSize instance with both the Width (CX) and Height (CY) are set to 0 (zero).

Remark: DrawBuiltInIcon is defined for the Windows platform only; it requires use of the SHGetFileInfoW routine in the FPC ShellApi.pp unit.

See also

TCustomShellTreeView.UseBuiltinIcons

  

Indicates if OS-provided icons are used for entries in the Shell control.

TCustomShellTreeView.GetBuiltinIconSize

  

Gets the size for a shell icon used in the control.

TCustomTreeView.DrawBuiltinIcon

  

Defines a method used to draw a built-in icon for a specified tree node.