A button appears on the screen as a rectangle with a textual label. When the user presses the button, it will execute its associated message with the following parameters:
@receiver The button itself
If dialog_item<-message
is @default,
the button will send its graphical<-name
to its
graphical<-device.
Thus, a button named apply will invoke graphical->apply
on the dialog box it is displayed on.
A button may be assigned a key-sequence to activate it. See
dialog_item<-accelerator.
If the dialog_item<-accelerator
is "RET" the button is the
default button of its device and will be highlighted. See
also
dialog->default_button).
A button may be assigned a popup menu using button->popup.
Existence of a popup menu is indicated using a small triangle.
Bugs:
It is not possible to use an arbitrary bitmap as a button. Class label
provides a (conceptually inferior) way to create active
images.
->key:
name is received. See window->typed
for an explanation on handling accelerators in dialog windows.<-device.
This implies two things. First of all, if an item in the dialog is
modified, the item will invoke dialog->modified_item.
If the dialog finds a device<-default_button,
it will make the default button graphical->active.
If the RETURN key is hit in the dialog window, the default button will
be button->execute’d.The method button->label switches this
flag automatically to @off
if the label is set to an image.
<-width and graphical<-height
using the graphical<-name
and button<-font. If the required size
turns out to be smaller than button.size this
size is used instead.-default_button, button<-default_button->event.
If this fails it passes the event to @_button_gesture (a click_gesture
object).<-message
is not @nil, button->execute
acts as a wrapper around
button->forward,
dealing with the visual feedback. The visual feedback consist of
switching button->status
to execute and setting the busy-cursor (using display->busy_cursor).<-message:
<-name
is sent to graphical<-device
<-name.
The displayed dialog_item<-label
is computed from this name using char_array<-label_name
from the
graphical<-name.
When the button is depressed (using the left-button) it will button->execute
itself, activating the given code
object.
->typed. Key
is the symbolic name of the key(-sequence) typed. If this key
is equal to dialog_item<-accelerator,
button->execute
the button.<-popup
and update (add/remove) the indication on the button for the existence
of a popup menu.|image*<-selection<-status
and redraw:
active and inactive Normal appearance preview Inverted inside execute Grey inside background
create is @on,
a popup is associated with the button. This popup has one item with the
following attributes:
`menu_item <-value` <-name `menu_item <-label` <-label `menu_item <-message` message(@arg1, execute)
The message will button->execute
the button when the first item is selected.
<->label.
For compatibility with older versions as well as for compatibility with
other dialog_item's.