ControlFrame (class)
public ControlFrame {inherits BaseFrame, StandardControl, CommandBinding}
Import from: CURL.GUI.STANDARD. Defined in package CURL.GUI.CONTROL-BASE.
Direct Known Subclasses: MultiUIControlFrame, ValueControlFrame-of

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.

Constructors
default:Create a new ControlFrame object.
constructor public {ControlFrame.default bound-command:#Command = null, ...}
Properties
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.color:FillPattern
control-appearance-changeable?:Determines whether the appearance of the control is based on the look-and-feel object or the standard option parent.
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
control-content-background:This option controls the color for the background for the content of a control, if any.
nonlocal option public ControlFrame.control-content-background:Background
enabled?:Specifies whether the Visual is enabled.
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
style-element:The "element" or "type" of this Visual, for the purpose of styling.
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
text-line-through?:This option affects the way text in the control is rendered.
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 CommandBinding: bound-command, bound-command-impl
Properties inherited from Control: control-container, dialog, focus-skin, form, has-value?, skin
Properties inherited from StandardActiveTraversor: focus-object
Properties inherited from GetBoundsBox: layout-locally-valid?, layout-valid?
Properties inherited from ActiveTraversor: _active-traversal-container, active-traversal-container, mnemonic, tab-index, takes-focus?, valid?, validation-result
Properties inherited from EventTarget: event-handlers
Properties inherited from Box: clip-child-shadows?
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
Properties inherited from DataBindingTarget: data-binding-context, data-bindings
Properties inherited from OptionListInterface: option-register-proc, registered-option-keys
Methods
become-active:Respond to becoming active.
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 CommandBinding: handle-observer-message
Methods inherited from BasicBox: contains-point?, find-graphic-at, handle-crossing, on-pointer-envelope-event, pointer-enter-occurred, pointer-leave-occurred
Methods inherited from Control: on-pointer-press
Methods inherited from StandardActiveTraversor: become-active-from-traversal, fire-event-at-container, handle-mnemonic, on-focus-in, on-key-press
Methods inherited from Observer: observe, stop-observing
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 GetBoundsBox: get-bounds, get-elastic-bounds-into, get-nonparent-bounds-into, request-layout, validate-layout
Methods inherited from ActiveTraversor: mark-invalid, mark-valid, request-key-focus
Methods inherited from EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
Methods inherited from Box: compare-children, find-test-children, get-delimited-child-text-selection, get-range-as-selected-text, get-visible-rect-in-root-into, graphical-child-visible-at, make-gui-mark, search-next-here, search-prev-here
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 BasicEventTarget: enqueue-event
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 GraphicOptions: any-to-Distance, get-display-context
Methods inherited from DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
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
Methods inherited from InitRestArgParser: process-rest-args
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Constructor Details
default (constructor)
public {ControlFrame.default bound-command:#Command = null, ...}

Create a new ControlFrame object.

bound-command: Command to bind to. See CommandBinding.
...: Rest arguments are passed to BaseFrame.


Property Details
color (nonlocal option)
public ControlFrame.color:FillPattern

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"}
}


control-appearance-changeable? (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.


control-color (nonlocal option)
public ControlFrame.control-color:FillPattern

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"}
}


control-content-background (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"}
}


enabled? (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.



font-family (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"}
}


font-size (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"}
}


font-style (nonlocal option)
public ControlFrame.font-style:FontStyle

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"}
}


font-weight (nonlocal option)
public ControlFrame.font-weight:FontWeight

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"}
}


style-element (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


text-breakable? (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"
    }
}


text-line-through? (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"}
}


text-preserve-whitespace? (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"}
}


text-underline? (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"}
}


visible? (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 Details
become-active (method)
public {ControlFrame.become-active forward?:bool = true}:bool

Respond to becoming active.

Description

Should be called by ActiveTraversalContainer when this ActiveTraversor becomes active. May also be called by the user to ask that an ActiveTraversor become active.
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.


clear (method)
public {ControlFrame.clear}:void

Remove the graphical children of a box.