[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'ComCtrls' (#lcl)

TToolButton.GetCurrentIcon

Gets the image list, index, and drawing effect for the icon on the tool button.

Declaration

Source position: comctrls.pp line 2168

public procedure TToolButton.GetCurrentIcon(

  var ImageList: TCustomImageList;

  var TheIndex: Integer;

  var TheEffect: TGraphicsDrawEffect

); virtual;

Arguments

ImageList

  

Scaled Image list with the available images for the icon.

TheIndex

  

Ordinal position in the image list for the icon image.

TheEffect

  

Graphic drawing effect needed for the button state.

Description

GetCurrentIcon is a method used to get information for the icon drawn on the tool button. It returns values in the variable parameters with the scaled image list for the icon, its position in the image list, and the drawing effect for the image.

ImageList is the scaled image list with the images from the parent tool bar. It is re-created in the method and uses the image size from the parent tool bar scaled to the run-time display density (PPI). The images in the list are retrieved from the Images, HotImages, or DisabledImages properties in the parent tool bar and reflect the values in the Enabled property and the tool button flags. The default value is Nil (unassigned).

TheIndex is the position in the image list for the icon image. It defaults to the value in the ImageIndex property.

TheEffect is a TGraphicsDrawEffect value that indicates the drawing effect to apply to the tool button. It reflects the values in the Enabled property, flags for the tool button, and the toUseGlyphEffects setting in ThemeServices. The following values are used in TheEffect:

gdeNormal
Images are drawn using the normal, undecorated drawing effect. This is the default value.
gdeShadowed
Images are drawn using the shadowed effect when the button or drop-down indicator is pressed.
gdeHighlighted
Images are drawn using highlighting when the button is Enabled and auto-effects are used in theme services. Otherwise, the tool bar HotImages or DisabledImages are used.
gdeDisabled
Images are drawn using the dimmed effect when the button is not Enabled, or tool bar DisabledImages are not available.

GetCurrentIcon is called from the Paint method.


Version 3.2 Generated 2024-02-25 Home