home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
600-699
/
ff634.lha
/
APIG
/
apig33.lzh
/
boopsi_images.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-03-11
|
6KB
|
172 lines
/* BOOPSI IMAGES, NEWOBJECTA() EXAMPLE */
call addlib('apig.library',0,-30,0)
portname = "boopsistuff_port"
p = openport(portname)
call set_apig_globals()
screen = LOCKPUBSCREEN(null()) /* Workbench screen */
drinfo = GETSCREENDRAWINFO(screen)
wintitle = "APIG v3.1 Boopsi Images Example"
ptrtitle = ALLOCVEC(length(wintitle)+1,MEMF_CLEAR)
call export(ptrtitle,wintitle)
winidcmp = CLOSEWINDOW+GADGETUP+GADGETDOWN+MOUSEMOVE
winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO,
+ACTIVATE
/* window tags */
wtags = ALLOCATETAGITEMS(8)
call SETTAGSLOT(wtags,0,WA_PUBSCREEN,'p',screen)
call SETTAGSLOT(wtags,1,WA_IDCMP,'n',winidcmp)
call SETTAGSLOT(wtags,2,WA_FLAGS,'n',winflags)
call SETTAGSLOT(wtags,3,WA_HEIGHT,'n',200)
call SETTAGSLOT(wtags,4,WA_TITLE,'p',ptrtitle)
/* open window */
w1 = OPENWINDOWTAGLIST(portname,null(),wtags,0)
wrastport = GETWINDOWRASTPORT(w1)
/* now for some images */
imgtags = ALLOCATETAGITEMS(8)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',DEPTHIMAGE)
call SETTAGSLOT(imgtags,1,SYSIA_DRAWINFO,'p',drinfo)
call SETTAGSLOT(imgtags,2,SYSIA_SIZE,'n',SYSISIZE_MEDRES)
depthimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',ZOOMIMAGE)
zoomimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',SIZEIMAGE)
sizeimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',CLOSEIMAGE)
closeimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',SDEPTHIMAGE)
sdepthimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',MXIMAGE)
mximg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',LEFTIMAGE)
leftimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',UPIMAGE)
upimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',RIGHTIMAGE)
rightimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',DOWNIMAGE)
downimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',CHECKIMAGE)
checkimg = NEWOBJECTA(null(),"sysiclass",imgtags)
call SETTAGSLOT(imgtags,0,IA_WIDTH,'n',250)
call SETTAGSLOT(imgtags,1,IA_HEIGHT,'n',10)
call SETTAGSLOT(imgtags,2,TAG_END,'n',0)
frame1img = NEWOBJECTA(null(),"frameiclass",imgtags)
call SETTAGSLOT(imgtags,2,IA_Recessed,'n',1)
call SETTAGSLOT(imgtags,3,TAG_END,'n',0)
frame2img = NEWOBJECTA(null(),"frameiclass",imgtags)
call SETTAGSLOT(imgtags,2,IA_FGPEN,'n',1)
call SETTAGSLOT(imgtags,3,TAG_END,'n',0)
rect1img = NEWOBJECTA(null(),"fillrectclass",imgtags)
call SETTAGSLOT(imgtags,2,IA_FGPEN,'n',2)
call SETTAGSLOT(imgtags,3,TAG_END,'n',0)
rect2img = NEWOBJECTA(null(),"fillrectclass",imgtags)
call DRAWIMAGE(wrastport,depthimg,30,30)
call DRAWIMAGE(wrastport,zoomimg,30,60)
call DRAWIMAGE(wrastport,sizeimg,30,90)
call DRAWIMAGE(wrastport,closeimg,30,120)
call DRAWIMAGE(wrastport,sdepthimg,30,150)
call DRAWIMAGE(wrastport,upimg,60,30)
call DRAWIMAGE(wrastport,rightimg,60,60)
call DRAWIMAGE(wrastport,downimg,60,90)
call DRAWIMAGE(wrastport,checkimg,60,120)
call DRAWIMAGE(wrastport,mximg,60,150)
call DRAWIMAGE(wrastport,leftimg,90,30)
call DRAWIMAGESTATE(wrastport,depthimg,150,30,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,zoomimg,150,60,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,sizeimg,150,90,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,closeimg,150,120,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,sdepthimg,150,150,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,upimg,180,30,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,rightimg,180,60,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,downimg,180,90,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,checkimg,180,120,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,mximg,180,150,IDS_SELECTED,drinfo)
call DRAWIMAGESTATE(wrastport,leftimg,210,30,IDS_SELECTED,drinfo)
call DRAWIMAGE(wrastport,frame1img,260,30)
call DRAWIMAGE(wrastport,frame2img,260,44)
call DRAWIMAGE(wrastport,rect1img,260,84)
call DRAWIMAGE(wrastport,rect2img,260,98)
exitme = 0
do while exitme = 0
x = waitpkt(portname)
do forever
msg = getpkt(portname)
if msg = '0000 0000'x then leave
msgclass = getarg(msg,0)
x = reply(msg,0)
select
when msgclass = CLOSEWINDOW then exitme = 1
otherwise nop
end
end
end
call DISPOSEOBJECT(depthimg)
call DISPOSEOBJECT(zoomimg)
call DISPOSEOBJECT(sizeimg)
call DISPOSEOBJECT(closeimg)
call DISPOSEOBJECT(sdepthimg)
call DISPOSEOBJECT(upimg)
call DISPOSEOBJECT(rightimg)
call DISPOSEOBJECT(downimg)
call DISPOSEOBJECT(checkimg)
call DISPOSEOBJECT(mximg)
call DISPOSEOBJECT(leftimg)
call DISPOSEOBJECT(frame1img)
call DISPOSEOBJECT(frame2img)
call DISPOSEOBJECT(rect1img)
call DISPOSEOBJECT(rect2img)
call CLOSEWINDOW(w1)
call FREESCREENDRAWINFO(screen,drinfo)
call UNLOCKPUBSCREEN(null(),screen)
call FREETAGITEMS(wtags)
call FREETAGITEMS(imgtags)
call FREEVEC(ptrtitle)
exit