mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 07:29:29 +02:00
* Enable property setter by default
* Fixed index in list class git-svn-id: trunk@23440 -
This commit is contained in:
parent
49e3d2734e
commit
164c677cfd
@ -30,7 +30,13 @@ TYpe
|
|||||||
TVisitorOption = (voRead,voReadList,voCreate,voDelete,voUpdate,
|
TVisitorOption = (voRead,voReadList,voCreate,voDelete,voUpdate,
|
||||||
voCommonSetupParams,voSingleSaveVisitor,voRegisterVisitors);
|
voCommonSetupParams,voSingleSaveVisitor,voRegisterVisitors);
|
||||||
TVisitorOptions = set of TVisitorOption;
|
TVisitorOptions = set of TVisitorOption;
|
||||||
|
|
||||||
|
{ TTiOPFFieldPropDef }
|
||||||
|
|
||||||
|
TTiOPFFieldPropDef = Class(TFieldPropDef)
|
||||||
|
Public
|
||||||
|
Constructor Create(ACollection : TCollection); override;
|
||||||
|
end;
|
||||||
{ TTiOPFCodeOptions }
|
{ TTiOPFCodeOptions }
|
||||||
|
|
||||||
TTiOPFCodeOptions = Class (TClassCodeGeneratorOptions)
|
TTiOPFCodeOptions = Class (TClassCodeGeneratorOptions)
|
||||||
@ -100,6 +106,7 @@ TYpe
|
|||||||
// Not to be overridden.
|
// Not to be overridden.
|
||||||
procedure WriteListAddObject(Strings: TStrings; const ListClassName, ObjectClassName: String);
|
procedure WriteListAddObject(Strings: TStrings; const ListClassName, ObjectClassName: String);
|
||||||
// Overrides of parent objects
|
// Overrides of parent objects
|
||||||
|
Function CreateFieldPropDefs : TFieldPropDefs; override;
|
||||||
function AllowPropertyDeclaration(F: TFieldPropDef; AVisibility: TVisibilities): Boolean; override;
|
function AllowPropertyDeclaration(F: TFieldPropDef; AVisibility: TVisibilities): Boolean; override;
|
||||||
Function GetInterfaceUsesClause : string; override;
|
Function GetInterfaceUsesClause : string; override;
|
||||||
procedure WriteVisibilityStart(V: TVisibility; Strings: TStrings); override;
|
procedure WriteVisibilityStart(V: TVisibility; Strings: TStrings); override;
|
||||||
@ -134,6 +141,14 @@ begin
|
|||||||
Delete(Result,1,1);
|
Delete(Result,1,1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TTiOPFFieldPropDef }
|
||||||
|
|
||||||
|
constructor TTiOPFFieldPropDef.Create(ACollection: TCollection);
|
||||||
|
begin
|
||||||
|
inherited Create(ACollection);
|
||||||
|
PropSetters:=[psWrite];
|
||||||
|
end;
|
||||||
|
|
||||||
{ TTiOPFCodeOptions }
|
{ TTiOPFCodeOptions }
|
||||||
|
|
||||||
function TTiOPFCodeOptions.GetListClassName: String;
|
function TTiOPFCodeOptions.GetListClassName: String;
|
||||||
@ -872,7 +887,7 @@ begin
|
|||||||
ptSingle, ptDouble, ptExtended, ptComp :
|
ptSingle, ptDouble, ptExtended, ptComp :
|
||||||
S:='AsFloat';
|
S:='AsFloat';
|
||||||
ptCurrency :
|
ptCurrency :
|
||||||
S:='AsCurrency';
|
S:='AsFloat';
|
||||||
ptDateTime :
|
ptDateTime :
|
||||||
S:='AsDateTime';
|
S:='AsDateTime';
|
||||||
ptEnumerated :
|
ptEnumerated :
|
||||||
@ -1139,7 +1154,7 @@ begin
|
|||||||
AddLn(Strings,'Public');
|
AddLn(Strings,'Public');
|
||||||
IncIndent;
|
IncIndent;
|
||||||
Try
|
Try
|
||||||
AddLn(Strings,'Property Items[Index : Integer] : %s Read GetObj Write SetObj; Default;',[ObjectClassname]);
|
AddLn(Strings,'Property Items[AIndex : Integer] : %s Read GetObj Write SetObj; Default;',[ObjectClassname]);
|
||||||
Finally
|
Finally
|
||||||
DecIndent;
|
DecIndent;
|
||||||
end;
|
end;
|
||||||
@ -1178,6 +1193,11 @@ begin
|
|||||||
Addln(Strings);
|
Addln(Strings);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TTiOPFCodeGenerator.CreateFieldPropDefs: TFieldPropDefs;
|
||||||
|
begin
|
||||||
|
Result:=TFieldPropDefs.Create(TTiOPFFieldPropDef);
|
||||||
|
end;
|
||||||
|
|
||||||
function TTiOPFCodeGenerator.AllowPropertyDeclaration(F: TFieldPropDef;
|
function TTiOPFCodeGenerator.AllowPropertyDeclaration(F: TFieldPropDef;
|
||||||
AVisibility: TVisibilities): Boolean;
|
AVisibility: TVisibilities): Boolean;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user