Re: Oracle Form and a standard window dialogue

From: gti_matt <gtimatt_at_home.com>
Date: Sat, 08 Dec 2001 05:43:27 GMT
Message-ID: <3MhQ7.50886$Sx.14233618_at_news1.elcjn1.sdca.home.com>


[Quoted] "Richard Drive" <dotacion_at_excite.com> wrote in message news:78586940.0112061521.53f58acc_at_posting.google.com... > Am using Forms 6.0 in a Windows NT environment, I want the use to be > able to bring up a dialogue window, like the standard 'File->Open'.

Make sure that d2kwutil.pll is in your path so Forms can see it and attach it to your form.

Then, in your PL/SQL where you want to call it, call WIN_API_DIALOG.OPEN_FILE. This is the package spec for the WIN_API_DIALOG package so you can see the parameters:

PACKAGE WIN_API_DIALOG IS

/*-------------------------------------------------------------------------*
\
  • WIN_API_DIALOG -> This package is concerned with Displaying Common
  • dialogs
  • Contents:
  • Open_File -> Open File Dialog
  • Save_File -> Save File Dialog
  • Select_Printer -> Printer Selection Dialog
  • Dependancies: * WIN_API_ENVIRONMENT
  • WIN_API \*-------------------------------------------------------------------------* /
/*-------------------------------------------------------------------------*
\

* Open_File -> Displays the standard Open File dialog
* Arguments:
* Title -> The Title for the Dialog Box
* (Default -> 'Open File')
* StartDirectory -> Where the dialog should start from
* this should be in the format 'C:\TEMP'
* (Default -> Windows Directory)
* FileFilter -> Restrict the list of files. The filter
string
* should be in the format:
* '<Description>|<filename>.<Extension>|'
* typically this would be something like
* 'All files(*.*)|*.*|' or 'Text
files(*.txt)|*.txt|'
* All Files is the Default
* Modal -> Should the dialog be modal with respect to
the
* application?
* default -> TRUE
* AdvancedFlags -> (See list in WIN_API header) This option
allows
* you to change the attributes of the Open
File
* dialog. Here are some of the Flags that
might
* be of interest:
* OFN_HIDEREADONLY Hides the Read Only
check box.
* OFN_NONETWORKBUTTON Hides the Network
Button
* OFN_EXPLORER Display an Explorer
style
* Dialog rather than
the
* conventional one.
* See your Microsoft docmentation for details
on
* each flag.
* To Set the Advanced_Flags varaible, just add
the
* required flags together. The default is:
* WIN_API.OFN_PATHMUSTEXIST +
WIN_API.OFN_FILEMUSTEXIST +
* WIN_API.OFN_HIDEREADONLY +
WIN_API.OFN_NOCHANGEDIR
* RaiseExceptions -> TRUE of FALSE(Default) If set to true, then
if the
* command is not successful (e.g no filename
is
* returned) then the explicit exception
* NO_DATA_FOUND will be raised.
*
* Returns:
* Path and name of the selected file
\*-------------------------------------------------------------------------*
/

FUNCTION Open_File ( Title IN VARCHAR2 DEFAULT 'Open File',

                        StartDirectory  IN      VARCHAR2        DEFAULT
'$WINDIR$',
                        FileFilter      IN      VARCHAR2        DEFAULT 'All
files(*.*)|*.*|',
                        Modal           IN      BOOLEAN         DEFAULT
TRUE,
                        AdvancedFlags   IN      PLS_INTEGER     DEFAULT
WIN_API.OFN_FLAG_DEFAULT,
                        RaiseExceptions IN      BOOLEAN         DEFAULT
FALSE
                    )   RETURN VARCHAR2;


/*-------------------------------------------------------------------------*
\

* Save_File -> Displays the standard Save File dialog
* Arguments:
* SampleName -> The Example name for the file to display in
* the Save Window
* Title -> The Title for the Dialog Box
* (Default -> 'Save File As')
* StartDirectory -> Where the dialog should start from
* this should be in the format 'C:\TEMP'
* (Default -> Windows Directory)
* You can specify the Windows and Temp
directories by
* using the Shorthand $WINDIR$ and $TEMP$
respectively
* The function will then Ask the O/S for the
relevant
* locations
* FileFilter -> Restrict the list of files. The filter
string
* should be in the format:
* '<Description>|<filename>.<Extension>|'
* typically this would be something like
* 'All files(*.*)|*.*|' or 'Text
files(*.txt)|*.txt|'
* All Files is the Default
* Modal -> Should the dialog be modal with respect to
the
* application?
* default -> TRUE
* AdvancedFlags -> (See list in WIN_API header) This option
allows
* you to change the attributes of the Open
File
* dialog. Here are some of the Flags that
might
* be of interest:
* OFN_HIDEREADONLY Hides the Read Only
check box.
* OFN_NONETWORKBUTTON Hides the Network
Button
* OFN_EXPLORER Display an Explorer
style
* Dialog rather than
the
* conventional one.
* See your Microsoft docmentation for details
on
* each flag.
* To Set the Advanced_Flags varaible, just add
the
* required flags together. The default is:
* WIN_API.OFN_PATHMUSTEXIST +
WIN_API.OFN_FILEMUSTEXIST +
* WIN_API.OFN_HIDEREADONLY +
WIN_API.OFN_NOCHANGEDIR
* RaiseExceptions -> TRUE of FALSE(Default) If set to true, then
if the
* command is not successful (e.g no filename
is
* returned) then the explicit exception
* NO_DATA_FOUND will be raised.
*
* Returns:
* Path and name of the selected file
\*-------------------------------------------------------------------------*
/
FUNCTION Save_File (    SampleName      IN      VARCHAR2,
                        Title           IN      VARCHAR2        DEFAULT
'Save File As',
                        StartDirectory  IN      VARCHAR2        DEFAULT
'$WINDIR$',
                        FileFilter      IN      VARCHAR2        DEFAULT 'All
files(*.*)|*.*|',
                        Modal           IN      BOOLEAN         DEFAULT
TRUE,
                        AdvancedFlags   IN      PLS_INTEGER     DEFAULT
WIN_API.OFN_FLAG_DEFAULT,
                        RaiseExceptions IN      BOOLEAN         DEFAULT
FALSE
                    )   RETURN VARCHAR2;



/*-------------------------------------------------------------------------*
\

* Select_Printer -> Displays the standard Printer Selection
* dialog.
* Arguments:
* PrinterName -> The Name of the Printer the user Chooses
* Port -> The Port for the above printer
* RaiseExceptions -> TRUE of FALSE(Default) If set to true, then
if the
* command is not successful (e.g no Printer is
selected) then the explicit exception
* NO_DATA_FOUND will be raised.
* Returns:
* Path and name of the selected file
\*-------------------------------------------------------------------------*
/
PROCEDURE Select_Printer (      PrinterName     OUT     VARCHAR2,
                                Port            OUT     VARCHAR2,
                                RaiseExceptions in BOOLEAN DEFAULT FALSE);


END WIN_API_DIALOG; Received on Sat Dec 08 2001 - 06:43:27 CET

Original text of this message