Contains types and constants used to access scalable dialog images.

DialogRes.pas contains constants and types used to access scalable images as TIcon or TImage resources used on dialog forms. This unit registers a handler routine in the initialization section which frees the DialogImages variable in the unit when LCL units have been finalized.

DialogRes.pas is part of the Lazarus Component Library (LCL).

Defines a range with image identifiers for glyphs used in dialog resources.

TDialogImage is a range type with identifiers for the images used on glyph icons in the LCL. The range is defined using constant values defined in the LCLType unit. The values are used to access glyph image names in DialogRes.pas and their index positions in TDialogImageList.

Contains the base names for glyph resources used on dialogs.

DialogResName is an array constant which contains strings with the base resource names for glyph images used on dialogs. The array elements are indexed by the values in the TDialogImage range type. For example:

sResName := DialogResName[idDialogError] // returns 'dialog_error'

This base resource name can then be combined with a scaling suffix, like '_150' or '_200', to form the complete name for the desired icon resource.

Implements a multi-resolution image list used for a dialog icon loaded from a resource file.

TDialogImageList is a TLCLGlyphs descendant which implements an image list for a single dialog icon used in the LCL. It registers multiple resolutions for the glyph images including 16, 24, 32, 48, and 64 pixels variants. The default image size is 32x32 pixels. The different image sizes are loaded by calling the ThemeServices.GetStockImage method when theme services are available.

Applications do not need to create an instance of the class. Use the DialogGlyphs function to access the singleton with glyph icons created and filled in the implementation section.

Use the Width and Height select a different default size for images in the list.

Use the DialogIcon property to access get the ordinal position in the image list for an icon using its TDialogImage image identifier.

TLCLGlyphs ThemeServices TThemeServices.GetStockImage
Constructor for the class instance.

Create is the overridden constructor for the class instance. It calls the inherited method on entry to initialize the storage for the class and to enable image scaling.

Create initializes the internal array with the index positions for the glyphs in the class. The default Width and Height for the icons are set to 32 pixels. It registers image resolutions for the icons using 16, 24, 32, 48, and 64 pixel image sizes.

TLCLGlyphs.Create TLCLGlyphs.RegisterResolutions TCustomImageList.Scaled
Component which owns the class instance. Provides indexed access an image index for the dialog icon identified in AIndex.

DialogIcon is a read-only Integer property used to get the ordinal position in internal storage where the image specified in AIndex is stored.

The AIndex argument is a value from the TDialogImage enumeration, and contains an identifier used to locate the corresponding image.

For example:

Image := TImage.Create(AOwner); Image.Parent := AParent; Image.Images := DialogGlyphs; Image.ImageIndex := DialogGlyphs.DialogIcon[idDialogShield]; Image.Proportional := True; Image.Stretch := True; Image.StretchOutEnabled := False; Image.Center := True;
Image identifier used to get the index position for the specified image identifier. Gets the image list with glyph images used on dialogs.

DialogGlyphs is a TDialogImageList function which returns the image list with the glyphs used for dialog icons. DialogGlyphs is used to implement TTaskDialog and the DefaultPromptDialog routine.

DialogGlyphs replaces the deprecated GetDialogIcon routine in the dialogs.pp unit.

Image := TImage.Create(AOwner); Image.Parent := AParent; Image.Images := DialogGlyphs; Image.ImageIndex := DialogGlyphs.DialogIcon[idDialogShield]; Image.Proportional := True; Image.Stretch := True; Image.StretchOutEnabled := False; Image.Center := True;
DefaultPromptDialog TTaskDialog.Execute
Returns the TDialogImageList singleton defined in the implementation section.