8.16.0.4
5 Panels and Tabs🔗ℹ
|
class HPanel(): | implements View | constructor ( | ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top], | ~styles: styles :: MaybeObs.of(List.of(HPanel.Style)) = [], | ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true, | ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0, | ~margin: margin :: MaybeObs.of(Margin) = [0, 0], | ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false], | ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true], | child :: MaybeObs.of(View), ... | ) |
|
|
|
class VPanel(): | implements View | constructor ( | ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top], | ~styles: styles :: MaybeObs.of(List.of(VPanel.Style)) = [], | ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true, | ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0, | ~margin: margin :: MaybeObs.of(Margin) = [0, 0], | ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false], | ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true], | child :: MaybeObs.of(View), ... | ) |
|
Creates a panel that arranges the child views horizontally or
vertically, respectively.
|
class GroupPanel(): | implements View | constructor ( | label :: MaybeObs.of(LabelString), | ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top], | ~styles: styles :: MaybeObs.of(List.of(GroupPanel.Style)) = [], | ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true, | ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0, | ~margin: margin :: MaybeObs.of(Margin) = [0, 0], | ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false], | ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true], | child :: MaybeObs.of(View), ... | ) |
|
Creates a vertical panel that shows grouping under label.
|
class TabsPanel(): | implements View | constructor ( | choices :: MaybeObs.of(List), | ~selection: selection :: MaybeObs.of(Any), | ~action: action :: Function.of_arity(3) = set_selection, | ~choice_to_label: choice_to_label :: Function.of_arity(1) = values, | ~choice_equal: choice_equal :: Function.of_arity(2) = (_ == _), | ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top], | ~styles: styles :: MaybeObs.of(List.of(TabsPanel.Style)) = [], | ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true, | ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0, | ~margin: margin :: MaybeObs.of(Margin) = [0, 0], | ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false], | ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true], | child :: MaybeObs.of(View), ... | ) |
|
|
|
|
Creates a tab panel where choices provides the number and
identity of choices, and selection determines which of the
tabs is selected.
If selection is not an observable, then an observable
at_selection is created with initial value
selection. Otherwise, at_selection is
selection. A observable derived from
at_selection can be obtained from the
TabsPanel.at_selection property.
The choice_to_label function converts an item in
choices to a label to be shown for the tab, and
choice_equal defines equality for choice identities. By
default, choices is expected to be a list of
LabelString, since choice_to_label is the identity
function.
When the tab selection changes, action is called as
where what describes the action, choices is
the list of choices at the time of the action, and
selected is the tab (if any) selected after the action.
The default set_selection function corresponds to
fun (_, _, selected): |
at_selection.value := selected |
To change the content of a TabsPanel based on its
selection, supply a child that is an observable derived from
one supplied as selection.
A panel style option (the same for horizontal and vertical panels).
A group panel style option.
A tab panel style option.