IDEIntf: TPropertyEditorHook changed method names to be ansistring instead shortstring

git-svn-id: trunk@15712 -
This commit is contained in:
mattias 2008-07-08 18:48:15 +00:00
parent b3038dc825
commit 1546f3eee9
4 changed files with 26 additions and 27 deletions

View File

@ -120,7 +120,7 @@ type
function DoOnGetSrcPathForCompiledUnit(Sender: TObject; function DoOnGetSrcPathForCompiledUnit(Sender: TObject;
const AFilename: string): string; const AFilename: string): string;
function OnInternalGetMethodName(const AMethod: TMethod; function OnInternalGetMethodName(const AMethod: TMethod;
CheckOwner: TObject): shortstring; CheckOwner: TObject): string;
function FindCodeOfMainUnitHint(Code: TCodeBuffer): TCodeBuffer; function FindCodeOfMainUnitHint(Code: TCodeBuffer): TCodeBuffer;
procedure CreateScanner(Code: TCodeBuffer); procedure CreateScanner(Code: TCodeBuffer);
procedure SetAbortable(const AValue: boolean); procedure SetAbortable(const AValue: boolean);
@ -4347,7 +4347,7 @@ begin
end; end;
function TCodeToolManager.OnInternalGetMethodName(const AMethod: TMethod; function TCodeToolManager.OnInternalGetMethodName(const AMethod: TMethod;
CheckOwner: TObject): shortstring; CheckOwner: TObject): string;
begin begin
if Assigned(OnGetMethodName) then if Assigned(OnGetMethodName) then
Result:=OnGetMethodName(AMethod,CheckOwner) Result:=OnGetMethodName(AMethod,CheckOwner)

View File

@ -136,7 +136,7 @@ type
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
TOnGetMethodname = function(const AMethod: TMethod; TOnGetMethodname = function(const AMethod: TMethod;
CheckOwner: TObject): shortstring of object; CheckOwner: TObject): string of object;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// flags/states for searching // flags/states for searching

View File

@ -403,9 +403,9 @@ type
procedure OIOnFindDeclarationOfProperty(Sender: TObject); procedure OIOnFindDeclarationOfProperty(Sender: TObject);
procedure OIOnUpdateRestricted(Sender: TObject); procedure OIOnUpdateRestricted(Sender: TObject);
function OnPropHookGetMethodName(const Method: TMethod; function OnPropHookGetMethodName(const Method: TMethod;
CheckOwner: TObject): ShortString; CheckOwner: TObject): String;
procedure OnPropHookGetMethods(TypeData: PTypeData; Proc:TGetStringProc); procedure OnPropHookGetMethods(TypeData: PTypeData; Proc:TGetStringProc);
function OnPropHookMethodExists(const AMethodName: ShortString; function OnPropHookMethodExists(const AMethodName: String;
TypeData: PTypeData; TypeData: PTypeData;
var MethodIsCompatible, MethodIsPublished, var MethodIsCompatible, MethodIsPublished,
IdentIsMethod: boolean): boolean; IdentIsMethod: boolean): boolean;
@ -413,8 +413,8 @@ type
ATypeInfo:PTypeInfo; ATypeInfo:PTypeInfo;
APersistent: TPersistent; APersistent: TPersistent;
const APropertyPath: string): TMethod; const APropertyPath: string): TMethod;
procedure OnPropHookShowMethod(const AMethodName:ShortString); procedure OnPropHookShowMethod(const AMethodName: String);
procedure OnPropHookRenameMethod(const CurName, NewName:ShortString); procedure OnPropHookRenameMethod(const CurName, NewName: String);
function OnPropHookBeforeAddPersistent(Sender: TObject; function OnPropHookBeforeAddPersistent(Sender: TObject;
APersistentClass: TPersistentClass; APersistentClass: TPersistentClass;
AParent: TPersistent): boolean; AParent: TPersistent): boolean;
@ -1412,7 +1412,7 @@ begin
end; end;
function TMainIDE.OnPropHookGetMethodName(const Method: TMethod; function TMainIDE.OnPropHookGetMethodName(const Method: TMethod;
CheckOwner: TObject): ShortString; CheckOwner: TObject): String;
var var
JITMethod: TJITMethod; JITMethod: TJITMethod;
begin begin
@ -13927,7 +13927,7 @@ begin
Result:=GetProjectFileWithRootComponent(AComponent); Result:=GetProjectFileWithRootComponent(AComponent);
end; end;
function TMainIDE.OnPropHookMethodExists(const AMethodName: ShortString; function TMainIDE.OnPropHookMethodExists(const AMethodName: String;
TypeData: PTypeData; TypeData: PTypeData;
var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean): boolean; var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean): boolean;
var ActiveSrcEdit: TSourceEditor; var ActiveSrcEdit: TSourceEditor;
@ -13991,7 +13991,7 @@ begin
end; end;
end; end;
procedure TMainIDE.OnPropHookShowMethod(const AMethodName: ShortString); procedure TMainIDE.OnPropHookShowMethod(const AMethodName: String);
var var
ActiveSrcEdit: TSourceEditor; ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
@ -14019,7 +14019,7 @@ begin
end; end;
end; end;
procedure TMainIDE.OnPropHookRenameMethod(const CurName, NewName: ShortString); procedure TMainIDE.OnPropHookRenameMethod(const CurName, NewName: String);
var ActiveSrcEdit: TSourceEditor; var ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
BossResult: boolean; BossResult: boolean;

View File

@ -1125,13 +1125,13 @@ type
TPropHookCreateMethod = function(const Name: ShortString; ATypeInfo: PTypeInfo; TPropHookCreateMethod = function(const Name: ShortString; ATypeInfo: PTypeInfo;
APersistent: TPersistent; const APropertyPath: string): TMethod of object; APersistent: TPersistent; const APropertyPath: string): TMethod of object;
TPropHookGetMethodName = function(const Method: TMethod; TPropHookGetMethodName = function(const Method: TMethod;
CheckOwner: TObject): ShortString of object; CheckOwner: TObject): String of object;
TPropHookGetMethods = procedure(TypeData:PTypeData; Proc:TGetStringProc) of object; TPropHookGetMethods = procedure(TypeData:PTypeData; Proc:TGetStringProc) of object;
TPropHookMethodExists = function(const Name:ShortString; TypeData: PTypeData; TPropHookMethodExists = function(const Name: String; TypeData: PTypeData;
var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean
):boolean of object; ):boolean of object;
TPropHookRenameMethod = procedure(const CurName, NewName:ShortString) of object; TPropHookRenameMethod = procedure(const CurName, NewName: String) of object;
TPropHookShowMethod = procedure(const Name:ShortString) of object; TPropHookShowMethod = procedure(const Name: String) of object;
TPropHookMethodFromAncestor = function(const Method:TMethod):boolean of object; TPropHookMethodFromAncestor = function(const Method:TMethod):boolean of object;
TPropHookChainCall = procedure(const AMethodName, InstanceName, TPropHookChainCall = procedure(const AMethodName, InstanceName,
InstanceMethod:ShortString; TypeData:PTypeData) of object; InstanceMethod:ShortString; TypeData:PTypeData) of object;
@ -1230,12 +1230,12 @@ type
function CreateMethod(const Name: ShortString; ATypeInfo:PTypeInfo; function CreateMethod(const Name: ShortString; ATypeInfo:PTypeInfo;
APersistent: TPersistent; APersistent: TPersistent;
const APropertyPath: string): TMethod; const APropertyPath: string): TMethod;
function GetMethodName(const Method: TMethod; CheckOwner: TObject): ShortString; function GetMethodName(const Method: TMethod; CheckOwner: TObject): String;
procedure GetMethods(TypeData: PTypeData; Proc: TGetStringProc); procedure GetMethods(TypeData: PTypeData; Proc: TGetStringProc);
function MethodExists(const Name: ShortString; TypeData: PTypeData; function MethodExists(const Name: String; TypeData: PTypeData;
var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean):boolean; var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean):boolean;
procedure RenameMethod(const CurName, NewName: ShortString); procedure RenameMethod(const CurName, NewName: String);
procedure ShowMethod(const Name: ShortString); procedure ShowMethod(const Name: String);
function MethodFromAncestor(const Method: TMethod):boolean; function MethodFromAncestor(const Method: TMethod):boolean;
procedure ChainCall(const AMethodName, InstanceName, procedure ChainCall(const AMethodName, InstanceName,
InstanceMethod: ShortString; TypeData: PTypeData); InstanceMethod: ShortString; TypeData: PTypeData);
@ -3908,7 +3908,7 @@ end;
function TMethodPropertyEditor.GetEditLimit: Integer; function TMethodPropertyEditor.GetEditLimit: Integer;
begin begin
Result := MaxIdentLength; Result := 2*MaxIdentLength+1; // clasname.methodname
end; end;
function TMethodPropertyEditor.GetFormMethodName: shortstring; function TMethodPropertyEditor.GetFormMethodName: shortstring;
@ -4013,9 +4013,8 @@ end;
procedure TMethodPropertyEditor.SetValue(const NewValue: ansistring); procedure TMethodPropertyEditor.SetValue(const NewValue: ansistring);
var var
CreateNewMethod: Boolean; CreateNewMethod: Boolean;
CurValue: ansistring; CurValue: string;
//OldMethod: TMethod; NewMethodExists, NewMethodIsCompatible, NewMethodIsPublished,
NewMethodExists,NewMethodIsCompatible,NewMethodIsPublished,
NewIdentIsMethod: boolean; NewIdentIsMethod: boolean;
begin begin
CurValue:=GetValue; CurValue:=GetValue;
@ -5214,7 +5213,7 @@ begin
end; end;
function TPropertyEditorHook.GetMethodName(const Method: TMethod; function TPropertyEditorHook.GetMethodName(const Method: TMethod;
CheckOwner: TObject): ShortString; CheckOwner: TObject): String;
var var
i: Integer; i: Integer;
begin begin
@ -5249,7 +5248,7 @@ begin
TPropHookGetMethods(FHandlers[htGetMethods][i])(TypeData,Proc); TPropHookGetMethods(FHandlers[htGetMethods][i])(TypeData,Proc);
end; end;
function TPropertyEditorHook.MethodExists(const Name:Shortstring; function TPropertyEditorHook.MethodExists(const Name: String;
TypeData: PTypeData; TypeData: PTypeData;
var MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean):boolean; var MethodIsCompatible, MethodIsPublished, IdentIsMethod: boolean):boolean;
var var
@ -5274,7 +5273,7 @@ begin
end; end;
end; end;
procedure TPropertyEditorHook.RenameMethod(const CurName, NewName:ShortString); procedure TPropertyEditorHook.RenameMethod(const CurName, NewName: String);
// rename published method in LookupRoot object and source // rename published method in LookupRoot object and source
var var
i: Integer; i: Integer;
@ -5284,7 +5283,7 @@ begin
TPropHookRenameMethod(FHandlers[htRenameMethod][i])(CurName,NewName); TPropHookRenameMethod(FHandlers[htRenameMethod][i])(CurName,NewName);
end; end;
procedure TPropertyEditorHook.ShowMethod(const Name:Shortstring); procedure TPropertyEditorHook.ShowMethod(const Name:String);
// jump cursor to published method body // jump cursor to published method body
var var
i: Integer; i: Integer;