TPDFlibViewerPanel

Viewer

Description

TPDFlibViewerPanel (unit Lib\PDFlibViewer.pas) is the abstract base class of the viewer companion panels TPDFlibOutlineViewer, TPDFlibSearchPanel and TPDFlibThumbnailBar. A panel shows a scrollable list of rows, each row carrying a hidden integer payload (normally a page number), and keeps a plain reference to an attached TPDFlibViewer. Applications rarely instantiate the base class directly; it exists so the three concrete panels share the binding and row machinery

Syntax

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;

Key members

AttachViewerBinds the panel to a viewer and loads its data; the panel keeps a plain reference, so the viewer must outlive the panel or be re-attached
ItemCountNumber of rows currently listed
ItemTextDisplay text of the 0-based row
ItemDataHidden integer payload of the row (normally the 1-based page number)
ViewerThe attached TPDFlibViewer instance, nil before AttachViewer

Remarks

Rows are rebuilt by the virtual Reload method when a document opens in the attached viewer; descendants override it to fill the list from the document (bookmarks, hits, page numbers). Activating a row calls the virtual ItemActivated, whose default implementation navigates the attached viewer to the row's page through GoToPage

See also

TPDFlibOutlineViewer, TPDFlibSearchPanel, TPDFlibThumbnailBar, TPDFlibViewer