Sfairadora

  • Reference Guide

Button

The button dispel allows the user to perform an action by clicking the button (or by hitting the spacebar or Enter key on it). The action can be either a command executed by a parent dispel or any Enki language function.

Display

Item
Description
Title
Text displayed on the button.
Alignment
Title alignment if the button is wider than the text contained within. The options are: left, center, right, and auto. If the auto option is in place, the text is aligned according to the button style – right-aligned for the flat in menu style and centered otherwise.
Other
Style
Button appearance:
simple
the button is a simple white rectangle without a frame, containing only the title (appropriate for use in tables and white fields). The actual color may differ depending on Windows settings.
flat in window
the button color is that of the window background, and normally there is no frame. The frame is only displayed when touched by the mouse pointer or activated (it is “lifted”) . When located in a white field or table, the frame is always displayed.
flat on bar
like flat in window; appropriate for buttons in the tool bar.
flat in menu
the button has the same color as the window background and no frame. When activated, the background color changes (standard behavior of menu items).
three-dimensional
common three-dimensional button.
three-dimensional low
three-dimensional button with a thinner frame so that it appears lower.
auto
the style is determined according to the button location.
Icon
Icon displayed to the left of the title. The icon is entered using the icon editor.
Ellipsis
If checked, the button may be shorter than its title – in this situation, ellipsis is displayed at the end of the button indicating that the text continues.
Hidden title
If checked, the title is not displayed on the button; only the icon is displayed. Title text is displayed in the tool tip.
Borders
The spaces left between the button frame and the title. Values for all directions can be specified individually. If no value is specified, borders are determined automatically according to the title text.

Functionality

Item
Description
Action
What happens when user clicks the button:
function evaluation
an Enki language function is evaluated.
new
a new document is created.
open
file open window is displayed.
save
the current document is saved.
save as
a window is displayed, requesting the user to specify the name under which the document will be saved.
save state
the instant state of the application is saved to the configuration file.
close
the current document is closed.
quit
Sfairadora exits.
Action specification
If Action is set to function evaluation, you can specify an Enki language function to be evaluated.
Example 1: Suppose there is a number item called count in the Data document section, and you want to create a button that increases its value by 1. Create a button with action set to function evaluation, and specify the following function:
document.data.count++
Example 2: Suppose there is a table called people containing first_name and last_name columns in the Data document section, and you want to create a button that inserts a row with Joseph Smith into this table. Create a button with action set to function evaluation, and specify the following function:
document.data.people<-insert({first_name: "Joseph", last_name: "Smith"})
Asynchronous
This option is applicable for action set to function evaluation. If checked, the function is evaluated asynchronously, otherwise synchronously.
Synchronous evaluation: the user cannot continue working with the application while the function is running. If it takes too long (or an infinite loop occurs), a dialog appears with a button allowing the user to abort the evaluation.
Asynchronous evaluation: the function is evaluated in the background in parallel with other activities. The button appears pressed-down while the function is running. If clicked again, the function evaluation is aborted.
Example: Suppose there is a number item called count in the Data document section, and you have created a button that evaluates the following function in asynchronous mode:
while(TRUE)
document.data.count++
The function will run in an infinite loop and will keep increasing the value of the count item. You can display the item to see that it is constantly increasing.
If synchronous evaluation is in place, the change of the value is not displayed while the function is still running because Sfairadora only evaluates the function and does not refresh the presentations. After a while, a dialog appears informing the user that a function is being executed and allowing the user to cancel the evaluation. When the function ends, the count item contains the last value returned by the function.
Other
Press by double click
Button action is invoked by a double click instead of the usual single click.
Press by hover when dragging
If checked, then, when the user is dragging data with the mouse and hovers over the button for a while, the button action is invoked. This is useful especially for a button that opens a window into which the user might wish to copy the dragged data.
Disable closing volatile window
If the button is in a temporary window – that is, in a window that is automatically closed when an action in the window is performed (such as the menu window – see the Disp‑folder), then, when this option is checked, the window will not be closed by pressing the button.
Definition type: Button_def