<< Click to display table of contents >> TSRVImagesScroll |
The TSRVImagesScroll component is used to display images in a scrollable row (or column)
Unit SRVImagesScroll;
Syntax
TSRVImagesScroll = class(TSRVCustomControl)
TObject
TPersistent
TComponent
TControl
TWinControl
TCustomControl
This component publishes the following properties inherited from TSRVCustomControl:
•SkinManager;
•SkinSchemeIndex;
•SRVControlStyle;
•properties inherited from TCustomControl.
New published properties:
Property |
Type |
Default value |
Meaning |
---|---|---|---|
CanMoveImages |
Boolean |
True |
Determines whether items can be rearranged using the mouse. |
CloseButton |
|
Properties for closing button in each item. |
|
ImageList |
TCustomImageList |
|
A link to an image list to display in items |
Indent |
TRVPixel96Length |
10 |
Indent before the first item. |
ItemBorderStyle |
TPenStyle |
psSolid |
Item border pen style. |
ItemHeight |
TRVPixel96Length |
40 |
Item height |
ItemIndex |
Integer |
|
Index of the selected item (in Items) |
Items |
|
Items, a collection of TSRVImageScrollItem |
|
ItemWidth |
TRVPixel96Length |
80 |
Item width |
Kind |
TSRVImageScrollKind |
srvbkHorizontal |
Determines how images are placed (srvbkHorizontal – in a row, srvbkVertical – in a column). |
RestrictMove |
Boolean |
False |
Determines whether the user can move items outside visible area of the control (if CanMoveImages=True) |
Spacings |
TRVPixel96Length |
10 |
Spacing between items. |
New published properties-colors (for non-skin mode):
Property |
Type |
Default value |
Meaning |
---|---|---|---|
ItemBorderColor |
TColor |
clBtnShadow |
Item border color. |
ItemColor |
clBtnFace |
Item color in normal mode. |
|
ItemDownColor |
clInactiveCaption |
Item color when pressed. |
|
ItemHotColor |
clBtnShadow |
Item color below the mouse pointer. |
|
ItemSelectedColor |
clHighlight |
Item color when selected. |
New published properties related to scroll bar:
Property |
Type |
Default value |
Meaning |
---|---|---|---|
DecButtonWidth |
TRVPixel96Length |
0 |
Width of up/left button in a skin mode. 0 for system default. |
IncButtonWidth |
TRVPixel96Length |
0 |
Width of down/right button in a skin mode. 0 for system default. |
LargeChange |
Integer |
10 |
Determines how much Position changes when the user clicks the scroll bar on either side of the thumb tab. |
ScrollerPosition |
TSRVScrollerPosition |
srvpsEnd |
Scroll bar position (srvpsBegin – top/left, srvpsEnd – bottom/right) |
ScrollingDelay |
Integer |
100 |
Defines a scrolling speed (interval between scrolling events) |
SmallChange |
Integer |
1 |
Determines how much the scrollbar Position changes when the user clicks the arrow buttons on the scroll bar. |
Published properties related to skins:
Property |
Type |
Default value |
Meaning |
---|---|---|---|
SkinManager |
|
Inherited. A link to a skin manager component. |
|
SkinSchemeIndex |
Integer |
0 |
Inherited. Index in SkinManager.CurrentSkin.BoxSchemes, defines the appearance of the whole control. |
ScrollBarSkinSchemeIndex |
Integer |
0 |
Index in SkinManager.CurrentSkin.HorizontalScrollBarSchemes (or VerticalScrollBarSchemes in a vertical mode), defines the appearance of scrollbar. |
ItemSkinSchemeIndex |
Integer |
0 |
Index in SkinManager.CurrentSkin.BoxSchemes, defines the appearance of each item. |
ButtonSkinSchemeIndex |
Integer |
0 |
Index in SkinManager.CurrentSkin.BoxSchemes, defines the appearance of closing buttons. |
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.
The default appearance (if skins are not assigned) depends on SRVControlStyle: TSRVControlStyle property:
srvcsSimple (if RVControlsPainter.Theme = rvctPaleBlue):
srvcsClassic (the scroll bar appearance depends on Windows, this screenshot is for Windows 10):
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: