1. getOpenFileName()

Hello All.

VOID=getOpenFileName()

Always open in folder "Documents".

How can I change this?

Don Cole

new topic     » topic index » view message » categorize

2. Re: getOpenFileName()

don cole wrote:
> 
> Hello All.
> 
> VOID=getOpenFileName()
> 
> Always open in folder "Documents".
> 
> How can I change this?
> 
> Don Cole

If you are using Win32Lib, you can use SetCurrentDirectory(sequence path)

If you aren't using Win32Lib, then you will need to wait for somebody who knows
the particulars of invoking the function directly.

Mike

new topic     » goto parent     » topic index » view message » categorize

3. Re: getOpenFileName()

don cole wrote:
> 
> VOID=getOpenFileName()
> 
> Always open in folder "Documents".
> 
> How can I change this?

You can pass a path to "file" parameter of the function:

VOID = getOpenFileName( 0, "C:\\WINDOWS\\system32\\", {"All Files", "*.*"} )


You *MUST* end the path in a backslash, else Windows will fill in the last part
as the filename to choose.

HTH,

-Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: getOpenFileName()

Greg Haberek wrote:
> 
> don cole wrote:
> > 
> > VOID=getOpenFileName()
> > 
> > Always open in folder "Documents".
> > 
> > How can I change this?
> 
> You can pass a path to "file" parameter of the function:
> 
> }}}
<eucode>
> VOID = getOpenFileName( 0, "C:\\WINDOWS\\system32\\", {"All Files", "*.*"} )
> </eucode>
{{{

> 
> You *MUST* end the path in a backslash, else Windows will fill in the last
> part
> as the filename to choose.
> 
> HTH,
> 
> -Greg

Thanks Greg and Mike777,

   Now a new problem had popped up.
Here's my code:

filename = getOpenFileName(
                          MainWin,                  -- parent window
                          "H:\\",                         -- no default name
                          {"Dialog Flags", {OFN_ALLOWMULTISELECT},
                            "Rar Files", "*.RAR" ,    -- rar files
                            "All Files", "*.*" } )    -- everything else

It open in H: which is what I want but
now all files show up in the openDialog box not just the .rar files?
With my old code:
filename=getOpenFileName(0,"",   {"Dialog Flags", {OFN_ALLOWMULTISELECT},
                            "Rar Files", "*.RAR" ,    -- rar files
                            "All Files", "*.*" } )    -- everything else


only the .rar files showed up.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

5. Re: getOpenFileName()

don cole wrote:
> 
> Greg Haberek wrote:
> > 
> > don cole wrote:
> > > 
> > > VOID=getOpenFileName()
> > > 
> > > Always open in folder "Documents".
> > > 
> > > How can I change this?
> > 
> > You can pass a path to "file" parameter of the function:
> > 
> > }}}
<eucode>
> > VOID = getOpenFileName( 0, "C:\\WINDOWS\\system32\\", {"All Files", "*.*"} )
> > </eucode>
{{{

> > 
> > You *MUST* end the path in a backslash, else Windows will fill in the last
> > part
> > as the filename to choose.
> > 
> > HTH,
> > 
> > -Greg
> 
> Thanks Greg and Mike777,
> 
>    Now a new problem had popped up.
> Here's my code:
> 
> }}}
<eucode>
>                           filename = getOpenFileName(
>                           MainWin,                  -- parent window
>                           "H:\\",                         -- no default name
>                           {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,    -- rar files
>                             "All Files", "*.*" } )    -- everything else
> </eucode>
{{{

> It open in H: which is what I want but
> now all files show up in the openDialog box not just the .rar files?
> With my old code:
> }}}
<eucode>
> filename=getOpenFileName(0,"",   {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,    -- rar files
>                             "All Files", "*.*" } )    -- everything else
> </eucode>
{{{

> 
> only the .rar files showed up.
> 
> Don Cole

This has been a "simplification", hence a problem, to the user interface so that
s/he has less parameters to care about. I don't know for how long it has been
there, but probably from D. Cuny's days.

v70.4 will have a getOpenFileNameEx() that will enable you to specify the
initial directory without using the file name field, as it should have been done
from day one. I cannot change the current behaviour as tons of code may rely on
it, hence a new routine.

I hope to ship out 70.4 for testing this weekend at the latest, for a release
somewhere in february, bar gaping bugs showing up.

CChris

new topic     » goto parent     » topic index » view message » categorize

6. Re: getOpenFileName()

don cole wrote:
>    Now a new problem had popped up.
> }}}
<eucode>
>                           filename = getOpenFileName(
>                           MainWin,
>                           "H:\\",
>                           {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,
>                             "All Files", "*.*" } )
> </eucode>
{{{

> It open in H: which is what I want but
> now all files show up in the openDialog box not just the .rar files?
> With my old code:
> }}}
<eucode>
> filename=getOpenFileName(0,"",   {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,
>                             "All Files", "*.*" } )
> </eucode>
{{{

> 
> only the .rar files showed up.
Try this:
filename = getOpenFileName(
                          MainWin,
                          "H:\\.",
                          {"Dialog Flags", {OFN_ALLOWMULTISELECT},
                            "Rar Files", "*.RAR" ,
                            "All Files", "*.*" } )

That extra little dot works a charm here (win98), dunno why tho.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

7. Re: getOpenFileName()

Pete Lomax wrote:
[snip]
> Try this:
> }}}
<eucode>
>                           filename = getOpenFileName(
>                           MainWin,
>                           "H:\\.",
>                           {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,
>                             "All Files", "*.*" } )
> </eucode>
{{{

> That extra little dot works a charm here (win98), dunno why tho.
> 
> Regards,
> Pete

Thanks Pete,

    I found by fooling around that

filename = getOpenFileName(
                          MainWin,        -- parent window
                          "H:\\*.RAR",    -- Location and first file in list
                          {--"Dialog Flags", {OFN_ALLOWMULTISELECT},
                            "Rar Files", "*.RAR" ,    -- Rar files
                            "All Files", "*.*" } )    -- everything else


works just like I want with winXP and I have no idea why. 

Don Cole

new topic     » goto parent     » topic index » view message » categorize

8. Re: getOpenFileName()

don cole wrote:
> 
> Pete Lomax wrote:
> >                           "H:\\.",
>                       "H:\\*.RAR",

Yup. Just so you know, with the latter you cannot do the "Euphoria files",
(*.exw; *.ew; *.e; etc} thing. Admittedly "*.e*" is usually close enough in that
case, whereas/however "." applies filters[1] properly, whatever it may be.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu