A simple alert.
A simple subclass of modaldialog,
alert provides a modal alert box that displays
its text attribute (or content) and an OK button. (If you need to
display more than text in an alert, use
modaldialog itself).
<canvas height="140">
<alert name="myalert">
Danger! Danger, Will Robinson!
</alert>
<button onclick="canvas.myalert.open()">Show Alert</button>
</canvas>
modaldialog and alert
| Attributes | |||||
| Name | Usage | Type (Tag) | Type (JS) | Default | Category |
| button1 | Tag & JS | string | String | OK | setter |
|
Alert shows only this button, if button2 isn't set. Default: "OK". You may specify a different string to change the text of the button. |
|||||
|
|
|||||
| button2 | Tag & JS | string | String | setter | |
|
If a string is set for this attribute, a second button will be shown to the left of the first with this text. |
|||||
|
|
|||||
| maxtextwidth | Tag & JS | expression | any | setter | |
|
The max length of a line of text before it wraps. Default: 1/3 of the parent's width - width of window dressing and margin. |
|||||
|
|
|||||
| onresult | Tag & JS | expression | any | setter | |
|
This event is sent when a button is pressed. Use this to check the result value. |
|||||
|
|
|||||
| result | Tag & JS | expression | any | null | setter |
|
After the alert is closed, this is set to true if button1 ("OK") is pressed or false if button2 is pressed. You can check for the result value using the onresult event. |
|||||
|
|
|||||
| text_x | Tag & JS | number | Number | 0 | setter |
|
The x position of the button text. Default: 0 (left). |
|||||
|
|
|||||
| text_y | Tag & JS | number | Number | 0 | setter |
|
The y position of the button text. Default: 0 (top). |
|||||
|
|
|||||
doesenter, enabled, hasdefault, isdefault, style, styleable, text
allowdrag, datacontrolsvisibility, haswindowfocus, minheight, minwidth, state
content_inset_bottom, content_inset_left, content_inset_right, content_inset_top
class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes
aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset
closeable, inset_bottom, inset_left, inset_right, inset_top, title, titlearea_inset_top
| close() | ||
| alert.close(res) | ||
|
Closes the alert window. This method is used by the alert button(s). If button1 is clicked, close is passed a true value. If button2 is clicked, close is passed a false value. |
||
| Parameters | ||
| Name | Type | Desc |
| res | Boolean | a boolean result value. |
|
|
||
| open() | ||
| alert.open() | ||
|
Opens the alert window. |
||
|
|
doEnterDown, doEnterUp, doSpaceDown, doSpaceUp, setStyle, setTint, updateDefault
bringToFront, sendBehind, sendInFrontOf, sendToBack, setVisible, setWindowFocus
animate, applyConstraint, applyData, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption
addProxyPolicy, addSubview, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, init, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize
| Events |
onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony
Copyright © 2002-2005 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.