GetFieldCheckState is a TCheckBoxState function used to -get the current state for the checkbox. GetFieldCheckState uses the internal -TFieldDataLink instance in the class to access the -Field in the linked dataset represented by DataField. +get the current value for the State property in the data-aware check box +control. GetFieldCheckState uses the internal TFieldDataLink +instance in the class to access the Field in the linked dataset represented by DataField.
+ + +-The field value is examined to get the return value for the method. The -return value can be one of the following: +The field type and value are examined to determine the return value for the +method. The return value can be one of the following:
@@ -4625,6 +4635,7 @@ The return value is assigned to the State property when the
DataChange is used to perform actions needed when the linked
dataset for the control has been changed. In TDBCheckBox, this requires
-setting the
-State property for the control. DataChange calls the
+setting the State property for the control. DataChange calls the
GetFieldCheckState method to get the value for the State property.
-DataChange is assigned as the OnDataChange event handler in the
-internal TFieldDataLink instance.
+DataChange is assigned in the constructor as the OnDataChange
+event handler in the internal TFieldDataLink instance for the
+control. It is temporarily unassigned (when used) prior to calling
+GetFieldCheckState, and reassigned prior to exit.
DoOnChange is an overridden method in TDBCheckBox. It ensures that the internal TFieldDataLink is notified of a change -to the control value. The Edit, Modified, and -UpdateRecord methods in the field data link are called to store -the new value for the control. If the linked dataset cannot be edited, the -GetFieldCheckState is called to get the value stored in the -State property. +to the control value.
-DoOnChange calls the inherited method prior to exit. +If the OnDataChange event handler has been assigned for the field data link, +its Edit, Modified, and UpdateRecord methods +are called to store the new value for the control. If the linked dataset +cannot be edited, the GetFieldCheckState method is called to get +the checked state value stored to the State property. +
++The OnDataChange event handler in the data link is temporarily unassigned +proper to updating the field value. The handler is reassigned when the +actions have been completed. +
++DoOnChange calls the inherited method to signal the OnEditingDone and +OnChange event handlers in ancestor classes.
--Create is the constructor for TDBCheckBox. It calls the -inherited Create method, and forms the logical connections for -checked and unchecked, sets initial style and state, forms datalinks and -actions. +Create is the constructor for TDBCheckBox, and calls +the inherited constructor on entry. +
++Create sets the default values for the ValueChecked and ValueUnchecked +properties to the corresponding strings returned from the BoolToStr. ValueChecked is set to '-1'. ValueUnchecked is set to '0'. Change the values +in ValueChecked and ValueUnchecked if other string representations are needed. +
++The default value for the State property is set to cbUnchecked. +
++Create allocates and configures the internal TFieldDataLink instance used to +link the data-aware control to its Field in the underlying DataSource. The +OnDataChange and OnUpdateData event handlers in the link are set to the +DataChange and UpdateData methods in the control.
Destroy is the destructor for TDBCheckBox. It frees -links and calls inherited Destroy method. +the internal field data link, and calls the inherited Destroy +method prior to exit.
+ValueChecked is a String property with the value for +the control when its State property contains the value cbChecked (or Checked +is set to True). It is the string representation for the boolean +value, like: 'True', '1', or -1'. +
++The default value for the property is assigned in the constructor, and +contains the value returned from BoolToStr(True). Changing the value for the +property causes the DataChange method to be called. This updates the control +State after the new property value has been assigned to its member. +
++ValueChecked is not written using the LCL resource streaming mechanism if a +non-default value has not been explicitly assigned to the property. +
++ValueChecked is used in the GetFieldCheckState method when the control is +linked to a field that is not a Boolean field type. It provides the value +which is compared to the field value to determine the checked State for the +control. +
++ValueChecked is also used in the UpdateData method when the control is linked +to field that is not a Boolean field type. It provides the value that is +stored in the field when the Checked property is True (State is +cbChecked). +
++Use ValueUnchecked to specify the string used for the unchecked state in the +control. +
++ValueUnchecked is a String property with the value for +the control when its State property contains the value cbUnchecked (or +Checked is set to False). It is the string representation for the +boolean value, like: 'False' or '0'. +
++The default value for the property is assigned in the constructor, and +contains the value returned from BoolToStr(False). Changing the value for the +property causes the DataChange method to be called. This updates the control +State after the new property value has been assigned to its member. +
++ValueUnchecked is not written using the LCL resource streaming mechanism if a +non-default value has not been explicitly assigned to the property. +
++ValueUnchecked is used in the GetFieldCheckState method when the control is +linked to a field that is not a Boolean field type. It provides the value +which is compared to the field value to determine the checked State for the +control. +
++ValueUnchecked is also used in the UpdateData method when the control is +linked to field that is not a Boolean field type. It provides the value that +is stored in the field when the Checked property is False (State is +cbUnchecked). +
++Use ValueChecked to specify the string used for the checked state in the +control. +
+@@ -8694,7 +8837,7 @@ handlers in the TFieldDataLink instance.