SRVImagesScroll TSRVImagesScroll

Top  Previous  Next

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;

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 DoubleBuffered

Boolean

False

Determines whether the control’s image is rendered directly to the window or painted to an in-memory bitmap first.

published ImageList

TCustomImageList

 

Link to an image list to display in items

published Indent

Integer

10

Indent before the first item.

published ItemHeight

Integer

40

Item height

published ItemIndex

Integer

 

Index of the selected item (in Items)

published Items

TSRVImageScrollCollection

 

Items, a collection of TSRVImageScrollItem

published ItemWidth

Integer

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

Integer

10

Spacing between items.

To prevent flickering, assign DoubleBuffered=True if the control is placed on the form (not necessary, if inserted in TSRichViewEdit control).

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

Property

Type

Default value

Meaning

published ItemBorderStyle

TPenStyle

psSolid

Item border pen style.

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 scrollbar:

Property

Type

Default value

Meaning

published DecButtonWidth

Integer

0

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

published IncButtonWidth

Integer

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 ScrollBarHeight

Integer

 

Height (in horizontal mode) or width (in vertical mode) of the scroll bar.

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

Caption is aligned according to Alignment. CaptionOffset shifts the text (to the right, if Alignment=taLeftJustify, or to the left, if Alignment=taRightJustify). Caption is placed vertically at the top.

Background is drawn using Color property.

Border is drawn using BorderColor, BorderWidth and CornersOffset properties (even in a skin mode).

If SkinManager is assigned, the control is drawn using SkinManager.CurrentSkin.BoxSchemes[SkinSchemeIndex].

Example:

SRVImagesScroll Scheme


ScaleRichView © trichview.com