Controls
Extends: CONTROL > WIDGET
Based on CONTROL: BUTTON, CHECKBOX, RADIOBUTTON, EDITBOX, LISTBOX, POPUP, SLIDER, STATICTEXT, WEBCAM
Controls are widgets that provide the standard operating system widgets like buttons, edit fields, and the like. Logo supports a number of standard controls. All controls contain the same set of properties as all widgets, plus a few extra properties. You cannot create a CONTROL object, only objects that are also controls.
By default, a control has a transparent background, except for buttons. You can change a control’s background color and opacity by setting its BACKGROUND property.
All controls inherit the properties of the WIDGET object. They share this common set of properties:
BACKGROUND
Part of: CONTROL
Controls the background color of a control.
Syntax
GPROP "BUTTON "BACKGROUND
PPROP "BUTTON "BACKGROUND color
Description
BACKGROUND controls the background color of the control. By default, it is set to white, but some controls may have a different background color.
Examples
DRAW ; Drop a BUTTON widget from the Toolbox > Controls BUTTON dropped GPROP “BUTTON “BACKGROUND Result: [240 240 240 1]
COLOR
Part of: CONTROL
Controls the text color of a control.
Syntax
GPROP "BUTTON "COLOR
PPROP "BUTTON "COLOR color
Description
COLOR controls the text color of the control. The color depends on the type of control, and not every control honors the setting of this property.
Examples
DRAW ; Drop a BUTTON widget from the Toolbox > Controls BUTTON dropped GPROP “BUTTON “COLOR Result: [0 0 0 1]
RUN
Part of: CONTROL
Contains a runlist to be executed when a control has been clicked or changed.
Syntax
GPROP "BUTTON "RUN
PPROP "BUTTON "RUN runlist
Description
When the user clicks a button, or selects a file, a list box entry, or changes a control generally, Logo looks if the control has a RUN property. If so, Logo executes the runlist stores in that property. This is an elegant way to react to user input.
Examples
DRAW ; Drop a BUTTON widget from the Toolbox > Controls BUTTON dropped PPROP “BUTTON “RUN [PR “|I was clicked|]
SELECTED
Part of: CONTROL
Changes the input focus to the control.
Syntax
GPROP "EDIT "SELECTED
PPROP "EDIT "SELECTED TRUE/FALSE
Description
SELECTED reads always as FALSE. Set it to TRUE to switch the input focus to the control.
Examples
DRAW ; Drop an EDIT object from the Toolbox > Controls EDIT dropped PPROP “EDIT “SELECTED TRUE
TEXT
Part of: CONTROL
Gets or sets the text of the control.
Syntax
GPROP "BUTTON "TEXT
PPROP "BUTTON "TEXT text
Description
The TEXT property sets the text of the control. This may be the label, the text to display, or the text to select for list boxes or popups. Reading the property outputs the current text, the label, or the selected text for list boxes and popups.
Examples
DRAW ; Drop a BUTTON widget from the Toolbox > Controls BUTTON dropped GPROP “BUTTON “TEXT Result: Click me PPROP “BUTTON “TEXT “OK
TEXTALIGN
Part of: CONTROL
Controls the alignment of the text within the control.
Syntax
GPROP "BUTTON "TEXTALIGN
PPROP "BUTTON "TEXTALIGN alignment
Description
Setting this property causes any content to be aligned horizontally. Legal values are LEFT
, CENTER
, and RIGHT
. Note that some controls like the GRID
control ignore the alignment setting.
Examples
DRAW ; Drop a BUTTON widget from the Toolbox > Controls BUTTON dropped PPROP “BUTTON “TEXTALIGN “LEFT