TCustomShellTreeView.DrawBuiltInIcon function
Draws the Shell Icon for the specified tree node.
Declaration
function DrawBuiltInIcon(ANode: TTreeNode; ARect: TRect): TSize
; overrideArguments
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 to
draw an icon on the tree using the Shell icon for the file or folder 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 entry.
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) set to 0 (zero). The size may
also be empty (0, 0) if an icon was not found or returned for the file system
entry by the widgetset class instance. This can occur when the entry
represented by ANode has been removed from the file system.
SHGetFileInfoW routine in the FPC ShellApi.pp
unit.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
