ImageEn, unit ieview

TIEView.OnShowDialog

TIEView.OnShowDialog


Declaration


property OnShowDialog: TOnShowDialogEvent;


Description


Occurs whenever an ImageEn dialog is displayed, such as Print Preview, Layer Properties, etc.
It can be used to customize the controls and styling of the dialog.

Values of DlgType with TImageEnView.OnShowDialog:
Item Form Unit Notes
iefLayerProperties TIELayerProperties iexLayerProps When properties are displayed for a selected layer using LayersShowPropertiesDialog or LayersNewLayerDialog
iefProcPreview TfPreviews previews When editing image colors and effects using DoPreviews
iefPrintPreview TfiePrnForm2 iePrnForm2 When previewing image printing from a TImageEnView using DoPrintPreviewDialog (with dialog type set to iedtDialog)
iefMaxiPrintPreview TfiePrnForm1 iePrnForm1 When previewing image printing from a TImageEnView using DoPrintPreviewDialog (with dialog type set to iedtMaxi)
iefIOPreview TfIOPreviews iopreviews Preview of saving properties in TSaveImageEnDialog, DoPreviews or DoPreviews
iefAcquireSource TIEAcquireForm iexAcquireForm Selection of an acquisition source using SelectSource


Values of DlgType with TImageEnMView.OnShowDialog:
Item Form Unit Notes
iefMultiPrintPreview TfiePrnForm3 iePrnForm3 When previewing image printing from a TImageEnMView using DoPrintPreviewDialog
iefIOPreview TfIOPreviews iopreviews Preview of saving properties in TSaveImageEnDialog, DoPreviews or DoPreviews
iefAcquireSource TIEAcquireForm iexAcquireForm Selection of an acquisition source using SelectSource
iefMultiSavePreview TfiePrnForm4 iePrnForm4 When previewing contact sheet saving from a TImageEnMView using DoSavePreviewDialog



Examples


// Hide the progress bar in the IO Previews dialog (add iopreviews to uses)
procedure TForm1.ImageEnView1ShowDialog(Sender: TObject; DlgType: TIEDlgType; Form: TForm);
begin
  if DlgType = iefIOPreview then
    TfIOPreviews(Form).ProgressBar1.Visible := False;
end;

// Hide the "General" tab of the Layer Properties dialog (add iexLayerProps to uses)
procedure TForm1.ImageEnView1ShowDialog(Sender: TObject; DlgType: TIEDlgType; Form: TForm);
begin
  if DlgType = iefLayerProperties then
    TIELayerProperties(Form).tabGeneral.TabVisible := False;
end;

// Do not show text descriptions for shapes in the Layer Properties dialog and change color to clYellow (add iexLayerProps to uses)
procedure Tfmain.ImageEnView1ShowDialog(Sender: TObject; DlgType: TIEDlgType; Form: TForm);
begin
  if DlgType = iefLayerProperties then
  begin
    TIELayerProperties(Form).ComboBoxShowText := False;
    TIELayerProperties(Form).ComboBoxShapeColor := clYellow;
  end;
end;

// Use a multi-line page control in the Proc Previews dialog (add previews to uses)
procedure TForm1.ImageEnView1ShowDialog(Sender: TObject; DlgType: TIEDlgType; Form: TForm);
begin
  if DlgType = iefProcPreview then
    TfPreviews(Form).PageControl1.MultiLine := True;
end;

// Advanced customizing of the Proc Preview dialog (add previews to uses)
procedure TForm1.ImageEnView1ShowDialog(Sender: TObject; DlgType: TIEDlgType; Form: TForm);
begin
  if DlgType <> iefProcPreview then
    exit;

  with TfPreviews(wForm) do
  begin
    // Red dialog
    Color := clRed;

    // Caption of OK button
    OkButton.Caption := 'Oh Yeah';

    // Replace cancel button with custom control
    CancelButton.Visible := False;
    With TMyAnimatedButton.Create( PreviewForm ) do
    begin
      Parent := PreviewForm;
      Left := CancelButton.Left;
      Top := CancelButton.Top + CancelButton.Height + 8;
      Width := CancelButton.Width;
      Height := CancelButton.Height;
      Anchors := [akTop, akRight];
      Caption := 'My Cancel';
      ModalResult := 2;
    end;
  end;
end;


See Also


- OnPreview
- OnIOPreview
- OnDoPreviews