mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 00:02:05 +02:00
IDE: method property editor: fixed creating new event
git-svn-id: trunk@55225 -
This commit is contained in:
parent
be678e2bf1
commit
92ef27e2f4
@ -4600,6 +4600,7 @@ procedure TMethodPropertyEditor.Edit;
|
||||
}
|
||||
var
|
||||
NewMethodName: String;
|
||||
r: TModalResult;
|
||||
begin
|
||||
NewMethodName := GetValue;
|
||||
{$IFDEF VerboseMethodPropEdit}
|
||||
@ -4615,10 +4616,14 @@ begin
|
||||
PropertyHook.ShowMethod(NewMethodName);
|
||||
end else begin
|
||||
// the current method is from the another class (e.g. ancestor or frame)
|
||||
case QuestionDlg('Override or jump',
|
||||
'The event "'+GetName+'" currently points to an inherited method.',
|
||||
mtConfirmation,[mrYes,'Create Override',mrOk,'Jump to inherited method',mrCancel],
|
||||
0) of
|
||||
if IsValidIdent(NewMethodName) then
|
||||
r:=QuestionDlg('Override or jump',
|
||||
'The event "'+GetName+'" currently points to an inherited method.',
|
||||
mtConfirmation,[mrYes,'Create Override',mrOk,'Jump to inherited method',mrCancel],
|
||||
0)
|
||||
else
|
||||
r:=mrYes;
|
||||
case r of
|
||||
mrYes:
|
||||
begin
|
||||
// -> add an override with the default name
|
||||
|
@ -12772,10 +12772,14 @@ begin
|
||||
Root:=GlobalDesignHook.LookupRoot;
|
||||
if Root=nil then exit;
|
||||
if TObject(Method.Data)=Root then begin
|
||||
Result:=(Method.Code<>nil) and (Root.MethodName(Method.Code)<>'');
|
||||
Result:=(Method.Code<>nil) and (Root.MethodName(Method.Code)<>'')
|
||||
and (Root.ClassParent.MethodName(Method.Code)='');
|
||||
end else if IsJITMethod(Method) then begin
|
||||
JITMethod:=TJITMethod(Method.Data);
|
||||
Result:=Root.ClassType=JITMethod.TheClass;
|
||||
{$IFDEF VerboseMethodPropEdit}
|
||||
debugln(['TMainIDE.PropHookMethodFromLookupRoot Root=',DbgSName(Root),' JITMethod.TheClass=',JITMethod.TheClass.ClassName,' Result=',Result]);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user