View Raw SPL
#include
setallx(win, xl, xr)
{
local winnum, f, i;
/* parse args */
(winnum, xl, xr) = setallx_args(win, xl, xr);
/* window number returned - convert to window */
win = castwindow(winnum);
/* current focus */
f = getfocus(win);
/* number of overlays */
nfoc = getfocus(win, -1);
/* loop through overlays setting Y range */
loop (i = 1..nfoc)
{
focus(win, i);
setx(win, xl, xr);
}
/* restore focus */
focus(win, f);
}
/* get args for setallx */
setallx_args(win, xl, xr)
{
local winnum;
switch (argc)
{
case 0:
win = refwindow(w0);
xl = getxl(w0);
xr = getxr(w0);
break;
case 1:
if (iswindow(win))
{
xl = getxl(win);
xr = getxr(win);
}
else
{
error("setallx - window required");
}
break;
case 2:
if (iswindow(win))
{
xr = getxr(win);
}
else
{
xr = xl;
xl = win;
win = refwindow(w0);
}
break;
default:
break;
}
/* convert to window number */
winnum = getwnum(win);
return(winnum, xl, xr);
}