Platform |
Win32, x64 |
|||||||||||||||||||||
Purpose |
To access the standard 'open' dialog box. |
|||||||||||||||||||||
Syntax |
SUBROUTINE GET_FILTERED_FILE@(TITLE, FILE, PATH, |
|||||||||||||||||||||
Description |
This function can be used instead of %fs (Directory for File Dialog) and %ft (Filter for File Dialog) in cases where the filters need to be set dynamically. The arguments are as follows: |
|||||||||||||||||||||
| ||||||||||||||||||||||
Notes |
After this routine has been called, CLEARWIN_INFO@('FILTER_ITEM_SELECTED') provides the index of the file filter that was selected by the user. This can be called, for example, to detect if the file was saved using a different file extension. Previously 64 bit ClearWin+ used an indirect call to the Windows API whilst 32 bit ClearWin+ used a direct
call. Now both 64 bit and 32 bit ClearWin+ use a direct call by default whilst the indirect method is available
as an option. The alternative is a little slower but might generally prove to be safer. Make a prior call: |
|||||||||||||||||||||
See also |
||||||||||||||||||||||
Example |
|
WINAPP
INTEGER i,winio@,open_func
EXTERNAL open_func
i=winio@('%ca[Image info]&')
i=winio@('%mn[&File[&Open,E&xit]]',open_func,'EXIT')
END
c------------------------------------------------------------
INTEGER FUNCTION open_func()
INCLUDE <windows.ins>
CHARACTER file*129,format*12,title*20,path*129
INTEGER NFILTERS
PARAMETER(NFILTERS=2)
CHARACTER*20 filtname(NFILTERS),filtspec(NFILTERS)
title='Open Bitmap File'
file=' '
path='c:\windows'
filtname(1)='Bitmap files'
filtspec(1)='*.bmp'
filtname(2)='All files'
filtspec(2)='*.*'
CALL get_filtered_file@(title,file,path,filtname,filtspec,
+ NFILTERS,1)
. . . .
open_func=1
END