home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / programmieren / e / easyplugins / source / location.e < prev    next >
Encoding:
Text File  |  1998-02-21  |  1.0 KB  |  63 lines

  1.  
  2. /*
  3.  
  4.     $VER: location_plugin 1.0 (18.2.98)
  5.  
  6.     Author:         Ali Graham
  7.                     <agraham@hal9000.net.au>
  8.  
  9.     Desc.:          Record the location of an EasyGUI window.
  10.  
  11. */
  12.  
  13.  
  14. OPT MODULE, OSVERSION=37
  15.  
  16. MODULE 'tools/EasyGUI',
  17.        'intuition/intuition'
  18.  
  19. EXPORT OBJECT location_plugin OF plugin
  20.  
  21.     lx, ly, lw, lh
  22.  
  23. ENDOBJECT
  24.  
  25. PROC min_size(ta,fh) OF location_plugin IS 0,0
  26.  
  27. PROC will_resize() OF location_plugin IS FALSE
  28.  
  29. PROC render(ta,x,y,xs,ys,win:PTR TO window) OF location_plugin
  30.  
  31.     self.get_values(win)
  32.  
  33. ENDPROC
  34.  
  35. PROC message_test(imsg:PTR TO intuimessage,win:PTR TO window) OF location_plugin
  36.  
  37.     IF (imsg.class=IDCMP_CHANGEWINDOW) OR (imsg.class=IDCMP_NEWSIZE)
  38.  
  39.         self.get_values(win)
  40.  
  41.         RETURN TRUE
  42.  
  43.     ENDIF
  44.  
  45. ENDPROC FALSE
  46.  
  47. PROC message_action(class, qual, code, win:PTR TO window) OF location_plugin IS TRUE
  48.  
  49. PROC get_values(win:PTR TO window) OF location_plugin
  50.  
  51.     IF win
  52.  
  53.         self.lx:=win.leftedge
  54.         self.ly:=win.topedge
  55.  
  56.         self.lw:=win.width
  57.         self.lh:=win.height
  58.  
  59.     ENDIF
  60.  
  61. ENDPROC
  62.  
  63.