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 >
OS/2 REXX Batch file  |  1992-03-11  |  6KB  |  172 lines

  1.  
  2. /* BOOPSI IMAGES, NEWOBJECTA()  EXAMPLE */
  3.  
  4. call addlib('apig.library',0,-30,0)
  5.  
  6. portname = "boopsistuff_port"
  7. p = openport(portname)
  8.  
  9. call set_apig_globals()
  10.  
  11. screen = LOCKPUBSCREEN(null())    /* Workbench screen */
  12.  
  13. drinfo = GETSCREENDRAWINFO(screen)  
  14.  
  15. wintitle = "APIG v3.1 Boopsi Images Example"
  16.  
  17. ptrtitle = ALLOCVEC(length(wintitle)+1,MEMF_CLEAR)
  18.  
  19. call export(ptrtitle,wintitle)
  20.  
  21. winidcmp = CLOSEWINDOW+GADGETUP+GADGETDOWN+MOUSEMOVE
  22.  
  23. winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO,
  24.            +ACTIVATE
  25.  
  26. /* window tags */
  27.  
  28. wtags = ALLOCATETAGITEMS(8)
  29.         call SETTAGSLOT(wtags,0,WA_PUBSCREEN,'p',screen)
  30.         call SETTAGSLOT(wtags,1,WA_IDCMP,'n',winidcmp)
  31.         call SETTAGSLOT(wtags,2,WA_FLAGS,'n',winflags)
  32.         call SETTAGSLOT(wtags,3,WA_HEIGHT,'n',200)
  33.         call SETTAGSLOT(wtags,4,WA_TITLE,'p',ptrtitle)
  34.  
  35.  
  36. /* open window */
  37.  
  38. w1        = OPENWINDOWTAGLIST(portname,null(),wtags,0) 
  39. wrastport = GETWINDOWRASTPORT(w1)
  40.  
  41.  
  42. /* now for some images */
  43.  
  44. imgtags = ALLOCATETAGITEMS(8)
  45.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',DEPTHIMAGE)
  46.           call SETTAGSLOT(imgtags,1,SYSIA_DRAWINFO,'p',drinfo)
  47.           call SETTAGSLOT(imgtags,2,SYSIA_SIZE,'n',SYSISIZE_MEDRES)
  48.  
  49.           depthimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  50.  
  51.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',ZOOMIMAGE)
  52.           zoomimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  53.  
  54.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',SIZEIMAGE)
  55.           sizeimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  56.  
  57.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',CLOSEIMAGE)
  58.           closeimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  59.  
  60.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',SDEPTHIMAGE)
  61.           sdepthimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  62.  
  63.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',MXIMAGE)
  64.           mximg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  65.  
  66.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',LEFTIMAGE)
  67.           leftimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  68.  
  69.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',UPIMAGE)
  70.           upimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  71.  
  72.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',RIGHTIMAGE)
  73.           rightimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  74.  
  75.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',DOWNIMAGE)
  76.           downimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  77.  
  78.           call SETTAGSLOT(imgtags,0,SYSIA_WHICH,'n',CHECKIMAGE)
  79.           checkimg = NEWOBJECTA(null(),"sysiclass",imgtags) 
  80.  
  81.           call SETTAGSLOT(imgtags,0,IA_WIDTH,'n',250)
  82.           call SETTAGSLOT(imgtags,1,IA_HEIGHT,'n',10)
  83.           call SETTAGSLOT(imgtags,2,TAG_END,'n',0)
  84.           frame1img = NEWOBJECTA(null(),"frameiclass",imgtags) 
  85.  
  86.           call SETTAGSLOT(imgtags,2,IA_Recessed,'n',1)
  87.           call SETTAGSLOT(imgtags,3,TAG_END,'n',0)
  88.           frame2img = NEWOBJECTA(null(),"frameiclass",imgtags) 
  89.  
  90.           call SETTAGSLOT(imgtags,2,IA_FGPEN,'n',1)
  91.           call SETTAGSLOT(imgtags,3,TAG_END,'n',0)
  92.           rect1img = NEWOBJECTA(null(),"fillrectclass",imgtags) 
  93.  
  94.           call SETTAGSLOT(imgtags,2,IA_FGPEN,'n',2)
  95.           call SETTAGSLOT(imgtags,3,TAG_END,'n',0)
  96.           rect2img = NEWOBJECTA(null(),"fillrectclass",imgtags) 
  97.  
  98.  
  99. call DRAWIMAGE(wrastport,depthimg,30,30)
  100. call DRAWIMAGE(wrastport,zoomimg,30,60)
  101. call DRAWIMAGE(wrastport,sizeimg,30,90)
  102. call DRAWIMAGE(wrastport,closeimg,30,120)
  103. call DRAWIMAGE(wrastport,sdepthimg,30,150)
  104. call DRAWIMAGE(wrastport,upimg,60,30)
  105. call DRAWIMAGE(wrastport,rightimg,60,60)
  106. call DRAWIMAGE(wrastport,downimg,60,90)
  107. call DRAWIMAGE(wrastport,checkimg,60,120)
  108. call DRAWIMAGE(wrastport,mximg,60,150)
  109. call DRAWIMAGE(wrastport,leftimg,90,30)
  110.  
  111. call DRAWIMAGESTATE(wrastport,depthimg,150,30,IDS_SELECTED,drinfo)
  112. call DRAWIMAGESTATE(wrastport,zoomimg,150,60,IDS_SELECTED,drinfo)
  113. call DRAWIMAGESTATE(wrastport,sizeimg,150,90,IDS_SELECTED,drinfo)
  114. call DRAWIMAGESTATE(wrastport,closeimg,150,120,IDS_SELECTED,drinfo)
  115. call DRAWIMAGESTATE(wrastport,sdepthimg,150,150,IDS_SELECTED,drinfo)
  116. call DRAWIMAGESTATE(wrastport,upimg,180,30,IDS_SELECTED,drinfo)
  117. call DRAWIMAGESTATE(wrastport,rightimg,180,60,IDS_SELECTED,drinfo)
  118. call DRAWIMAGESTATE(wrastport,downimg,180,90,IDS_SELECTED,drinfo)
  119. call DRAWIMAGESTATE(wrastport,checkimg,180,120,IDS_SELECTED,drinfo)
  120. call DRAWIMAGESTATE(wrastport,mximg,180,150,IDS_SELECTED,drinfo)
  121. call DRAWIMAGESTATE(wrastport,leftimg,210,30,IDS_SELECTED,drinfo)
  122.  
  123. call DRAWIMAGE(wrastport,frame1img,260,30)
  124. call DRAWIMAGE(wrastport,frame2img,260,44)
  125. call DRAWIMAGE(wrastport,rect1img,260,84)
  126. call DRAWIMAGE(wrastport,rect2img,260,98)
  127.  
  128.  
  129. exitme = 0
  130. do while exitme = 0
  131.  
  132.      x = waitpkt(portname)
  133.      do forever 
  134.         msg = getpkt(portname)
  135.         if msg = '0000 0000'x then leave
  136.         msgclass  = getarg(msg,0)
  137.         x = reply(msg,0)  
  138.         select
  139.            when msgclass = CLOSEWINDOW then exitme = 1
  140.            otherwise nop
  141.         end
  142.      end
  143. end
  144.  
  145. call DISPOSEOBJECT(depthimg)
  146. call DISPOSEOBJECT(zoomimg)
  147. call DISPOSEOBJECT(sizeimg)
  148. call DISPOSEOBJECT(closeimg)
  149. call DISPOSEOBJECT(sdepthimg)
  150. call DISPOSEOBJECT(upimg)
  151. call DISPOSEOBJECT(rightimg)
  152. call DISPOSEOBJECT(downimg)
  153. call DISPOSEOBJECT(checkimg)
  154. call DISPOSEOBJECT(mximg)
  155. call DISPOSEOBJECT(leftimg)
  156. call DISPOSEOBJECT(frame1img)
  157. call DISPOSEOBJECT(frame2img)
  158. call DISPOSEOBJECT(rect1img)
  159. call DISPOSEOBJECT(rect2img)
  160.  
  161. call CLOSEWINDOW(w1)
  162.  
  163. call FREESCREENDRAWINFO(screen,drinfo)
  164.  
  165. call UNLOCKPUBSCREEN(null(),screen)
  166.  
  167. call FREETAGITEMS(wtags)
  168. call FREETAGITEMS(imgtags)
  169. call FREEVEC(ptrtitle)
  170.  
  171. exit
  172.