TPDFlibViewerPanel

查看器

描述

TPDFlibViewerPanel(单元 Lib\PDFlibViewer.pas)是查看器配套面板 TPDFlibOutlineViewer、TPDFlibSearchPanel 与 TPDFlibThumbnailBar 的抽象基类。面板显示一个可滚动的行列表,每行携带一个隐藏的整数负载(通常是页码),并保存对附加 TPDFlibViewer 的简单引用。应用程序很少直接实例化该基类;它的存在是为了让三个具体面板共享绑定与行机制

语法

Delphi

TPDFlibViewerPanel = Class(TCustomControl)
  Public
    Procedure AttachViewer(AViewer: TPDFlibViewer);
    Function ItemCount: Integer;
    Function ItemText(Index: Integer): WideString;
    Function ItemData(Index: Integer): Integer;
    Property Viewer: TPDFlibViewer;
  Published
    Property Align;
    Property Anchors;
    Property Color;
    Property Font;
    Property Visible;
  End;

参数

AttachViewer把面板绑定到查看器并加载其数据;面板只保存简单引用,因此查看器的存活时间必须长于面板,否则需要重新附加
ItemCount当前列出的行数
ItemText从 0 计数的行的显示文本
ItemData该行隐藏的整数负载(通常是 1 计数的页码)
Viewer已附加的 TPDFlibViewer 实例;调用 AttachViewer 之前为 nil

备注

附加的查看器中打开文档时,各行由虚拟方法 Reload 重建;派生类重写它,用文档内容(书签、命中、页码)填充列表。激活某行会调用虚拟方法 ItemActivated,其默认实现通过 GoToPage 把附加的查看器导航到该行所在的页

另请参阅

TPDFlibOutlineViewer, TPDFlibSearchPanel, TPDFlibThumbnailBar, TPDFlibViewer