TTCustomListView TListView , . VCL ( ComCtrls), , TListView ( TListView, , ). ( ) , :
TImageEnListView = class(TCustomListView)
... other code
published
// Only expose some of the properties that are protected
// in TCustomListView. Meaningless from a use standpoint,
// but demonstrates the technique
property Columns;
property ColumnClick;
property Constraints;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Font;
property FlatScrollBars;
property FullDrag;
property GridLines;
property HideSelection;
end;
, TCustom, - , , , , , , , - ( , ):
type
TMySpecialListView=class(TComponent)
private
FEnListView: TImageEnListView;
function GetThumbnailHeight: Integer;
function GetThumbnailWidth: Integer;
procedure SetThumbnailHeight(Value: Integer);
procedure SetThumbnailWidth(Value: Integer);
public
constructor Create(AOwner: TComponent); override;
published
property ThumbnailHeight: Integer read GetThumbnailHeight
write SetThumbnailHeight;
property ThumbnailWidth: Integer read GetThumbnailWidth
write SetThumbnailWidth;
end;
implementation
{ TMySpecialListView }
constructor TMySpecialListView.Create(AOwner: TComponent);
begin
inherited;
FEnhListView := TImageEnListView.Create(Self);
FEnhListView.Parent := Self.Parent;
// Set other properties needed like width and height. You
// can get the ones you need from your current .dfm values
// for a new blank form with your TImageEnListView dropped
// on it.
end;
function TMySpecialListView.GetThumbnailHeight: Integer;
begin
Result := FEnhListView.ThumbnailHeight;
end;
function TMySpecialListView.GetThumbnailWidth: Integer;
begin
Result := FEnhListView.ThumbnailWidth;
end;
procedure TMySpecialListView.SetThumbnailHeight(Value: Integer);
begin
if Value <> FEnhListView.ThumbnailHeight then
FEnhListView.ThumbnailHeight := Value;
end;
procedure TMySpecialListView.SetThumbnailWidth(Value: Integer);
begin
if Value <> FEnhListView.ThumbnailWidth then
FEnhListView.ThumbnailWidth := Value;
end;