View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Thu Nov 18, 2021 12:14 pm Post subject: browse_for_folder1@ |
|
|
There’s a tiny irritation with the "browse_for_folder1@" routine (and the BROWSEINFO structure link in the help file links to an out of date page: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773205.aspx).
The irritation is that if an initial path is set, it gets selected OK but the window doesn’t auto scroll to bring that path into the initial view.
does anyone know if there is a flag setting that can enable this?
For example: with the starting path set to "D:\data\clients\datafiles", the initial view always seems to start @ desktop with the selected folder way down the tree and thus not visible.
(i note that if i select “make new folder” button, the view 'jumps' perfectly to show the selected folder!)
TIA
K |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Nov 18, 2021 12:50 pm Post subject: |
|
|
That must be just one of a set of niggles that mostly we have to live with.
Here's a couple from me:
(1) The link to Browseinfo structure in browse_for_folder@ in FTN95.CHM doesn't work (Internet Explorer - itis?)
(2) Using the standard callback 'FILE_OPENR' has the action button 'Open' while 'FILE_OPENW' gives you 'Save', but the GET_FILTERED_FILE@ route only gives you 'Open' (I think) - but you are directed to the latter if you need to alter the file specification dynamically.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Thu Nov 18, 2021 1:47 pm Post subject: |
|
|
Thanks for the feedback. I have logged these issues for investigation. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Sat Nov 20, 2021 2:32 pm Post subject: |
|
|
KennyT
Please try the following sample program. Does it do what you want?
Code: | winapp
program main
use clrwin
character path*256
logical folder
integer(7)::hwnd = 0
call set_browse_for_folder_initial@("C:\techsupport")
path = ' '
folder=browse_for_folder1@(hwnd, 'Find Folder', path, z'40')
i = winio@("%40st", path)
end program |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Sat Nov 20, 2021 2:44 pm Post subject: |
|
|
Eddie
1) The link works for me but I have to select "Yes" from the error dialog.
2) The first argument for GET_FILTERED_FILE@ sets the title.
Code: | WINAPP
PROGRAM sample
INTEGER iw
INTEGER,EXTERNAL::open_func
iw = winio@('%ca[Sample]&')
iw = winio@('%mn[&File[&Open,E&xit]]',open_func,'EXIT')
END
!------------------------------------------------------------
INTEGER FUNCTION open_func()
USE mswin
CHARACTER file*256,path*256,title*20
INTEGER,PARAMETER::NFILTERS=2
CHARACTER*20 filtname(NFILTERS),filtspec(NFILTERS)
title = 'Open Fortran File'
file = ' ' !Or the path of a file.
path = 'C:\techsupport'
filtname(1) = 'Fortran files'
filtspec(1) = '*.f90'
filtname(2) = 'All files'
filtspec(2) = '*.*'
CALL get_filtered_file@(title,file,path,filtname,filtspec,NFILTERS,1)
IF(len_trim(file) == 0) file = "Open dialog cancelled by user."
iw = MessageBox(0,file,"Sample",0)
open_func = 2
END |
|
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Sat Nov 20, 2021 3:52 pm Post subject: Re: |
|
|
PaulLaidler wrote: | KennyT
Please try the following sample program. Does it do what you want?
Code: | winapp
program main
use clrwin
character path*256
logical folder
integer(7)::hwnd = 0
call set_browse_for_folder_initial@("C:\techsupport")
path = ' '
folder=browse_for_folder1@(hwnd, 'Find Folder', path, z'40')
i = winio@("%40st", path)
end program |
|
sadly, no. it illustrates the problem i reported in that, if you choose a "deep" path you can't see that folder in the initial view because the window doesn't auto-scroll.
K |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat Nov 20, 2021 8:05 pm Post subject: |
|
|
Hi Paul,
In respect of (1), I wasn't expecting to have an error dialogue in the first place!
As for (2), it's not the caption, but the text on the action button. Just an observation, not a problem.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Sun Nov 21, 2021 9:15 am Post subject: |
|
|
Eddie
I appreciate that the error message is unwelcome. It is a Microsoft response that I don't know how to avoid. I guess that it has something to do with the chm compiler. |
|
Back to top |
|
|
|