home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 18
/
aminetcdnumber181997.iso
/
Aminet
/
dev
/
e
/
EasyGUI_v33b2.lha
/
Docs
/
imagebutton.doc
< prev
next >
Wrap
Text File
|
1996-12-04
|
3KB
|
82 lines
ImageButton PLUGIN
------------------
A flexible image button gadget in three flavours: normal (momentary),
toggle and push (sticky). Uses the 'button.gadget' which needs to be in
the normal place of libs:gadgets/ (usually libs: is also assigned to
sys:classes/, and .gadget files should be stored in the
sys:classes/gadgets/ directory).
Constructors:
imagebutton(image:PTR TO image,width=0,height=0,
resizex=FALSE,resizey=FALSE,disabled=FALSE)
image -> The button's image
width -> The nominal width of the gadget
height -> The nominal height of the gadget
resizex -> Whether this button can resize in width
resizey -> Whether this button can resize in height
disabled -> Whether this gadget is disabled
toggleimagebutton(image:PTR TO image,width=0,height=0,selected=FALSE,
resizex=FALSE,resizey=FALSE,disabled=FALSE)
image -> The button's image
width -> The nominal width of the gadget
height -> The nominal height of the gadget
selected -> Whether this button is selected (on) initially
resizex -> Whether this button can resize in width
resizey -> Whether this button can resize in height
disabled -> Whether this gadget is disabled
pushimagebutton(image:PTR TO image,width=0,height=0,selected=FALSE,
resizex=FALSE,resizey=FALSE,disabled=FALSE)
image -> The button's image
width -> The nominal width of the gadget
height -> The nominal height of the gadget
selected -> Whether this button is selected (on) initially
resizex -> Whether this button can resize in width
resizey -> Whether this button can resize in height
disabled -> Whether this gadget is disabled
Note: the width and height of the gadget will be at least as big as
that needed to fit the image (so it's safe to specify them as 0).
Destructor:
END *must* be called for each NEWed object.
Data (should be considered read-only):
OBJECT imagebutton OF plugin
selected -> Current state of the button (=0 is off, <>0 is on)
disabled -> Disabled or enabled
PRIVATE ...
ENDOBJECT
The selected element is useful only for toggle and push buttons.
New methods:
setselected(selected=TRUE) -> Set the button on or off
setimage(image:PTR TO image) -> Change the button's image
setdisabled(disabled=TRUE) -> Disable/enable the gadget
Note: setselected() is ignored for normal buttons.
Note: push buttons cannot be deselected by the user (they're sticky),
so use setselected() to deselect them when necessary.
Note: setimage() will work only if the image fits in the button's
minimum size (so, you should specify the maximum width and height
of the images you will use in the constructor...)
Action functions:
Your action function will be called (or your action value returned by
easygui()) in the following circumstances:
o When the button is pressed to select or deselect it.
Exceptions:
"butt" will be raised by the constructor if the .gadget file can't be
opened.
"butt" will be raised by the render() method if the gadget can't be
created.