Sign in Join
FPDoc Onlineexperiment

TClipboard.SetSupportedFormats function

Member of TClipboardpublicIn unit Clipbrd

Sets all supported clipboard formats at once.

Declaration

pascal
function SetSupportedFormats(AFormatCount: Integer; 
 FormatList: PClipboardFormat): Boolean

Arguments

AFormatCount

Number of clipboard formats in the FormatList argument.

FormatList

Pointer to the list of TClipboardFormat instances stored in the method.

Description

SetSupportedFormats sets all supported formats at once All data will be empty. This procedure is useful if setting the OnRequest event to put the data on the fly.

Example: Using the PrimarySelection from synedit.pp.

procedure TCustomSynEdit.AcquirePrimarySelection;
var
  FormatList: TClipboardFormat;
begin
  if (not SelAvail)
   or (PrimarySelection.OnRequest=@PrimarySelectionRequest) then exit;
  FormatList:=CF_TEXT;
  PrimarySelection.SetSupportedFormats(1,@FormatList);
  PrimarySelection.OnRequest:=@PrimarySelectionRequest;
end;

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.