|
class gui.Button(): | implements WindowChildView | constructor ( | label :: ObsOrValue.of(View.LabelString | || draw.Bitmap | || [draw.Bitmap, | View.LabelString, | Button.LabelPosition]), | ~action: action :: () -> ~any = fun (): #void, | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~styles: styles :: ObsOrValue.of(List.of(Button.Style)) = [], | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#false, #false] | ) |
|
Creates a button. When rendered, the function call action()
is performed when the button is clicked.
Creates a checkbox. When rendered, the function call
action(now_checked) is performed when the
checkbox is clicked, where now_checked indicates the
state of the checkbox.
The Checkbox.at_is_checked property returns an observable that
is updated whenever the checkbox’s state changes through an action (as
also reported via action) or via is_checked as an
observable.
|
class gui.Choice(): | implements WindowChildView | constructor ( | choices :: ObsOrValue.of(List), | ~choice_to_label: choice_to_label :: Any -> Any = values, | ~choice_equal: choice_equal :: Function.of_arity(2) = (_ == _), | ~selection: selection :: ObsOrValue.of(Any) = #false, | ~action: action :: Any -> ~any = values, | ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false, | ~styles: styles :: ObsOrValue.of(List.of(Choice.Style)) = [], | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(Stretch) = [#true, #true] | ) |
|
|
|
|
Creates a popup choice selector where choices provides the
number and identity of choices, and selection determines which
of the tabs is selected. When rendered, the function call
action(now_selected) is performed when the
selection is changed, where now_selected indicates the
newly selected choice.
The Choice.at_selection property returns an observable that
is updated whenever the choice popup’s state changes through an action
(as also reported via action) or via selection as an
observable.
The choice_to_label function converts an item in
choices to a label to be shown for the control, and
choice_equal defines equality for choice identities. By
default, choices is expected to be a list of
View.LabelString, since choice_to_label is the identity
function.
|
class gui.RadioChoice(): | implements WindowChildView | constructor ( | choices :: List.of(String), | ~choice_to_label: choice_to_label :: Any -> Any = values, | ~choice_equal: choice_equal :: Function.of_arity(2) = (_ == _), | ~selection: selection :: ObsOrValue.of(Any) = #false, | ~action: action :: Any -> ~any = values, | ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false, | ~styles: styles :: ObsOrValue.of(List.of(RadioChoice.Style)) | = [#'vertical], | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(Stretch) = [#true, #true] | ) |
|
|
|
|
Like
gui.Choice, but presented as radio buttons instead of a
popup menu. Unlike
gui.Choice, the
choices list
cannot be changed.
The styles list must include either #'vertical or
#'horizontal.
|
class gui.ListChoice(): | implements WindowChildView | constructor ( | choices :: ObsOrValue.of(List), | ~choice_to_label: choice_to_label :: Any -> Any = values, | ~choice_equal: choice_equal :: Function.of_arity(2) = (_ == _), | ~selection: selection :: ObsOrValue.of(Any) = #false, | ~action: action :: Any -> ~any = values, | ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false, | ~styles: styles :: ObsOrValue.of(List.of(ListChoice.StyleSymbol)) = [], | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~font : font :: draw.Font = normal_control_font, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(Stretch) = [#true, #true] | ) |
|
|
|
|
Like
gui.Choice, but presented as a list box instead of a
popup menu. The
ListChoice view is a simplified version of
the
Table view.
|
class gui.Table(): | implements WindowChildView | constructor ( | columns :: List.of(View.LabelString), | choices :: ObsOrValue.of(Array), | ~action: action :: (Table.Event, Array, Table.Selection) -> ~any | = values, | ~choice_to_row: choice_to_row :: Any -> Array.now_of(View.LabelString) | = values, | ~selection: selection :: ObsOrValue.of(Table.Selection) = #false, | ~label: label :: ObsOrValue.of(View.LabelString) = "", | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~style: style :: ObsOrValue.of(List.of(Table.StyleSymbol)) | = [#'single, #'column_headers, | #'clickable_headers, #'reorderable_headers], | ~font : font :: Font = normal_control_font, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #false], | ~column_widths: column_widths :: ObsOrValue.of(List.of(Table.CellWidth)) | = [] | ) |
|
|
|
|
Creates a list-row selector where choices provides column
labels (and, implicitly, the column column), choices provides
the number and identity of rows, and selection determines
which of the lines are selected. When rendered, the function call
action(event, choices, selection)
is performed when the table is changed, where event
indicates the kind of action, choices indicates the
choices at the time of the event, and choice selection
identifies the selected rows.
The Table.at_selection property returns an observable that
is updated whenever the table’s selection state changes through an action
(as also reported via action) or via selection as an
observable.
The choice_to_row function converts an element of
choices to an array of label strings to show in the table.
The style list must contain exactly one of single,
#'multiple, and #'extended.
|
class gui.Slider(): | implements WindowChildView | constructor ( | ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false, | ~value: value :: ObsOrValue.of(View.PositionInt) = 0, | ~min_value: min_value :: ObsOrValue.of(View.PositionInt) = 0, | ~max_value: max_value :: ObsOrValue.of(View.PositionInt) = 100, | ~action: action :: View.PositionInt -> ~any = values, | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #true], | ~styles: styles :: List.of(Slider.Style) = [#'horizontal] | ) |
|
|
|
|
Creates a slider. When rendered, the function call
action(now_val) is performed when the
slider is changed, where now_val indicates the value of
the slider.
The Slider.at_value property returns an observable that
is updated whenever the slider’s value changes through an action
(as also reported via action) or via value as an
observable.
The styles list must include one of #'horiziontal
and #'vertical.
|
class gui.Progress(): | implements WindowChildView | constructor ( | value :: ObsOrValue.of(View.SizeInt) = 0, | ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false, | ~max_value: max_value :: ObsOrValue.of(View.PosSizeInt) = 100, | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #true], | ~styles: styles :: List.of(Progress.Style) = [#'horizontal] | ) |
|
|
|
|
Creates a read-only (from the user’s perspective) progress gauge that
show value out of max_value progress.
The styles list must include one of #'horiziontal
and #'vertical.
The Progress.at_value property returns an observable that is
updated whenever the progress gauge’s state changes through
value as an observable.
Creates a text label.
The Label.at_label property returns an observable that is
updated whenever the label’s state changes through
label as an observable.
Creates a bitmap image display showing either a
draw.Bitmap instance or one that is loaded from a
specified file path.
When size has #false for a dimension, then the size
of content is used. Within that size, the image is either
scaled to fit in both dimensions when display is
#'fit, or it is stretched to fill in both dimensions when
display is #'fill.
If the image view has a different size based on min_size and
stretch, then the image is centered within the view’s area.
|
class gui.Input(): | implements WindowChildView | constructor ( | content :: ObsOrValue.of(Any), | ~action: action :: maybe((Input.Event, String) -> ~any) = #false, | ~label: label :: ObsOrValue.of(View.LabelString) = "", | ~is_enabled: is_enabled :: ObsOrValue.of(Boolean) = #true, | ~background_color: bg_color :: ObsOrValue.of(maybe(Color)) = #false, | ~styles: styles :: ObsOrValue.of(List.of(Input.Style)) = [#'single], | ~font : font :: Font = normal_control_font, | ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2], | ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false], | ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #true], | ~is_equal_value: is_equal :: Function.of_arity(2) = (_ == _), | ~value_to_text: val_to_txt :: Function = values | ) |
|
|
|
|
Returns a representation of a text field that calls action on change.
The first argument to the action is the type of event that caused
the input to change and the second is the contents of the text field.
The ~is_equal_value argument controls when changes to the input data
are reflected in the contents of the field. The contents of the input field only
change when the new value of the underlying observable is not == to the
previous one. The only exception to this is when the textual value
(via ~value_to_text) of the observable is the empty string, in which case
the input is cleared regardless of the value of the underlying observable.
The ~value_to_text argument controls how the input values are rendered
to strings. If not provided, value must be either a string? or an observable
of strings.
The Input.at_content property returns an observable that
is updated whenever the input’s value changes through an action
(as also reported via action) or via content as an
observable.
Returns a representation of a spacer. By default, spacers extend to
fill the space of their parents.
A button style option.
A button label-position option for text combined with an image.
A choice control style option.
A
Table control style option.
An event provided to the
~action callback function of an
Table. A
#'select event reports a change in
the selection,
#'double_click reports a double click, and
#'column indicates a chagne in column order.
A slider style option.
A slider style option.
An input style option.
An event provided to the
~action callback function of an
Input. The event
#'input corresponds to any
change to the input text, while
#'return indicates that the
Return or Enter key was pressed. The
#'focus_in and
#'focus_out events report keyboard-focus changes.
Scaling options for
Image.