TPDFlibOutlineViewer

查看器

描述

TPDFlibOutlineViewer(单元 Lib\PDFlibViewer.pas,v3.126.0 新增)是 TPDFlibViewer 的书签面板。它按缩进列出文档的大纲树,单击书签会让附加的查看器跳到该书签的目标页

语法

Delphi

TPDFlibOutlineViewer = Class(TPDFlibViewerPanel)
  Public
    Function ItemOutlineID(Index: Integer): Integer;
    Function ItemHasChildren(Index: Integer): Boolean;
    Function IsOutlineExpanded(OutlineID: Integer): Boolean;
    Procedure SetOutlineExpanded(OutlineID: Integer; Expanded: Boolean);
    Function ToggleOutlineExpanded(OutlineID: Integer): Boolean;
    Procedure ExpandAll;
    Procedure CollapseAll;
  End;

关键成员

ItemOutlineID从 0 计数的行背后的大纲节点标识符,供附加库的大纲函数使用
ItemHasChildren该行的大纲节点带有子书签时为 True
IsOutlineExpanded某个大纲节点的展开状态
SetOutlineExpanded展开或折叠某个大纲节点并刷新各行
ToggleOutlineExpanded翻转某个大纲节点的展开状态;该节点因调用而展开时返回 True
ExpandAll展开所有大纲节点,列出整棵树
CollapseAll把树折叠回顶级书签

备注

附加的查看器中打开文档时,面板会自动重建各行,以缩进呈现大纲层级;子树在书签展开时按需加载。没有目标页的书签也会列出,但点击后不会跳转。将本面板与 TPDFlibSearchPanel、TPDFlibThumbnailBar 组合,即可搭出经典阅读器侧边栏

另请参阅

TPDFlibViewerPanel, TPDFlibViewer, TPDFlibSearchPanel, TPDFlibThumbnailBar