mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 10:39:09 +02:00
* Patch from Paul Ishenin to fix several Delphi-incompatilibities:
- Make TField.SetDataset virtual - Pass SetVariant argument as const - Add TField.Lookup property - Add TDataset.SetDefaultsField protected method git-svn-id: trunk@11129 -
This commit is contained in:
parent
a33023e384
commit
826ffc899f
@ -1177,6 +1177,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDataSet.SetDefaultFields(const Value: Boolean);
|
||||||
|
begin
|
||||||
|
FDefaultFields := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TDataset.SetField (Index : Longint;Value : TField);
|
Procedure TDataset.SetField (Index : Longint;Value : TField);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -257,8 +257,8 @@ type
|
|||||||
{ TField }
|
{ TField }
|
||||||
|
|
||||||
TField = class(TComponent)
|
TField = class(TComponent)
|
||||||
Private
|
private
|
||||||
FAlignMent : TAlignment;
|
FAlignment : TAlignment;
|
||||||
FAttributeSet : String;
|
FAttributeSet : String;
|
||||||
FCalculated : Boolean;
|
FCalculated : Boolean;
|
||||||
FConstraintErrorMessage : String;
|
FConstraintErrorMessage : String;
|
||||||
@ -296,16 +296,17 @@ type
|
|||||||
FValidating : Boolean;
|
FValidating : Boolean;
|
||||||
FVisible : Boolean;
|
FVisible : Boolean;
|
||||||
FProviderFlags : TProviderFlags;
|
FProviderFlags : TProviderFlags;
|
||||||
Function GetIndex : longint;
|
function GetIndex : longint;
|
||||||
|
function GetLookup: Boolean;
|
||||||
procedure SetAlignment(const AValue: TAlignMent);
|
procedure SetAlignment(const AValue: TAlignMent);
|
||||||
procedure SetIndex(const AValue: Integer);
|
procedure SetIndex(const AValue: Integer);
|
||||||
Procedure SetDataset(AValue : TDataset);
|
|
||||||
function GetDisplayText: String;
|
function GetDisplayText: String;
|
||||||
function GetEditText: String;
|
function GetEditText: String;
|
||||||
procedure SetEditText(const AValue: string);
|
procedure SetEditText(const AValue: string);
|
||||||
procedure SetDisplayLabel(const AValue: string);
|
procedure SetDisplayLabel(const AValue: string);
|
||||||
procedure SetDisplayWidth(const AValue: Longint);
|
procedure SetDisplayWidth(const AValue: Longint);
|
||||||
function GetDisplayWidth: integer;
|
function GetDisplayWidth: integer;
|
||||||
|
procedure SetLookup(const AValue: Boolean);
|
||||||
procedure SetReadOnly(const AValue: Boolean);
|
procedure SetReadOnly(const AValue: Boolean);
|
||||||
procedure SetVisible(const AValue: Boolean);
|
procedure SetVisible(const AValue: Boolean);
|
||||||
function IsDisplayStored : Boolean;
|
function IsDisplayStored : Boolean;
|
||||||
@ -350,9 +351,10 @@ type
|
|||||||
procedure SetAsLongint(AValue: Longint); virtual;
|
procedure SetAsLongint(AValue: Longint); virtual;
|
||||||
procedure SetAsInteger(AValue: Integer); virtual;
|
procedure SetAsInteger(AValue: Integer); virtual;
|
||||||
procedure SetAsLargeint(AValue: Largeint); virtual;
|
procedure SetAsLargeint(AValue: Largeint); virtual;
|
||||||
procedure SetAsVariant(AValue: variant); virtual;
|
procedure SetAsVariant(const AValue: variant); virtual;
|
||||||
procedure SetAsString(const AValue: string); virtual;
|
procedure SetAsString(const AValue: string); virtual;
|
||||||
procedure SetAsWideString(const aValue: WideString); virtual;
|
procedure SetAsWideString(const aValue: WideString); virtual;
|
||||||
|
procedure SetDataset(AValue : TDataset); virtual;
|
||||||
procedure SetDataType(AValue: TFieldType);
|
procedure SetDataType(AValue: TFieldType);
|
||||||
procedure SetNewValue(const AValue: Variant);
|
procedure SetNewValue(const AValue: Variant);
|
||||||
procedure SetSize(AValue: Word); virtual;
|
procedure SetSize(AValue: Word); virtual;
|
||||||
@ -406,7 +408,7 @@ type
|
|||||||
property OldValue: variant read GetOldValue;
|
property OldValue: variant read GetOldValue;
|
||||||
property LookupList: TLookupList read GetLookupList;
|
property LookupList: TLookupList read GetLookupList;
|
||||||
published
|
published
|
||||||
property AlignMent : TAlignMent Read FAlignMent write SetAlignment default taLeftJustify;
|
property Alignment : TAlignment read FAlignment write SetAlignment default taLeftJustify;
|
||||||
property CustomConstraint: string read FCustomConstraint write FCustomConstraint;
|
property CustomConstraint: string read FCustomConstraint write FCustomConstraint;
|
||||||
property ConstraintErrorMessage: string read FConstraintErrorMessage write FConstraintErrorMessage;
|
property ConstraintErrorMessage: string read FConstraintErrorMessage write FConstraintErrorMessage;
|
||||||
property DefaultExpression: string read FDefaultExpression write FDefaultExpression;
|
property DefaultExpression: string read FDefaultExpression write FDefaultExpression;
|
||||||
@ -417,11 +419,12 @@ type
|
|||||||
property HasConstraints: Boolean read FHasConstraints;
|
property HasConstraints: Boolean read FHasConstraints;
|
||||||
property Index: Longint read GetIndex write SetIndex;
|
property Index: Longint read GetIndex write SetIndex;
|
||||||
property ImportedConstraint: string read FImportedConstraint write FImportedConstraint;
|
property ImportedConstraint: string read FImportedConstraint write FImportedConstraint;
|
||||||
|
property KeyFields: string read FKeyFields write FKeyFields;
|
||||||
|
property Lookup: Boolean read GetLookup write SetLookup;
|
||||||
|
property LookupCache: Boolean read FLookupCache write FLookupCache;
|
||||||
property LookupDataSet: TDataSet read FLookupDataSet write FLookupDataSet;
|
property LookupDataSet: TDataSet read FLookupDataSet write FLookupDataSet;
|
||||||
property LookupKeyFields: string read FLookupKeyFields write FLookupKeyFields;
|
property LookupKeyFields: string read FLookupKeyFields write FLookupKeyFields;
|
||||||
property LookupResultField: string read FLookupResultField write FLookupResultField;
|
property LookupResultField: string read FLookupResultField write FLookupResultField;
|
||||||
property KeyFields: string read FKeyFields write FKeyFields;
|
|
||||||
property LookupCache: Boolean read FLookupCache write FLookupCache;
|
|
||||||
property Origin: string read FOrigin write FOrigin;
|
property Origin: string read FOrigin write FOrigin;
|
||||||
property ProviderFlags : TProviderFlags read FProviderFlags write FProviderFlags;
|
property ProviderFlags : TProviderFlags read FProviderFlags write FProviderFlags;
|
||||||
property ReadOnly: Boolean read FReadOnly write SetReadOnly;
|
property ReadOnly: Boolean read FReadOnly write SetReadOnly;
|
||||||
@ -1203,6 +1206,7 @@ type
|
|||||||
procedure SetBufListSize(Value: Longint); virtual;
|
procedure SetBufListSize(Value: Longint); virtual;
|
||||||
procedure SetChildOrder(Component: TComponent; Order: Longint); override;
|
procedure SetChildOrder(Component: TComponent; Order: Longint); override;
|
||||||
procedure SetCurrentRecord(Index: Longint); virtual;
|
procedure SetCurrentRecord(Index: Longint); virtual;
|
||||||
|
procedure SetDefaultFields(const Value: Boolean);
|
||||||
procedure SetFiltered(Value: Boolean); virtual;
|
procedure SetFiltered(Value: Boolean); virtual;
|
||||||
procedure SetFilterOptions(Value: TFilterOptions); virtual;
|
procedure SetFilterOptions(Value: TFilterOptions); virtual;
|
||||||
procedure SetFilterText(const Value: string); virtual;
|
procedure SetFilterText(const Value: string); virtual;
|
||||||
|
@ -608,6 +608,11 @@ begin
|
|||||||
Result:=-1;
|
Result:=-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TField.GetLookup: Boolean;
|
||||||
|
begin
|
||||||
|
Result := FieldKind = fkLookup;
|
||||||
|
end;
|
||||||
|
|
||||||
function TField.GetAsLargeInt: LargeInt;
|
function TField.GetAsLargeInt: LargeInt;
|
||||||
begin
|
begin
|
||||||
Raise AccessError(SLargeInt);
|
Raise AccessError(SLargeInt);
|
||||||
@ -742,7 +747,7 @@ begin
|
|||||||
Raise AccessError(SFloat);
|
Raise AccessError(SFloat);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TField.SetAsVariant(AValue: Variant);
|
procedure TField.SetAsVariant(const AValue: Variant);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if VarIsNull(AValue) then
|
if VarIsNull(AValue) then
|
||||||
@ -939,6 +944,13 @@ begin
|
|||||||
result:=FDisplayWidth;
|
result:=FDisplayWidth;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TField.SetLookup(const AValue: Boolean);
|
||||||
|
const
|
||||||
|
ValueToLookupMap: array[Boolean] of TFieldKind = (fkData, fkLookup);
|
||||||
|
begin
|
||||||
|
FieldKind := ValueToLookupMap[AValue];
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TField.SetReadOnly(const AValue: Boolean);
|
procedure TField.SetReadOnly(const AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if (FReadOnly<>Avalue) then
|
if (FReadOnly<>Avalue) then
|
||||||
|
Loading…
Reference in New Issue
Block a user