This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R8
Check Boxes

Check Boxes  


 

Use  

A check box is used to enter or display binary (true-false) data. It is a type of button. A check box is either selected or deselected. Its effect is controlled by a method. Like all buttons, a check box is set to 0 when the form is first opened. The method associated with a check box executes when the check box is selected.

A check box displays text next to a small square. This text is set in the Title area of the “Objects” theme in the Property List. You can enter a title in the form of an XLIFF reference in this area (see Appendix B: XLIFF architecture). 

When the user clicks the object, the box is checked. When a check box is checked, it has the value 1. When it is not checked, it has the value 0.
You can also associate a Boolean type variable with the check box. In this case, the variable is True when the box is checked and False when it is not checked.
Any or all check boxes in a form can be checked or unchecked. 

Multiple check boxes allow the user to select multiple options.

Unlike a Boolean field that is formatted as a check box, the values of the check box variable are not stored automatically. You use a method to manage the variable.

Note: 3D check boxes have the same behavior as check boxes but their appearance (for example, the depiction of the checked/unchecked state) is set by the properties of the 3D button family. For more information, refer to 3D Buttons, 3D Check Boxes and 3D Radio Buttons.

Check box objects accept a third state. This third state is an intermediate status, which is generally used for display purposes. It allows, for example, indicating that a property is present in a selection of objects, but not in each object of the selection. 

In order for a check box to take control of this third state, you must set the Three-States property in the “Display” theme of the Property List: 

This property is only available for standard check boxes associated with numeric variables — 3D check boxes and check boxes for Boolean fields cannot use the Three-States property (a Boolean field cannot be in an intermediary state). 

The variable associated with the check box returns the value 2 when the check box is in the third state. 

Tip: In entry mode, the Three-States check boxes display each state sequentially, in the following order: unchecked / checked / intermediary / unchecked, etc. The intermediary state is generally not very useful in entry mode; in the code, simply force the value of the variable to 0 when it takes the value of 2 in order to pass directly from the checked state to the unchecked state.

You can assign a standard action to a check box or a 3D check box (using the command or the "Action" theme of the Property List) to handle attributes of text areas. For example, if you select the "fontBold" standard action, at runtime the check box will manage the "bold" attribute of the selected text in the current area. 

Note: The three-state option is supported with check boxes only, not with 3D check boxes.

Only actions that can represent a true/false status ("checkable" actions) are supported by this object: 

Supported actionsUsage condition (if any)
avoidPageBreakInsideEnabled4D Write Pro areas only
fontItalic
fontBold
fontLinethrough
fontSubscript4D Write Pro areas only
fontSuperscript 4D Write Pro areas only
fontUnderline
font/showDialogMac only
htmlWYSIWIGEnabled4D Write Pro areas only
section/differentFirstPage4D Write Pro areas only
section/differentLeftRightPages4D Write Pro areas only
spell/autoCorrectionEnabled
spell/autoDashSubstitutionsEnabledMac only
spell/autoLanguageEnabledMac only
spell/autoQuoteSubstitutionsEnabledMac only
spell/autoSubstitutionsEnabled
spell/enabled
spell/grammarEnabledMac only
spell/showDialogMac only
spell/visibleSubstitutions
visibleBackground4D Write Pro areas only
visibleFooters4D Write Pro areas only
visibleHeaders4D Write Pro areas only
visibleHiddenChars4D Write Pro areas only
visibleHorizontalRuler4D Write Pro areas only
visiblePageFrames4D Write Pro areas only
visibleReferences
widowAndOrphanControlEnabled4D Write Pro areas only

For detailed information on these actions, please refer to the Standard actions section.

 
PROPERTIES 

Product: 4D
Theme: Working with active objects

 
PAGE CONTENTS 
 
HISTORY 

Modified: 4D v16 R4

 
ARTICLE USAGE

4D Design Reference ( 4D v20 R8)