(class)
A superclass for Controls that are visually BaseFrames.
Description
This is an instantiable class that implements all the common functionality of a basic control with no value.
This class inherits from
BaseFrame, which means that to add graphic children to it you must subclass it and use
BaseFrame.add-internal from within the class.
| constructor
public
| {ControlFrame.default bound-command:#Command = null, ...} |
| color: | On a control this option affects the color of text and small symbols such as the small triangle on the button in a ComboBox. |
nonlocal option public ControlFrame.control-appearance-changeable?:
bool
| control-color: | This option controls the main color of the button-like parts of a control. |
nonlocal option public ControlFrame.control-color:
FillPattern
nonlocal option public ControlFrame.control-content-background:
Background
nonlocal option public ControlFrame.enabled?:
bool
| font-family: | This option affects the font used by text in the control. |
nonlocal option public ControlFrame.font-family:
String
| font-size: | This option affects the font used by text in the control. |
nonlocal option public ControlFrame.font-size:
any
| font-style: | This option affects the font used by text in the control. |
nonlocal option public ControlFrame.font-style:
FontStyle
| font-weight: | This option affects the font used by text in the control. |
nonlocal option public ControlFrame.font-weight:
FontWeight
accessor public ControlFrame.style-element:
String
| text-breakable?: | This option affects whether the text in the control can be broken across multiple lines. |
nonlocal option public ControlFrame.text-breakable?:
bool
nonlocal option public ControlFrame.text-line-through?:
bool
| text-preserve-whitespace?: | This option affects whether the text in the control preserves, or collapses, whitespace and newlines. |
nonlocal option public ControlFrame.text-preserve-whitespace?:
bool
| text-underline?: | This option affects the way text in the control is rendered. |
nonlocal option public ControlFrame.text-underline?:
bool
| visible?: | A bool that can be used to make this object transparent and invisible for the purposes of drawing and PointerEvent dispatching. |
local option public ControlFrame.visible?:
bool Properties inherited from BaseFrame:
child, clonable-class?, completely-clonable-children?, graphical-children, halign-spec, hstretch?-spec, ordered-children, reverse-ordered-children, valign-spec, vstretch?-spec, width-first? Properties inherited from Visual:
_style-element, cursor, data-source, dragee, input-method-enabled?, input-method-keyboard-mode, name, options, options-present-here, style-class, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data Properties inherited from Graphic:
avoid-page-break?, background, border-color, border-spec, border-style, border-width, cell-border-spec, cell-border-width, cell-margin, discrete-select-in-range?, display-context, graphic-selectable, height, horigin, is-paginating?, layout, margin, opaque-to-events?, option-parent, outside-margin, pagination-state, parent, selection-context, shadow-color, shadow-spec, vorigin, width
|
public
| {ControlFrame.become-active forward?:bool = true}:bool |
| clear: | Remove the graphical children of a box. |
|
public
| {ControlFrame.clear}:void |
Methods inherited from BaseFrame:
add-internal, after-reposition, allocate-layout-object, attempt-revalidate-layout, before-reposition, clone-appearance-helper, compute-child-bounds, compute-parent-elastic, constrain-height, constrain-width, draw, end-pagination, get-height-preference, get-text, get-width-preference, install-child-bounds, internal-remove-child, note-attached, note-detaching, notify-option-children, paginate, pick-child, propagate-request-layout, register-options, set-size Methods inherited from GuiEventTarget:
handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-out, on-grab-release, on-gui-event, on-input-method-event, on-key-event, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class Methods inherited from Visual:
add, add-from-init-args, add-option, add-style-option, animate, change-cursor, clonable-appearance?, clone-appearance, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-caret-position, on-drag-leave, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-option, remove-style-option, scroll-to-include, test-record, test-run, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates Methods inherited from Graphic:
create-pagination-state, detach, draw-range-as-selected, draw-shadow, find-ancestor, find-graphical-ancestor, fire-inferior-crossing-event, get-graphical-root, get-origin-in-graphical-ancestor, get-origin-in-root, get-pagination-state, get-top-left-in-ancestor, get-visible-bounds-into, on-drag-enter, on-inspection, on-pointer-enter, option-changed, paint-with-decorations, replace-with, request-draw, request-draw-rect, request-pointer-trace, search-next, search-prev, set-layout, start-pagination, xy-offset-to Methods inherited from OptionListInterface:
change-option-parent-notify, clone-options, get-option, get-option-by-name, keyword-init-arg, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, option-change-notify, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
(constructor)
| public
| {ControlFrame.default bound-command:#Command = null, ...} |
(nonlocal option)
On a control this option affects the color of text and small symbols such as the small triangle on the button in a ComboBox.
Example
| Example:
Specifying the color |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, color="red",
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{Scrollbar width=.8in, direction=Orientation.horizontal},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
public ControlFrame.control-appearance-changeable?:
bool Determines whether the appearance of the control is based on the look-and-feel object or the standard option parent.
Description
If this property is
false, both local and non-local options will be searched for in the controls
look-and-feel object
after looking for them locally.
Note that in the case of non-local options, this lookup takes place
before the normal lookup in the control's option parent. This implies that non-local options set on the
look-and-feel will shadow option settings that otherwise might normally be inherited from the control's option parent.
See the documentation for
StandardLookAndFeel for a list of the options that are affected in the usual case where the
look-and-feel is a
StandardLookAndFeel.
Notes
This property itself is a non-local option that may be set on this object or on another Graphic that contains it. Its value will never be drawn from the look-and-feel, however.
(nonlocal option)
This option controls the main color of the button-like parts of a control.
Example
| Example:
Specifying the control-color |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, control-color="red",
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{Scrollbar width=.8in, direction=Orientation.horizontal},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
public ControlFrame.control-content-background:
Background This option controls the color for the background for the content of a control, if any.
Example
| Example:
Specifying the control-content-background |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true,
control-content-background="yellow",
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{Scrollbar width=.8in, direction=Orientation.horizontal},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
public ControlFrame.enabled?:
bool Specifies whether the Visual is enabled.
Description
If this option is
false, user interaction with the object and any GUI objects it contains is disabled.
Instead of setting this option to
true, it is usually better to
unset it so that the value at some parent container will determine the effective value.
- When this option is false, text appears according to the options disabled-color and disabled-text-sunken?.
Example
| Example |
 |
{paragraph I am enabled}
{paragraph enabled? = false, I'm not}
| |
When this option is false and the
Visual is a control, then the user-interface for the control is disabled. Any text in its label appears disabled, as described above.
Example
| Example |
 |
{radio-buttons
value = "first",
{RadioButton radio-value = "first"},
{RadioButton
radio-value = "second",
reactive-label = {ReactiveLabel
label-disabled = "(second)"
},
enabled? = false
},
{RadioButton radio-value = "third"}
}
| |
(nonlocal option)
public ControlFrame.font-family:
String This option affects the font used by text in the control.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying the font family |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, font-family="serif",
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
public ControlFrame.font-size:
any This option affects the font used by text in the control.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying the font size |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, font-size=.5em,
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
This option affects the font used by text in the control.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying the font style |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, font-style="italic",
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
This option affects the font used by text in the control.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying the font weight |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, font-weight="bold",
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(accessor)
accessor public ControlFrame.style-element:
String The "element" or "type" of this Visual, for the purpose of styling.
Description
This implementation returns the value of
Visual._style-element but is normally overridden to return a constant value.
Overriding
If a subclass of
Visual should be stylable separately from other types of objects, this getter should be overridden to return an appropriate string. By convention, this string is the name of the class or the name of the markup that produces the object.
An override must return
self._style-element if it is not the empty string.
Introduced in:
version 6.0
(nonlocal option)
public ControlFrame.text-breakable?:
bool This option affects whether the text in the control can be broken across multiple lines.
Notes
Not all controls containing text support this option.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying whether text is breakable |
 |
{HBox valign="bottom", spacing=4pt,
font-size=10pt,
{CommandButton width=50pt, text-breakable? = false,
label="Sample Button"
},
{CheckButton width=50pt, text-breakable? = false,
label="Sample CheckButton"
},
{ComboBox width=50pt, text-breakable? = false,
prompt="Choose One", "First", "Second"
},
{TextField width=50pt, text-breakable? = false,
value="Sample text"
}
}
{HBox valign="bottom", spacing=4pt,
font-size=10pt,
{CommandButton width=50pt, text-breakable? = true,
label="Sample Button"
},
{CheckButton width=50pt, text-breakable? = true,
label="Sample CheckButton"
},
{ComboBox width=50pt, text-breakable? = true,
prompt="Choose One", "First", "Second"
},
{TextField width=50pt, text-breakable? = true,
value="Sample text"
}
}
| |
(nonlocal option)
public ControlFrame.text-line-through?:
bool This option affects the way text in the control is rendered.
Notes
Not all controls containing text support this option.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying the line-through |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, text-line-through? = true,
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(nonlocal option)
public ControlFrame.text-preserve-whitespace?:
bool This option affects whether the text in the control preserves, or collapses, whitespace and newlines.
Notes
Not all controls containing text support this option.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying whether whitespace is preserved. |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true,
text-preserve-whitespace? = true,
font-size=10pt,
{CommandButton width=50pt, label="Sample Button"},
{CheckButton width=50pt, label="Sample CheckButton"},
{ComboBox width=50pt, prompt="Choose One", "First", "Second"},
{TextField width=50pt, value="Sample text"}
}
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true,
text-preserve-whitespace? = false,
font-size=10pt,
{CommandButton width=50pt, label="Sample Button"},
{CheckButton width=50pt, label="Sample CheckButton"},
{ComboBox width=50pt, prompt="Choose One", "First", "Second"},
{TextField width=50pt, value="Sample text"}
}
| |
(nonlocal option)
public ControlFrame.text-underline?:
bool This option affects the way text in the control is rendered.
Notes
Not all controls containing text support this option.
Description
See
text for more information about text-related options.
Example
| Example:
Specifying the underline |
 |
{HBox valign="bottom", spacing=4pt,
control-appearance-changeable?=true, text-underline? = true,
{CommandButton label="Sample Button"},
{CheckButton label="Sample"},
{ComboBox width=1.2in, prompt="Choose One", "First", "Second"},
{TextField width=1.0in, value="Sample text"}
}
| |
(local option)
public ControlFrame.visible?:
bool A bool that can be used to make this object transparent and invisible for the purposes of drawing and PointerEvent dispatching.
Description
If the visible? option is true (the default), the object displays and behaves normally. If the visible? option is set to false, the object still takes up the same amount of space as before, but it draws no pixels and also appears transparent to pointer events.
An object that is not visible can still take keyboard focus. It is recommended that you set enabled? = false when setting visible? = false.
(method)
| public
| {ControlFrame.become-active forward?:bool = true}:bool |
Respond to becoming active.
Description
forward?: True if traversal is moving forward (Tab key), false if it is moving backwards (shift Tab key). User code should generally use the default of true.
Returns
True if this object is willing to become active, false otherwise.
(method)
| public
| {ControlFrame.clear}:void |
Remove the graphical children of a box.