home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / e / EasyGUI_v33b2.lha / Docs / imagebutton.doc < prev    next >
Text File  |  1996-12-04  |  3KB  |  82 lines

  1. ImageButton PLUGIN
  2. ------------------
  3. A flexible image button gadget in three flavours: normal (momentary),
  4. toggle and push (sticky).  Uses the 'button.gadget' which needs to be in
  5. the normal place of libs:gadgets/ (usually libs: is also assigned to
  6. sys:classes/, and .gadget files should be stored in the
  7. sys:classes/gadgets/ directory).
  8.  
  9. Constructors:
  10.  
  11.     imagebutton(image:PTR TO image,width=0,height=0,
  12.                 resizex=FALSE,resizey=FALSE,disabled=FALSE)
  13.         image    -> The button's image
  14.         width    -> The nominal width of the gadget
  15.         height   -> The nominal height of the gadget
  16.         resizex  -> Whether this button can resize in width
  17.         resizey  -> Whether this button can resize in height
  18.         disabled -> Whether this gadget is disabled
  19.  
  20.     toggleimagebutton(image:PTR TO image,width=0,height=0,selected=FALSE,
  21.                       resizex=FALSE,resizey=FALSE,disabled=FALSE)
  22.         image    -> The button's image
  23.         width    -> The nominal width of the gadget
  24.         height   -> The nominal height of the gadget
  25.         selected -> Whether this button is selected (on) initially
  26.         resizex  -> Whether this button can resize in width
  27.         resizey  -> Whether this button can resize in height
  28.         disabled -> Whether this gadget is disabled
  29.  
  30.     pushimagebutton(image:PTR TO image,width=0,height=0,selected=FALSE,
  31.                     resizex=FALSE,resizey=FALSE,disabled=FALSE)
  32.         image    -> The button's image
  33.         width    -> The nominal width of the gadget
  34.         height   -> The nominal height of the gadget
  35.         selected -> Whether this button is selected (on) initially
  36.         resizex  -> Whether this button can resize in width
  37.         resizey  -> Whether this button can resize in height
  38.         disabled -> Whether this gadget is disabled
  39.  
  40.     Note: the width and height of the gadget will be at least as big as
  41.           that needed to fit the image (so it's safe to specify them as 0).
  42.  
  43. Destructor:
  44.  
  45.     END *must* be called for each NEWed object.
  46.  
  47. Data (should be considered read-only):
  48.  
  49.     OBJECT imagebutton OF plugin
  50.       selected  -> Current state of the button (=0 is off, <>0 is on)
  51.       disabled  -> Disabled or enabled
  52.     PRIVATE ...
  53.     ENDOBJECT
  54.  
  55.     The selected element is useful only for toggle and push buttons.
  56.  
  57. New methods:
  58.  
  59.     setselected(selected=TRUE)   -> Set the button on or off
  60.     setimage(image:PTR TO image) -> Change the button's image
  61.     setdisabled(disabled=TRUE)   -> Disable/enable the gadget
  62.  
  63.     Note: setselected() is ignored for normal buttons.
  64.     Note: push buttons cannot be deselected by the user (they're sticky),
  65.           so use setselected() to deselect them when necessary.
  66.     Note: setimage() will work only if the image fits in the button's
  67.           minimum size (so, you should specify the maximum width and height
  68.           of the images you will use in the constructor...)
  69.  
  70. Action functions:
  71.  
  72.     Your action function will be called (or your action value returned by
  73.     easygui()) in the following circumstances:
  74.       o When the button is pressed to select or deselect it.
  75.  
  76. Exceptions:
  77.  
  78.     "butt" will be raised by the constructor if the .gadget file can't be
  79.            opened.
  80.     "butt" will be raised by the render() method if the gadget can't be
  81.            created.
  82.