我已经创建了一个 TListView 后代组件...它的功能完美无缺,但我想知道是否可以删除我不希望在后代中的 TListView 属性。我不想出现在对象检查器中的属性是 LargeImages、RowSelect、ShowColumnHeader、ShowWorkAreas、ViewStyle、OwnerData、OnData 和 OnDataFind。后代只有一种视图样式 vsIcon。
这是组件的接口部分:
TImageEnListView = class(TListView)
private
FImageList: TImageList;
FImageIndex: integer;
FStringList: TStringList;
FThumbnailWidth: integer;
FThumbnailHeight: integer;
FIconVerticalSpacing: integer;
FIconHorzontalSpacing: integer;
FFolder: string;
FShadowedThumbnail: boolean;
FShowCaptions: boolean;
FShowTips: boolean;
FBackgroundWorker: TBackgroundWorker;
FTaskDialog: TTaskDialog;
procedure BackgroundWorkerWork(Worker: TBackgroundWorker);
{ Event after threading is complete }
procedure BackgroundWorkerWorkComplete(Worker: TBackgroundWorker; Cancelled: Boolean);
{ Event for feedback to GUI }
procedure BackgroundWorkerWorkFeedback(Worker: TBackgroundWorker; FeedbackID,
FeedbackValue: Integer);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Clears thumbnails, fileList and imageList }
procedure ClearThumbnails;
procedure InfoTip(Sender: TObject; Item: TListItem; var InfoTip: string);
procedure Data(Sender: TObject; Item: TListItem);
procedure DataFind(Sender: TObject; Find: TItemFind; const FindString: string;
const FindPosition: TPoint; FindData: Pointer; StartIndex: Integer; Direction:
TSearchDirection;
Wrap: Boolean; var Index: Integer);
procedure FillItems;
property BackgroundWorker: TBackgroundWorker read FBackgroundWorker;
published
{ Published declarations }
property Folder: string read FFolder write FFolder;
property FileList: TStringList read FStringList write FStringList;
property ImageList: TImageList read FImageList write FImageList;
property ThumbnailWidth: integer read FThumbnailWidth write FThumbnailWidth default 170;
property ThumbnailHeight: integer read FThumbnailHeight write FThumbnailHeight default 120;
property ShadowedThumbnail: boolean read FShadowedThumbnail write FShadowedThumbnail default
True;
property ShowTips: boolean read FShowTips write FShowTips default False;
property ShowCaptions: boolean read FShowCaptions write FShowCaptions default True;
end;