home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Utilities
/
QuickFile
/
ARexx
/
GetViewWin.quickfile
< prev
next >
Wrap
Text File
|
2000-05-26
|
2KB
|
65 lines
/*
$VER: GetViewWin.quickfile 1.3 (26 May 2000 15:06:44) By M Andre Z Eckenrode
External function for other QuickFile macros; returns information regarding
the size and position of the current view window, and the size of the default
font.
Requires rexxsupport.library, but no arguments.
Returns the following string:
<win.x> <win.y> <win.w> <win.h> <win.cx> <win.cy> <fs>
Where:
<win.x> = window left edge offset
<win.y> = window top edge offset
<win.w> = window width
<win.h> = window height
<win.cx> = window center horizontal offset
<win.cy> = window center vertical offset
<fs> = size of the Workbench Font prefs default font
All window values are only necessarily accurate if the current view has been
saved to disk, and has not been modified since. If the view has not been saved
to disk, all values are assumed to be the same as for QuickFile's default
window, which are:
0 1 640 256 320 125
*/
options results
lib = 'rexxsupport.library'
if ~show('l',lib) then call addlib(lib,0,-30)
gfxbase = showlist(l,'graphics.library',,a)
fontaddr = next(gfxbase,154)
call forbid()
fs = c2d(import(offset(fontaddr, 20),2))
call permit()
setfile
db = result
query file 'DB' db
call pragma('d',db.path)
setview
view = pragma('d')||copies('/',abs(sign(pos(':',pragma('d'),length(pragma('d'))))-1))result
if ~exists(view) then return 0 1 640 256 320 125 fs
if ~open(1view,view,'r') then do
reqmsg '"Unable to open file\010\034'view'\034\010to read window size and position. Using default values."'
return 0 1 640 256 320 125 fs
end
do 3
line = readln(1view)
end
parse var line . . win.h win.w win.x win.y .
win.cx = win.x+(win.w%2)
win.cy = win.y+(win.h%2)
return win.x win.y win.w win.h win.cx win.cy fs