Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Better getpict()
Message
De
07/02/2020 06:05:51
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
01672915
Message ID:
01672961
Vues:
61
>>A file picker with a picture preview would be a cherry on top.
>
>Ok, maybe I'm missing something here, but doesn't the Windows file picker do most of those things? Picture preview is automatic if you switch the pane style to thumbnail. It has an MRU list (that you can't control) and that will show last saved/loaded locations and that easily gets you into the right folder after you've saved one file.

I decided to use the common dialog, as it seems to be a wrapper for the current system dialog, so it looks the way such dialogs look elsewhere in the current edition of the windows. Now the preview window is there (not by default, but I guess that's my setting that I changed long ago, reverted to on) but it doesn't show any images except bmp... But okay, perhaps its just my minimal instance of W7 where I do this, maybe it will work elsewhere.

>FWIW I would use GetFile(), not GetPict() and apply the relevant file extension filters. Actually I tend to use the .NET equivalents because the Fox file dialogs don't return filenames in proper case (especially for PutFile()).

Since this is just a VM windows (the host system is Kubuntu), it's case blind and I'm copying the selected images into a private subfolder, building a repository), I can live with that. Though I do hate what Fox does with filename cases - I'd almost instantiate a filesystem object just to get the properly cased path of a file, if it mattered.

>Also in apps where I need to save things I tend to keep track of where things were saved last and then set the default folder to that folder. Usually that is sufficient for image workflows unless you really need to save to many locations simultaneously (which I would find rare and maybe there's a better way to handle that some other way).

Opposite here - the save-to location is fixed and invisible to the user, it's the source folders that will probably get revisited many times, so I'll maintain my own MRU list. The one in the dialog ("Recent places") is not working, and even in the cases when I saw it work, it would be polluted by places completely unrelated to job at hand. I'll have only those from which some pictures were already taken.

>I'm not aware of any 'controls' that provide this functionality. You can build your own using the shell view for the browser view, and use Fox controls for the rest, but the experience is going to suck.

I was thinking of building something like that and gave up. Nobody likes frankenstein monsters in the GUI :). Since I'm building this for just two guys' (myself and the client) private use, both quite old, I'm going for as simple as possible. It'll be either a listbox with MRU of locations plus a commandbutton, or for ten wide buttons, with "add from {location here}".

>I can tell you from experience with several products that use 'non-standard' file dialogs (anything IntelliJ until recently) that those dialogs just feel wrong and are unintuitive to use. I would try hard to make the native dialogs work because that's what users see and expect in every other application. FWIW, IntelliJ products recently changed their custom UI controls for using OS controls due to pressure from users complaining about the awkward dialogs. They weren't bad, just off enough to be annoying.

The simplest I've seen is the best - Gimp. It has a button with Recent places on the left pane, and when you click it it unfolds into a short MRU of places you used last but in Gimp only. So you save/load your pics where you did before, not where you had your video, sound, text or whatever unrelated stuff you may have done.

The one remaining trouble I haven't solved is how to show all the formats at once. The Common dialog shows only one at a time.
update: found it, it's very clumsy but it works.
.Filter = "BMP|*.bmp|GIF|*.gif|JPG|*.jpg;*.jpeg|PNG|*.png|TIFF|*.tif;*.tiff|"+;
   "All Graphics Types|*.bmp;*.jpg;*.jpeg;*.png;*.tif;*.tiff"
.FilterIndex=6

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform