cObject
---cUIObject
------DfBaseObject
---------DfBaseWindow
------------DfBaseUIWindow
---------------DfBaseControl
------------------DfBaseList
---------------------DfBaseForm
------------------------DfBaseEntry
---------------------------Entry
------------------------------dbForm_
---------------------------------dbFormDS
------------------------------------dbCheckBoxDS
---------------------------------------dbCheckbox
The dbCheckbox class is used to combine the functionality of dbForm and CheckBox allowing a data-entry element to be represented in a checkbox format. The data-entry element may only support one of two states, checked (true) and unchecked (false). The actual database value for checked and unchecked may be any value you wish. When used with a data dictionary, the database value for true and false is defined in the data dictionary. When used with a data set, the database value for true and false must be defined within this object.
Object MyCheckBox is a DbCheckBox // assume we are using a data dictionary Set Location to 15 70 Entry_Item Customer.Status Set Label to "Status" End_Object Object MyCheckBox is a DbCheckBox // assume we are using a data set Set location to 15 70 Entry_Item Customer.Status Set CheckBox_Item "Status" "O" "C" // Open (true) Closed (False) Set Status_Help to "Is the customer currently open" End_Object
Use DfEntry.pkg Object objectName is a dbCheckBox Set Location to Row Column Set Label to CheckBoxLabel Set Enabled_State to True|False Entry_Item Table.Column Procedure OnChange : End_Procedure Procedure OnSetFocus : End_Procedure Procedure OnKillFocus : End_Procedure // these are set when not using a DataDictionary Set CheckBox_Item to CheckBoxText TrueDBValue FalseDBValue Set Status_Help to text End_Object
The dbCheckBox class is a subclass of the dbForm class and it inherits all of its data-aware knowledege. It is capable of performing saves, deletes, clears, and finds. Only the method of performing data entry is changed.
When this object's server is a DataDictionary, this object will acquire a great deal of "knowledge" from the server. It will "know" data types, input masks, status help and prompt objects, validation rules, entry rules, exit rule, display formats (capslock, etc., noput, display only, etc.) and much more regarding the table and its columns. The dbCheckBox object will expect the visual control for the column to be defined as dbCheckbox in the DataDictionary.
The key is for the DataDictionary to provide the True and False database values via the Field_Checkbox_Values property. This can be defined in the DataDictionary modeler in the Studio by setting the Validation Type to Boolean and providing the True and False values in the Column Validation dialog.
The label of a dbCheckBox object refers to the text that will appear the right of the check-box. If you wish to show a label to the left of the checkbox (similar to labels found on forms) you will need to create a separate textbox. The label value will be drawn from field properties in the DDO if you set auto_label_state true, overriding any label value you may have set in this object.
The size of a checkbox is determined automatically based on the size of its label text. This auto-sizing may be disabled by setting the auto_size_state property to false.
Every object of this class should always be connected to a server (a data-dictionary object). While the server can be explicitly set within the object, it will usually be set within a parent (or other ancestor) container object.