home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / e-tools / plugins / frumsplugs / examples / imagebuttontest.e < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.3 KB  |  49 lines

  1. /* Example of frumSPlugs' ImageButton plugin. */
  2. -> $VER: ImageButtonTest.e V1.0 Stephen Sinclair (96.06.16)
  3.  
  4. OPT OSVERSION=37
  5. MODULE 'Tools/EasyGUI','Intuition/intuition','Plugins/ImageButton',
  6.        'Intuition/ImageClass','Utility'
  7.  
  8. PROC main() HANDLE
  9.   DEF ip:PTR TO imagebuttonplugin
  10.  
  11.   IF utilitybase:=OpenLibrary('utility.library',0)
  12.     easygui('Blah',
  13.       [ROWS,
  14.         [TEXT,'Image:',NIL,TRUE,STRLEN],
  15.  
  16. /* Create a button from an intuition image.  This particular image is  **
  17. ** just a solid colour, but you could give it imagery simply by giving **
  18. ** it a pointer to some bitplane data.                                 */
  19.         [PLUGIN,{customimage},NEW ip.imagebuttonplugin([0,0,50,50,2,NIL,0,3,NIL]:image,[0,0,50,50,2,NIL,0,7,NIL]:image)],
  20.         [BUTTON,0,'Quit']
  21.       ]
  22.     )
  23.   ENDIF
  24.  
  25. EXCEPT
  26.  
  27. /* Always END the object! */
  28.   END ip
  29.   IF utilitybase THEN CloseLibrary(utilitybase)
  30.   WriteF('\s\b',[exception,0])
  31. ENDPROC
  32.  
  33. CHAR '$VER: ImageButtonTest V1.0 Stephen Sinclair (96.06.16)',0
  34.  
  35. PROC customimage(x) IS WriteF('You clicked the custom image!\n'),x
  36.  
  37. /*
  38. (----) OBJECT image
  39. (   0)   leftedge:INT
  40. (   2)   topedge:INT
  41. (   4)   width:INT
  42. (   6)   height:INT
  43. (   8)   depth:INT
  44. (  10)   imagedata:PTR TO INT
  45. (  14)   planepick:CHAR
  46. (  15)   planeonoff:CHAR
  47. (  16)   nextimage:PTR TO image
  48. (----) ENDOBJECT     /* SIZEOF=20 */
  49. */