srvimagesscroll TSRVImagesScroll

<< Click to display table of contents >>

srvimagesscroll TSRVImagesScroll

The TSRVImagesScroll component is used to display images in a scrollable row (or column)

Unit SRVImagesScroll;

Syntax

TSRVImagesScroll = class(TSRVCustomControl)

Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TSRVCustomControl

Properties

This component publishes the following properties inherited from TSRVCustomControl:

SkinManager;

SkinSchemeIndex;

SRVControlStyle;

properties inherited from TCustomControl.

New published properties:

Property

Type

Default value

Meaning

published CanMoveImages

Boolean

True

Determines whether items can be rearranged using the mouse.

published CloseButton

TSRVCloseButton

 

Properties for closing button in each item.

published ImageList

TCustomImageList

 

A link to an image list to display in items

published Indent

TRVPixel96Length

10

Indent before the first item.

published ItemBorderStyle

TPenStyle

psSolid

Item border pen style.

published ItemHeight

TRVPixel96Length

40

Item height

published ItemIndex

Integer

 

Index of the selected item (in Items)

published Items

TSRVImageScrollCollection

 

Items, a collection of TSRVImageScrollItem

published ItemWidth

TRVPixel96Length

80

Item width

published Kind

TSRVImageScrollKind

srvbkHorizontal

Determines how images are placed (srvbkHorizontal – in a row, srvbkVertical – in a column).

published RestrictMove

Boolean

False

Determines whether the user can move items outside visible area of the control (if CanMoveImages=True)

published Spacings

TRVPixel96Length

10

Spacing between items.

New published properties-colors (for non-skin mode):

Property

Type

Default value

Meaning

published ItemBorderColor

TColor

clBtnShadow

Item border color.

published ItemColor

clBtnFace

Item color in normal mode.

published ItemDownColor

clInactiveCaption

Item color when pressed.

published ItemHotColor

clBtnShadow

Item color below the mouse pointer.

published ItemSelectedColor

clHighlight

Item color when selected.

New published properties related to scroll bar:

Property

Type

Default value

Meaning

published DecButtonWidth

TRVPixel96Length

0

Width of up/left button in a skin mode. 0 for system default.

published IncButtonWidth

TRVPixel96Length

0

Width of down/right button in a skin mode. 0 for system default.

published LargeChange

Integer

10

Determines how much Position changes when the user clicks the scroll bar on either side of the thumb tab.

published ScrollerPosition

TSRVScrollerPosition

srvpsEnd

Scroll bar position (srvpsBegin – top/left, srvpsEnd – bottom/right)

published ScrollingDelay

Integer

100

Defines a scrolling speed (interval between scrolling events)

published SmallChange

Integer

1

Determines how much the scrollbar Position changes when the user clicks the arrow buttons on the scroll bar.

SRVImagesScroll Properties

Published properties related to skins:

Property

Type

Default value

Meaning

published SkinManager

TSRVSkinManager

 

Inherited. A link to a skin manager component.

published SkinSchemeIndex

Integer

0

Inherited. Index in SkinManager.CurrentSkin.BoxSchemes, defines the appearance of the whole control.

published ScrollBarSkinSchemeIndex

Integer

0

Index in SkinManager.CurrentSkin.HorizontalScrollBarSchemes (or VerticalScrollBarSchemes in a vertical mode), defines the appearance of scrollbar.

published ItemSkinSchemeIndex

Integer

0

Index in SkinManager.CurrentSkin.BoxSchemes, defines the appearance of each item.

published ButtonSkinSchemeIndex

Integer

0

Index in SkinManager.CurrentSkin.BoxSchemes, defines the appearance of closing buttons.

Events

type

  TSRVCloseImageScrollEvent = procedure(Sender: TSRVImagesScroll; ItemIndex : Integer;

    var CanClose : Boolean) of object;

  TSRVImageScrollMoveEvent = procedure(Sender: TSRVImagesScroll; NewImageIndex, OldImageIndex : Integer) of object;

  TSRVDrawImageScrollEvent = procedure(Sender: TSRVImagesScroll; Canvas : TCanvas;

    ARect, PaintRect : TRect; State : TSRVDrawStates; var DoDefault : Boolean) of object;

  TSRVDrawImageScrollItemEvent = procedure(Sender: TSRVImagesScroll; Canvas : TCanvas;

    ARect, PaintRect : TRect; ItemIndex : Integer; State : TSRVDrawStates;

    var DoDefault : Boolean) of object;

OnChange: TNotifyEvent occurs after a new item is selected.

OnItemMove: TSRVImageScrollMoveEvent occurs when two items exchange their places as a result of item moving. Similar to OnMoveTab for TSRVTabSet.

OnCloseItem : TSRVCloseImageScrollEvent occurs when the user attempts to close an item.

OnDrawBorder, OnDrawBackground, OnDrawItem, OnDrawCloseButton: TSRVDrawImageScrollEvent allow custom drawing for the corresponding objects. Canvas – a canvas where to draw. ARect – a rectangle defining the position of the object to draw. APaintRect – a rectangle that needs to be redrawn; you can use this parameter to optimize drawing. State – a set describing the current object state. Set DoDefault to False to prevent the default drawing of this object.

Painting

The default appearance (if skins are not assigned) depends on SRVControlStyle: TSRVControlStyle property:

srvcsSimple (if RVControlsPainter.Theme = rvctPaleBlue):

imagesscroll_simple

srvcsClassic (the scroll bar appearance depends on Windows, this screenshot is for Windows 10):

imagesscroll_classic

If SRVControlStyle = srvcsSimple, all colors are defined in RVControlsPainter (see the TRichView manual for details).

If SRVControlStyle = srvcsClassic, the control uses Color, ItemBorderColor, ItemColor, ItemDownColor, ItemHotColor, ItemSelectedColor properties.

If SkinManager is assigned, the control is drawn using SkinManager.CurrentSkin.BoxSchemes[SkinSchemeIndex], the scroll bar is drawn using SkinManager.CurrentSkin.HorizontalScrollBarSchemes[ScrollBarSkinSchemeIndex] (or VerticalScrollBarSchemes, if a scroll bar is vertical).

Example:

SRVImagesScroll Scheme