home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / easygui_os12 / source / easyplugins / location_os12.e < prev    next >
Encoding:
Text File  |  2000-06-11  |  1.2 KB  |  74 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
  15. OPT PREPROCESS
  16.  
  17. -> RST: Added conditional EASY_OS12 support
  18. #define EASY_OS12
  19.  
  20. #ifdef EASY_OS12
  21.   MODULE 'tools/easygui_os12'
  22. #endif
  23. #ifndef EASY_OS12
  24.   OPT OSVERSION=37
  25.   MODULE 'tools/easygui'
  26. #endif
  27.  
  28. MODULE 'intuition/intuition'
  29.  
  30. EXPORT OBJECT location_plugin OF plugin
  31.  
  32.     lx, ly, lw, lh
  33.  
  34. ENDOBJECT
  35.  
  36. PROC min_size(ta,fh) OF location_plugin IS 0,0
  37.  
  38. PROC will_resize() OF location_plugin IS FALSE
  39.  
  40. PROC render(ta,x,y,xs,ys,win:PTR TO window) OF location_plugin
  41.  
  42.     self.get_values(win)
  43.  
  44. ENDPROC
  45.  
  46. PROC message_test(imsg:PTR TO intuimessage,win:PTR TO window) OF location_plugin
  47.  
  48.     IF (imsg.class=IDCMP_CHANGEWINDOW) OR (imsg.class=IDCMP_NEWSIZE)
  49.  
  50.         self.get_values(win)
  51.  
  52.         RETURN TRUE
  53.  
  54.     ENDIF
  55.  
  56. ENDPROC FALSE
  57.  
  58. PROC message_action(class, qual, code, win:PTR TO window) OF location_plugin IS TRUE
  59.  
  60. PROC get_values(win:PTR TO window) OF location_plugin
  61.  
  62.     IF win
  63.  
  64.         self.lx:=win.leftedge
  65.         self.ly:=win.topedge
  66.  
  67.         self.lw:=win.width
  68.         self.lh:=win.height
  69.  
  70.     ENDIF
  71.  
  72. ENDPROC
  73.  
  74.