From: <ah...@us...> - 2008-03-11 16:10:51
|
Revision: 11758 http://jvcl.svn.sourceforge.net/jvcl/?rev=11758&view=rev Author: ahuser Date: 2008-03-11 09:10:47 -0700 (Tue, 11 Mar 2008) Log Message: ----------- Added support for BCD and FMTBCD BooleanFields Modified Paths: -------------- trunk/jvcl/run/JvDBGrid.pas Modified: trunk/jvcl/run/JvDBGrid.pas =================================================================== --- trunk/jvcl/run/JvDBGrid.pas 2008-03-11 14:05:42 UTC (rev 11757) +++ trunk/jvcl/run/JvDBGrid.pas 2008-03-11 16:10:47 UTC (rev 11758) @@ -1115,8 +1115,9 @@ if FBooleanEditor then begin Result := (Field.DataType = ftBoolean); - if (not Result) and Assigned(FOnCheckIfBooleanField) and - (Field.DataType in [ftSmallint, ftInteger, ftLargeint, ftWord, ftString, ftWideString]) then + if not Result and Assigned(FOnCheckIfBooleanField) and + (Field.DataType in [ftSmallint, ftInteger, ftLargeint, ftWord, ftString, ftWideString, + ftBCD {$IFDEF COMPILER6_UP}, ftFMTBCD{$ENDIF}]) then begin FStringForTrue := '1'; FStringForFalse := '0'; @@ -1158,7 +1159,7 @@ Result := Ord(gpUnChecked) else Result := Ord(gpChecked); - ftSmallint, ftInteger, ftLargeint, ftWord: + ftSmallint, ftInteger, ftLargeint, ftWord, ftBCD {$IFDEF COMPILER6_UP}, ftFMTBCD{$ENDIF}: if EditWithBoolBox(Field) and not Field.IsNull then if Field.AsInteger = 0 then Result := Ord(gpUnChecked) @@ -3670,7 +3671,7 @@ case FBooleanFieldToEdit.DataType of ftBoolean: FBooleanFieldToEdit.Value := (FieldValueChange = JvGridBool_CHECK); - ftString, ftWideString: + ftString, ftWideString, ftBCD {$IFDEF COMPILER6_UP}, ftFMTBCD{$ENDIF}: begin if FieldValueChange = JvGridBool_CHECK then FBooleanFieldToEdit.Value := FStringForTrue @@ -3685,7 +3686,7 @@ case FBooleanFieldToEdit.DataType of ftBoolean: FBooleanFieldToEdit.Value := not FBooleanFieldToEdit.AsBoolean; - ftString, ftWideString: + ftString, ftWideString, ftBCD {$IFDEF COMPILER6_UP}, ftFMTBCD{$ENDIF}: begin if AnsiSameText(FBooleanFieldToEdit.AsString, FStringForTrue) then FBooleanFieldToEdit.Value := FStringForFalse This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |