User Guide

Ruby Component
Message Boxes
It's useful to be able to provide warnings when performing unrecoverable actions or to ask a user for confirmation. This is where message
boxes come in. You can create a message box using the messageBox method:
messageBox id, text [,title [,type ]]
The inputs to the method are as follows:
id - an id that you can use on the callback so you know which one is reporting
text - the text to display in the message box
title - the text for the title bar of the message box [OPTIONAL]
type - defines how the message box looks and behaves [OPTIONAL]
The type is a combination of strings in any order with any separators you like. The options are as follows:
Button arrangements: okcancel, retrycancel, yesnocancel, yesno, abortretryignore
Icons: exclaimation, warning, information, asterisk, question, stop, error, hand
Default buttons: defbutton1, defbutton2, defbutton3, defbutton4
Once the message box has closed it will report back to the Ruby component. You can capture the reported information by implementing the
following method:
def messageBoxFinished id, result
end
The id input is the id of the message box that is reporting (the one you supplied when you created it). The result input is the button that was
pressed eg "yes", "ok", "cancel", "retry" etc.
Here's an example of a message box in action. In this example we've clicked on the UI so the mouseLDown method has already been called
and created the message box.
155 of 212