Username: Password:

Button Plug-in Scripting Reference



Overview

The button plugin provides for a variety of button types and styles.

Check boxes, radio buttons, system buttons, toggles, and custom buttons are included.

Messages: nodemove, nodechange, nodeactive

Nodemove is sent when the position of the button changes.

Nodechange is sent when the checked state of the button changes.

Nodeactive is sent when the active state of the button changes.

 

Commands and Functions



activeget, activeset

active TF = activeget(node name $)
activeset(node name $, active TF)

Get or set the active attribute. Inactive buttons are dull and do not respond to mouse input.



alignget, alignset

text align # = alignget(node name $)
alignset(node name $, text align #)

Get or set text alignment, -1 to 1 for left, center, and right for bevel, roundrect, rectangle, and oval buttons.



antialiasget, antialiasset

antialias TF = antialiasget(node name $)
antialiasset(node name $, antialias TF)

Turn on and off antialiasing for buttons.

This property only effects oval and roundrect buttons.



boundsget, boundsset

rectangle $ = boundsget(node name $)
boundsset(node name $, rectangle $)

Get or set the boundary rectangle of the button.



checkedget, checkedset

checked TF = checkedget(node name $)
checkedset(node name $, checked TF)

Get or set the checked attribute of radion or check box buttons.



cornerget, cornerset

corner radius # = cornerget(node name $)
cornerset(node name $, corner radius #)

Get or set the corner for a round rectangle buttons.




counticons, deleteicon, inserticon

total icons # = counticons(node name $)
deleteicon(node name $, icon index #)
inserticon(node name $, after index #)

These routines create, delete, and count icons for the given button.

In general, you should insert and name an icon, import data for it, and set the show icon name of the button to display.
See: showiconset, showiconget



defaultget, defaultset

default button TF = defaultget(node name $)
defaultset(node name $, default button TF)

Get or set the default state of the button.

Default macintosh buttons have a double border, and a heavy border for windows buttons.





fillbackcolorget, fillbackcolorset, fillforecolorget, fillforecolorset

fillbackcolor $ = fillbackcolorget(node name $)
fillbackcolorset(node name $, fillbackcolor $)
fillforecolor $ = fillforecolorget(node name $)
fillforecolorset(node name $, fillforecolor $)

Set the fill fore and back colors. The fore color is for "on" bits in the pattern, the back color is for "off" bits.



fillget, fillset

fill TF = fillget(node name $)
fillset(node name $, fill TF)

Turn on and off filled objects for bevel, roundrect, rectangle, and oval buttons.





fillpatternget, fillpatternset, linepatternget, linepatternset

fillpattern $ = fillpatternget(node name $)
fillpatternset(node name $, fillpattern $)
linepattern $ = linepatternget(node name $)
linepatternset(node name $, linepattern $)

Set the fill and/or line patterns. Example:

button.fillpatternset("myobject", "gray")



fontnameget, fontnameset

fontname $ = fontnameget(node name $)
fontnameset(node name $, fontname $)

Get or set the font name for bevel, roundrect, rectangle, and oval buttons.



fontsizeget, fontsizeset

fontsize # = fontsizeget(node name $)
fontsizeset(node name $, fontsize #)

Get or set the font size of bevel, roundrect, rectangle, and oval buttons.





fullget, fullset, infoget, infoset

full $ = fullget(node name $)
fullset(node name $, full $)
info $ = infoget(node name $)
infoset(node name $, info $)

Get or set XML data that describes all the settings for this node.

The fullget and fullset routines have a header element with appropriate namespaces, infoget and infoset are an XML snippet for access as a property. Example:

mynode.info.title = "new title"



handlesget, handlesset

handles TF = handlesget(node name $)
handlesset(node name $, handles TF)

Turn on or off dragable handles for reshaping the node.

This routine is used by the system tool palettes for manual positioning.
See: markersget, markersset, partget, partset



hiliteget, hiliteset

hilite TF = hiliteget(node name $)
hiliteset(node name $, hilite TF)

Get or set the hilite of the button, which inverts some part of the button's image.

This is useful to show mouse control of the button.



hittest, hittestall

hit TF = hittest(node name $, hor #, ver #)
hit TF = hittestall(node name $, hor #, ver #)

Returns true if the point is in the button.

Hittestall will return true even if the button is inactive.



iconbinaryget, iconbinaryset

binary data $ = iconbinaryget(node name $, icon index #)
iconbinaryset(node name $, icon index #, binary data $)

Get or set binary data for any icon.

This routine is useful for serialization into xml and trading icons between nodes.



iconexport, iconimport

iconexport(node name $, icon index #, file name $)
iconimport(node name $, icon index #, file name $)

Import and export icon pictures. These are regular 32 X 32 bitmapped images.



iconnameget, iconnameset

icon name $ = iconnameget(node name $, icon index #)
iconnameset(node name $, icon index #, icon name $)

Get and set the name of the icon. This should match the show icon name.





linebackcolorget, linebackcolorset, lineforecolorget, lineforecolorset

linebackcolor $ = linebackcolorget(node name $)
linebackcolorset(node name $, linebackcolor $)
lineforecolor $ = lineforecolorget(node name $)
lineforecolorset(node name $, lineforecolor $)

Set the line fore and back colors. The fore color is for "on" bits in the pattern, the back color is for "off" bits.

All alpha channels work fine, 255 for opaque, 0 for clear. Example:

button.lineforecolorset("myobject", "100, 100, 100, 255")





lineheightget, lineheightset, linewidthget, linewidthset

lineheight # = lineheightget(node name $)
lineheightset(node name $, lineheight #)
linewidth # = linewidthget(node name $)
linewidthset(node name $, linewidth #)

Set the line width of bevel, roundrect, rectangle, and oval buttons.



markersget, markersset

markers TF = markersget(node name $)
markersset(node name $, markers TF)

Turn on or off the node outline to show selection.

This routine is used by the system tool palettes to show that a node is selected.
See: handlesset, handlesget, partget, partset



partget, partset

part # = partget(node name $, hor #, ver #)
partset(node name $, hor #, ver #, part #)

Get or set the points for an individual handle.
See: markersget, markersset, handlesset, handlesget



shadowcolorget, shadowcolorset

shadowcolor $ = shadowcolorget(node name $)
shadowcolorset(node name $, shadowcolor $)

Get or set the shadow color for rectangle, oval, roundrect, and beveled buttons.



shadowget, shadowset

shadow # = shadowget(node name $)
shadowset(node name $, shadow #)

Get or set the drop shadow of bevel, roundrect, rectangle, and oval buttons.



showiconget, showiconset

icon name $ = showiconget(node name $)
showiconset(node name $, icon name $)

Get or set the currently showing icon name for the button. Icons are regular 32 X 32 bitmapped images.
See: inserticon, deleteicon, counticons


simpletype

simple type $ = simpletype(node name $)

This function returns the simple type of the button, ignoring any platform specific styles.

Available types include: button, radio, check, toggle, and custom.
See: styleset, styleget



styleget, styleset

style name $ = styleget(node name $)
styleset(node name $, style name $)

Get or set the style of the button.

Custom styles include: rectangle, bevel, roundrect, and oval.

The custom styles have wide ranging properties to set fonts, shadows, patterns, and colors.

Native styles include: nativebutton, nativeradio, nativecheck, and nativetoggle.

The native style matches the appearance of the current operating system.

Windows styles include: windowsbutton, windowsradio, windowscheck, and windowstoggle.

Modern styles include: modernbutton, modernradio, moderncheck, and moderntoggle.

Macintosh styles include: macintoshbutton, macintoshradio, macintoshcheck, and macintoshtoggle.

Classic styles include: classicbutton, classicradio, classiccheck, and classictoggle.

Crystal styles include: crystalbutton, crystalradio, crystalcheck, and crystaltoggle.
See: simpletype



textcolorget, textcolorset

textcolor $ = textcolorget(node name $)
textcolorset(node name $, textcolor $)

Get or set the text color.



titleget, titleset

title $ = titleget(node name $)
titleset(node name $, title $)

Get or set the button title.



titlehorget, titlehorset

title hor # = titlehorget(node name $)
titlehorset(node name $, title hor #)

Get or set the horizontal offset of the title for bevel, roundrect, rectangle, and oval buttons.
See: alignset