标签:
{ TStringField } TStringField = class(TField) private FFixedChar: Boolean; FTransliterate: Boolean; protected class procedure CheckTypeSize(Value: Integer); override; function GetAsBCD: TBcd; override; function GetAsBoolean: Boolean; override; function GetAsDateTime: TDateTime; override; function GetAsSingle: Single; override; function GetAsFloat: Double; override; function GetAsExtended: Extended; override; function GetAsInteger: Longint; override; function GetAsLargeInt: Largeint; override; function GetAsSQLTimeStamp: TSQLTimeStamp; override; function GetAsString: string; override; function GetAsAnsiString: AnsiString; override; function GetAsVariant: Variant; override; function GetDataSize: Integer; override; function GetDefaultWidth: Integer; override; procedure GetText(var Text: string; DisplayText: Boolean); override; function GetValue(var Value: AnsiString): Boolean; procedure SetAsBCD(const Value: TBcd); override; procedure SetAsBoolean(Value: Boolean); override; procedure SetAsDateTime(Value: TDateTime); override; procedure SetAsSingle(Value: Single); override; procedure SetAsFloat(Value: Double); override; procedure SetAsExtended(Value: Extended); override; procedure SetAsInteger(Value: Longint); override; procedure SetAsLargeInt(Value: Largeint); override; procedure SetAsSQLTimeStamp(const Value: TSQLTimeStamp); override; procedure SetAsString(const Value: string); override; procedure SetAsAnsiString(const Value: AnsiString); override; procedure SetVarValue(const Value: Variant); override; public constructor Create(AOwner: TComponent); override; property Value: AnsiString read GetAsAnsiString write SetAsAnsiString; published property EditMask; property FixedChar: Boolean read FFixedChar write FFixedChar default False; property Size default 20; property Transliterate: Boolean read FTransliterate write FTransliterate default True; end; { TWideStringField } TWideStringField = class(TStringField) protected class procedure CheckTypeSize(Value: Integer); override; procedure CopyData(Source, Dest: Pointer); override; function GetAsAnsiString: AnsiString; override; function GetAsString: string; override; function GetAsVariant: Variant; override; function GetAsWideString: UnicodeString; override; function GetDataSize: Integer; override; procedure GetText(var Text: string; DisplayText: Boolean); override; function GetValue(var Value: UnicodeString): Boolean; procedure SetAsAnsiString(const Value: AnsiString); override; procedure SetAsString(const Value: string); override; procedure SetVarValue(const Value: Variant); override; procedure SetAsWideString(const Value: UnicodeString); override; public constructor Create(AOwner: TComponent); override; property Value: UnicodeString read GetAsWideString write SetAsWideString; end;
标签:
原文地址:http://www.cnblogs.com/CodeGear/p/4542709.html