I tried loading the FileOp module to my machine and got an error that it
couldn't find the Lazy.pm module.  I did a search on cpan for lazy.pm and I
couldn't find it.  What is Lazy.pm, do I need it, how do I get FileOp?

Thanks,

Joe





"Frazier, Joe Jr" <[EMAIL PROTECTED]> on 10/22/2001 01:03:21 PM

To:   <[EMAIL PROTECTED]>
cc:   <perl-win32-gui-users@lists.sourceforge.net>
Subject:  RE: [perl-win32-gui-users] Save file window

I don't know.  To my knowledge, it returns a string only.  You CAN use
Win32::FileOP:

use Win32::FileOp;
my $filters = [ 'Text' => '*.txt', 'Word' => '*.doc', 'Perl' => '*.pl'];
my $ret = Win32::FileOp::SaveAsDialog({filters =>$filters ,handle =>
0,});

if($ret) {
    print "GetSaveFileName returned: '$ret'\n";
} else {
    if(GUI::CommDlgExtendedError()) {
        print "ERROR. CommDlgExtendedError is:
",GUI::CommDlgExtendedError(), "\n";
    } else {
        print "You cancelled.\n";
    }
}
This will return the filename with the selected ext filter added.  Take
care NOT to include more then one ext, cause it will always add the
first to the filename( kind of a no brainer).


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 22, 2001 11:05 AM
> To: Frazier, Joe Jr
> Cc: perl-win32-gui-users@lists.sourceforge.net
> Subject: RE: [perl-win32-gui-users] Save file window
>
>
>
>
> How do you get it to return the filename with the extension.
> In sfn.pl it
> added the filters *.txt and *.pl.  Is there a way to get that
> filter so
> that if I type the name of the file and select the .txt
> filter I'll have
> "filename.txt"?  It would be nice to think that users will type the
> extension, but they don't.
>
> Thanks,
>
> Joe
>
>
>
>
>
> "Frazier, Joe Jr"
> <[EMAIL PROTECTED]>@lists.sourceforge.net on
> 10/19/2001 02:25:13 PM
>
> Sent by:  [EMAIL PROTECTED]
>
>
> To:   <perl-win32-gui-users@lists.sourceforge.net>
> cc:    (bcc: Joseph Vieira/DMR/CA)
> Subject:  RE: [perl-win32-gui-users] Save file window
>
> From GUI.xs, here is the definition:
>
> # (@)METHOD:GetSaveFileName(%OPTIONS)
>     # Allowed %OPTIONS are:
>     #  -owner => WINDOW
>     #      [TBD]
>     #  -title => STRING
>     #      the title for the dialog
>     #  -directory => STRING
>     #      specifies the initial directory
>     #  -file => STRING
>     #      specifies a name that will appear on the dialog's
> edit field
>     #  -filter => ARRAY REFERENCE
>     #      [TBD]
>
> Here is an example from sfn.pl ( included example in the source
> distribution)
>
> Add "-directory => something" to the sub arg to start in a particular
> folder
> I have never used the -owner flag, so I have no idea what it does.
>
> <CODE>
> use Win32::GUI;
>
> $file = "\0" . " " x 256;
>
> $ret = GUI::GetSaveFileName(
>     -title  => "Win32::GUI::GetSaveFileName test",
>     -file   => "\0" . " " x 256,
>     -filter => [
>         "Text documents (*.txt)" => "*.txt",
>         "Perl stuff (*.pl, *.pm)" => "*.pl;*.pm",
>         "All files", "*.*",
>     ],
> );
>
> if($ret) {
>     print "GetSaveFileName returned: '$ret'\n";
> } else {
>     if(GUI::CommDlgExtendedError()) {
>         print "ERROR. CommDlgExtendedError is: ",
> GUI::CommDlgExtendedError(), "\n";
>     } else {
>         print "You cancelled.\n";
>     }
> }
>
> </CODE>
>
> Basically, if $ret is defined, it is the full path to the
> file you want
> to save. You can then perfom open, pipe, pass to constructors
> which take
> a filename, etc.  Also, for the Openfile, you may want to
> play with the
> Win32::GUI::BrowseForFolder function AND look back on the list several
> weeks for Win32::FileOp reference.  It includes a better Openfilename
> function in that you can specify a flag to open multiple file names
> amoung other options not available(currently) in the
> Win32::GUI::GetOpenFileName function.
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Friday, October 19, 2001 1:53 PM
> > To: perl-win32-gui-users@lists.sourceforge.net
> > Subject: [perl-win32-gui-users] Save file window
> >
> >
> >
> > Hello,
> >
> > I was looking at the sample perl scripts and came accross
> > ofn.pl, it uses
> > Win32::GUI::GetOpenFileName.  Which opens up an open file
> > window.  Created
> > and ready to use with all the buttons.  Cool.  I couldn't find it
> > documented any where and now I am wondering if there is a
> > save file window
> > (I really hope so).  I'd rather not have to create one if
> > it's already been
> > done.  Does anyone know?
> >
> > Thanks,
> >
> > Joe
> >
> >
> >
> >
> > _______________________________________________
> > Perl-Win32-GUI-Users mailing list
> > Perl-Win32-GUI-Users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> >
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
>
>
>
>
>







Reply via email to