property Enabled: Boolean; // published, inherited from TControl
Enabled가 True이면 viewer는 mouse click, drag, mouse wheel, keyboard navigation에 반응합니다. False로 설정하면 모든 user input이 막히며, mouse click은 더 이상 selection이나 scroll position을 바꾸지 않고 keyboard shortcut은 page를 이동시키지 않으며 form field widget도 event를 받지 않습니다. 그래도 page는 정상적으로 렌더링됩니다
이것이 canonical "read-only preview" mode입니다. document는 계속 보이므로 사용자는 content를 볼 수 있지만, 실수로 지나치게 scroll하거나 form field를 바꾸거나 text selection을 잡을 수는 없습니다. 긴 작업(saving, printing, exporting)이 진행되는 동안 UI를 예측 가능하게 유지하려면 이 mode를 사용하고, 작업이 끝나면 viewer를 다시 활성화하세요
disabled state는 parent에서도 내려옵니다. parent panel이 disabled되면, 자신의 Enabled가 True이더라도 viewer는 input 기준으로 disabled로 취급됩니다. disabled content의 시각적 모습은 host theme에 따라 다르며, 일부 VCL theme는 control을 흐리게 처리하고 다른 theme는 모양을 유지합니다
True입니다AsyncRendering 같은 background task는 멈추지 않습니다. cached page bitmap은 계속 갱신되고 user input만 막힙니다AllowUserPageChange와 AllowUserTextSelection 같은 세부 property를 사용하세요
// Disable the viewer while a long export is in progress
procedure TForm1.btnExportClick(Sender: TObject);
begin
PdfView1.Enabled := False;
try
ExportAllPagesToImages(PdfView1.Pdf, 'C:\out\');
finally
PdfView1.Enabled := True;
PdfView1.SetFocus;
end;
end;