PDFium Delphi Component Docs

LoadingText プロパティ

コンポーネント: TPdfView  ·  ユニット: PDFium
非同期レンダリングがまだ進行中の間、ページ中央に表示されるテキストです

Syntax

property LoadingText: string; // default 'Loading...'

Description

LoadingText は、AsyncRendering が True のときにビューアーが部分描画のページの上へ重ねるキャプションです。ビューアーは継承中のフォントで文字列を測定し、結果を中央寄せの矩形へ広げ、LoadingColor で塗ってからテキストを描きます。デフォルトの 'Loading...' は一時的な状態だとユーザーに伝わり、ページを支配せず見える幅です

オーバーレイは独立した可視フラグではなく、このテキストで制御します。空文字列('')を代入すると、非同期描画がアクティブでもオーバーレイは抑止されます。ホストアプリが独自のローディングウィジェット(アニメーション GIF、モーダルの進捗ダイアログ、ステータスバーのパネルなど)を出したいとき、内蔵矩形に注意を奪われたくない場合に使います

文字列のローカライズは起動時に翻訳済みリソースを代入すれば済みます。プロパティはホストアプリが作れる任意の string を受け付け、中国語、日本語、アラビア語などのマルチバイト文字も扱えます

Remarks

Example

// Localized loading caption.
PdfView1.AsyncRendering := True;
PdfView1.LoadingText := SLoadingPdf; // resourcestring lookup

// Suppress the built-in indicator; use a TActivityIndicator instead.
PdfView1.LoadingText := '';
ActivityIndicator1.Animate := True;

// Stage-specific message for slow first paint.
PdfView1.LoadingText := 'Decoding first page...';
PdfView1.Active := True;

See Also

LoadingColor, AsyncRendering, Font, Active