Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OPEN dialog box settings

Status
Not open for further replies.

Stella740pl

Programmer
Jul 3, 2003
2,657
US

Hi, everyone,

Is it possible to set something somewhere so that FoxPro would remember my preference of always opening an OPEN dialog box in "Details" view, instead of defaulting to "List" view? And maybe also the order of the columns, too? At least during one development session or one run of an application (well, I guess for an application I can write my own, but I would prefer to customize the standard one). I couldn't find anything of the sort in either Help or VFP Options.

Say, MS Office (I use 2000) seems to remember my preferred view, but can’t change the order of the columns instead. In VFP6 I can drag columns of OPEN dialog to any order I like, but can’t get it to remember either view or order (or am I missing anything).

If it is not possible in VFP6, is it available in later versions?
 
That is interesting. I hardly ever use the Open dialog box, so I never really noticed that is doesn't use the details view. Even so, I am curious why you would need to see the date and time of VFP files. I am never interested in anything more than the path and the extension.

IAC, I don't believe there is a way to customize that in the VFP IDE.

pamela
 

Stella,

As far as I can make out, the dialogue opens by default in the VFP default directory. If the user switches to a different directory within the dialogue, and then closes it (as opposed to cancelling), then that new directory becomes the default the next time the dialogue is opened (which is in fact often what the user wants).

If you want it to open in a specific directory, I suppose you could change the VFP default just before you open it, and change it back again just afterwards. But that's a bit messy, and in any case would not work if the user had previously navigated elsewhere.

I guess it must be possible to change this behaviour, but I've no idea how.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 

Thanks, Pamela and Mike!

Mike, it's not the specific directory that I'm after; it does in VFP default directory, and I have no problems with that.

What I am after is the view shown in that box. By default, it opens with "List" view: you know, just columns of file names in alphabetical order.

I would prefer it to open with "Details" view, which includes date/time and size columns, etc., and allows you to drag columns to any order you wish and sort it by any of them. But even if you set it to "Details" once Open dialog box is on the screen, it would open with the default "List" view the very next time several seconds later. I use this feature quite often (unlike Pamela, I'm interested in more than just the path and the extension, and it’s not only VFP native files I’m using), especially in development environment and everyday application/database support, and this behavior gets quite irritating.

Pamela, you were curious why I would need to see the date and time. Sometimes I need to compare time of report .dbf file and source .dbf file (and rerun report from the latest updated source file); to hand-pick interactively delimited text file to append to .dbf, to check what is the latest version of someone else’s file I should be using (and it’s not always using exactly the same name) while already opening it. Many times I can say a lot of the data in the file by its size, before opening it, etc., etc. Or it could be just easier to find when sorted by date or size.

But it does look like it cannot be customized.
Does it remeber the latest View selection in VFP versions 7 through 9 then?

Stella
 

Stella,

OK, I see now what you want to achieve. I should've have read your post more carefully.

I wonder if you can find some keyboard combination that would change the view to what you want. Something like "{SHIFT+F10}"+ "vd", perhaps (Shift+F10 to open the context menu, then View, Details).

If that works, you could KEYBOARD those characters before opening the dialogue. Maybe worth a try.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 

Mike, doesn't seem to work this way even directly from Open dialog; at least I haven't found yet the key combination that does that.

If there is one, it would be useful in applications, to pre-send one to the keyboard before using GETFILE() function.

As for development environment, I just call Open dialog with {CTRL+O}, so I am not sure if an extra key combination would be of much help.

Thanks for your input.
Stella.
 
Stella,

This won't really answer your question, but if a keyboard shortcut DOES surface, you could make use of it. Just create a PRG file that executes the KEYBOARD command and then calls the Open dialog. Then use ON KEY to set a keyboard shortcut that executes your PRG. At least I THINK it's ON KEY...I haven't used it in awhile.

If it's important enough to you, you could create your own Open dialog that shows exactly what you're looking for. You should also be able to bind CTRL-O to use your dialog instead of the built-in one...but don't quote me on that.

Ian
 

chpicker,

Just create a PRG file that executes the KEYBOARD command and then calls the Open dialog. Then use ON KEY to set a keyboard shortcut that executes your PRG.
Thanks, that's a good idea. I have been thinking of something similar, even though not exactly the same.

you could create your own Open dialog that shows exactly what you're looking for.
This I know. Currently, haven't got enough time to spend on tools and toys, as I have a lot of regular everyday work pending, and vacation time is coming up soon. That's why I put the possibility of writing it in perspective, and would prefer for now quick adjusting of standard tool over writing my own.

Thanks.

 
Ian,

At least I THINK it's ON KEY...I haven't used it in awhile

No, I don't think ON KEY is appropriate here. Are you thinking of KEYBOARD? That's what I suggested earlier -- execute the KEYBOARD command and then immediately open the dialogue. Stella said that didn't work, but that was before you made it clear that is should be done in a PRG.

I had in mind something like this, in a PRG:

Code:
KEYBOARD "{SHIFT+F10}"+ "vd"
lcREsult = GETFILE()

But maybe it's not that easy.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
I was able to change the view to Detail using only the keyboard, using the following sequence:

Ctrl-O
Shift-Tab
Shift-Tab
Shift-Tab
Right-Arrow
Right-Arrow
Down-Arrow
"D"

Maybe try to KEYBOARD that sequence in a prg or program a shortcut key and see what happens.

It appears that from the DOC the VFP open dialog calls the Windows open dialog - so maybe there's a Windows API call that would do it - if you had time to do the research.





Mike Krausnick
Dublin, California
 

Mike Krausnick,

That's approximately (just take away one of the Shift-Tabs) what I <sometimes> do manually when I change the view (that or pointing to the proper button by mouse), and what I was already trying to put in the keyboard - with no luck. It just still opens it with the default.

Those are just some of the combinations I have been trying:

Code:
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{DNARROW+D}"
GETFILE()				

*========================

KEYBOARD "{CTRL+O}"
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{DNARROW+D}"

*========================

KEYBOARD "{CTRL+O}"
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{DNARROW}"
KEYBOARD "D"

*========================

KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{SHIFT+TAB}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{DNARROW}"
KEYBOARD "D"
GETFILE()
 


Wait a minute .... I've just realised. Surely none of this is going to work? The KEYBOARD command stuffs data into the FoxPro keyboard buffer. The Open File dialgoue is a Windows dialogue, and is not part of VFP. So there's no reason why it should receive FoxPro keystrokes.

Does that sound right?

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 

Mike,

If it is indeed a Windows dialogue (Mike Krausnick also mentioned that) and not a FoxPro form, then what you say does make sense. (And it doesn't work with VFP keystrokes, just like you say.)

But then, it's not a new Open dialog box should be written, but a new shell in VFP for it. Well, it is something. Will have to research on this; most likely after my vacation.

Interesting. Thanks.
 
Even though I won't be working on this (and reading through the articles) for at least few more weeks, I will post the links that I already found and intend to use as starting points, just in case someone is interested. (Well, I use VFP6, and those are for VFP7, C++, etc., but I still hope to make something out of it.)






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top