ShowOpenDlg method (LEADDlgFile Control)

C++ Builder example

Delphi 4.0 example

 

Builder Syntax

int ShowOpenDlg (TWinControl* AOwnerCtrl);

Delphi Syntax

Function ShowOpenDlg (AOwnerCtrl: TWinControl ): L_INT;

Overview

Refer to Using Imaging Common Dialogs.

Remarks

Displays the Open dialog for getting the filename to open, file information, and applicable options.

You may want to set one or more of the following properties prior to calling this method:

Filter property, FilterIndex property, FileName property, MaxFileSize property, FileTitle property, MaxFileTitleSize property, InitialDir property, DialogTitle property, DlgFileFlags property.

Available options for the DlgFileFlags property are:

Setting

Description

DLG_OPEN_ALLOWMULTI

[$00000200] Allow selection of multiple files

DLG_OPEN_NOCHANGEDIR

[$00000008] Restore directory to original after closing

The layout and action of the dialog depends on the flags set in the DlgFlags property. Possible options are:

Value

Meaning

DLG_OPEN_SHOW_CONTEXTHELP

[$00000001] Dialog should contain a context sensitive help icon.

DLG_OPEN_SHOW_PROGRESSIVE

[$00000002] The File Load Options will contain the Progressive Passes option.

DLG_OPEN_SHOW_MULTIPAGE

[$00000004] The File Load Options will contain the Multi-page options.

DLG_OPEN_SHOW_LOADROTATED

[$00000008] The File Load Options will contain the Load-Rotated option.

DLG_OPEN_SHOW_LOADCOMPRESSED

[$00000010] The File Load Options will contain the load-compressed option.

DLG_OPEN_SHOW_FILEINFO

[$00000020] Dialog should have the File-Info button.

DLG_OPEN_SHOW_PREVIEW

[$00000040] Dialog should have a preview window to preview the selected file image.

DLG_OPEN_SHOW_DELPAGE

[$00000080] Dialog should have a delete button to delete a page in a multi-page image file.

DLG_OPEN_SHOW_LOADOPTIONS

[$00000100] Dialog should contain the "Show Load Options" check box

DLG_OPEN_VIEWTOTALPAGES

[$00010000] Show the total number of pages on the file info dialog.

DLG_OPEN_ENABLESIZING

[$00020000] Dialog should contain the Enable Sizing option.

DLG_OPEN_NOFILEMUSTEXIST

[$00040000] Do not verify that the file exists.

DLG_OPEN_NOPATHMUSTEXIST

$00080000] Do not verify that the path exists.

DLG_OPEN_USEFILESTAMP

[$00100000] Dialog should preview the stamp in the image file, if it contains a stamp and DLG_OPEN_SHOW_PREVIEW flag is passed.

DLG_OPEN_LOADBITMAP

[$00200000] Load the image when the Open button is pressed and fill the Main control Bitmap property.

DLG_OPEN_GENERATETHUMBNAIL

[$00400000] Generate the image thumbnail or create one when the Open button is pressed and update the Thumbnail property.

If you include DLG_OPEN_LOADBITMAP in the DlgFlags property, the LEADImage property must be assigned a Main Control containing a valid bitmap before calling this method.

If you include DLG_OPEN_ALLOWMULTI in the DlgFileFlags property, the OnOpenFileEvent event will occur for each file selected. The loaded file can be accessed in the LEADDlgFile.Bitmap property.

If you did not include DLG_OPEN_ALLOWMULTI in the DlgFileFlags property, the LEADDlgFile.LEADImage.Bitmap property will be updated with the loaded bitmap.

If DLG_OPEN_SHOW_PREVIEW or DLG_OPEN_USEFILESTAMP is set in the DlgFlags property and the PreviewEnabled property is set to TRUE, the "Enable Preview" box in the Open dialog box will be checked.

To initialize the "Load Rotated" box, the "Load Compressed" box and the "Page No." box when the dialog is displayed, set the following properties before calling this method:

PageNumber property.

LoadRotated property.

LoadCompressed property.

Please note, if you set the PageNumber property prior to calling the ShowOpenDlg method, the value you put in PageNumber will appear when the dialog is created. If you then select a file, which has fewer pages, the maximum number of pages for that file will appear in the "Page No.:" box.

The following properties are associated with this method:

Filter property

FilterIndex property

FileName property

FileTitle property

DialogTitle property

DlgFileFlags property

InitialDir property

MaxFileSize property

MaxFileTitleSize property

PreviewEnabled property

OptionsFileType property.

Bitmap property.

Thumbnail property.

PageNumber property.

LoadPasses property.

LoadCompressed property.

LoadRotated property.

ShowLoadOptions property.

PCDResolution property.

PDFXResolution property.

PDFXResolution property.

PDFYResolution property.

PDFDisplayDepth property.

PDFTextAlpha property.

PDFGraphicsAlpha property.

RASTERMISCXResolution property.

RASTERMISCYResolution property.

METAFILEXResolution property.

METAFILEYResolution property.

VECTORMISCViewportWidth property.

VECTORMISCViewportHeight property.

VECTORMISCViewportMode property.

VECTORMISCFont property.

DXFViewportWidth property.

DXFViewportHeight property.

DXFViewportMode property.

DXFFont property.

DXFAutoCADColorScheme property.

PLTViewportWidth property.

PLTViewportHeight property.

PLTViewportMode property.

PLTFont property.

PLTPenWidth property.

PLTPenColor property.

To include a Help button in the dialog, set the ShowHelpButton property to TRUE.

The Open dialog can be seen below:

image\Open.gif

See Also

Elements:

Load method, FileName property, FileTitle property, DialogTitle property, DlgFileFlags property, InitialDir property, MaxFileSize property, MaxFileTitleSize property, PreviewEnabled property, OptionsFileType property, Bitmap property, Thumbnail property, PageNumber property, LoadPasses property, LoadCompressed property, LoadRotated property, ShowLoadOptions property, PCDResolution property, PDFXResolution property, PDFYResolution property, PDFDisplayDepth property, PDFTextAlpha property, PDFGraphicsAlpha property, RASTERMISCXResolution property, RASTERMISCYResolution property, METAFILEXResolution property, METAFILEYResolution property, VECTORMISCViewportWidth property, VECTORMISCViewportHeight property, VECTORMISCViewportMode property, VECTORMISCFont property, DXFViewportWidth property, DXFViewportHeight property, DXFViewportMode property, DXFFont property, DXFAutoCADColorScheme property, PLTViewportWidth property, PLTViewportHeight property, PLTViewportMode property, PLTPenWidth property, PLTPenColor property, DlgFlags property, ShowHelpButton property, EnableMethodErrors property.

Topics:

Imaging Common Dialogs: Properties, Methods, and Events